3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Dad { protected $name; protected $surname; public function __consruct(string $name, string $surname) { $this->name = $name; $this->surname = $surname; } public function run() { echo 'I run fast'; } protected function drive() { echo 'I drive a car'; } } class Son extends Dad { protected function goToSchool() { echo 'I go to school'; } public function whatIsMyName() { echo $this->name; } } $son = new Son('Nick', 'Long'); $son->whatIsMyName(); // $son->drive();
based on qEX7T
Output for 5.3.19 - 7.2.0