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
29constructor_inheritance2.php
29constructor_inheritance2.php
<?php class Oglasavaci { public $ime; public $prezime; public function __construct($p1,$p2) { $this->ime=$p1; $this->prezime=$p2; } } class OglasavaciDod extends Oglasavaci { public $mjesto; public function __construct($p1,$p2,$p3) { parent::__construct($p1,$p2); $this->mjesto=$p3; } } $jozo=new OglasavaciDod('Josip','Josipovic','London'); var_dump($jozo); ?>
Reload page
Preview
W3C validation
Edit Code