3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyParentClass { public function getProperty($propertyName) { return $this->{$propertyName}; } public function setProperty($propertyName, $value) { $this->{$propertyName} = $value; return $this; } } class MyChildClass extends MyParentClass { protected $foo; private $bar; } $child = new Child(); $child->setProperty('foo', 'lulu')->setProperty('bar', true); var_dump( $child->getProperty('foo'), $child->getProperty('bar') );
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "Child" not found in /in/nMA51:23 Stack trace: #0 {main} thrown in /in/nMA51 on line 23
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:
47.55 ms | 401 KiB | 8 Q