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
04basics_override.php
04basics_override.php
<?php class MojaKlasa { public $var_a='Var a'; public function metoda_a() { return "Tekst iz metode a"; } } class DodanaKlasa extends MojaKlasa { public $var_a='Var b'; public function metoda_a() { return "<br/>Tekst iz metode b"; } } //defininranje objekta $obj=new DodanaKlasa(); echo $obj->var_a; //ispisuje Var b echo $obj->metoda_a(); //ispisuje tekst iz metode b // echo "<br/><br/><br/><hr><br/>"; var_dump($obj); ?>
Reload page
Preview
W3C validation
Edit Code