Toggle navigation
Genres
Frontend (2)
JavaScript (6)
Database (2)
Linux Server (3)
Web Apps (4)
Misc (4)
Search
List
New Tutorials
Last Modified Tutorials
</>
Code examples
code
smiko
backend
php
oop
classes_objects
66interface_multi.php
66interface_multi.php
<?php /** *Primjer pokazuje da klasa moze implementirati vise *interface-a */ interface X { const PII=3.14; public function metodaX(); } interface Y { public function metodaY($p1,$p2); } class A implements X,Y { public function metodaX(){ echo 'Broj PI iznosi '.X::PII; } public function metodaY($p1,$p2){ echo "<br/>{$p1} {$p2}"; } } $obj=new A; $obj->metodaX(); $obj->metodaY('pas','macka'); ?>
Reload page
Preview
W3C validation
Edit Code