3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class ParentClass { private $first_name; private $last_name; private $gender; private $age; public function __construct($a, $b, $c, $d = null) { $this->first_name = $a; $this->last_name = $b; $this->gender = $c; $this->age = $d. PHP_EOL; //print 'Parent: ' . $a . $b . $c . $d . PHP_EOL; } public function getFirstName(){ return $this->first_name; } } class ChildClass extends ParentClass { public function __construct() { parent::__construct(1, 9, 3, 7); } } $child = new ChildClass(); echo "<br />"; $child->getFirstName();
based on 3vMVV
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.3.0rc3
<br />