3v4l.org

run code in 300+ PHP versions simultaneously
<?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; } } $dad = new Dad('a', 'b'); $dad->gotToSchool(); $son = new Son('Nick', 'Long'); $son->drive(); //produce an error
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined method Dad::gotToSchool() in /in/WfsDs:38 Stack trace: #0 {main} thrown in /in/WfsDs on line 38
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
42.86 ms | 401 KiB | 8 Q