3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $publicProperty; protected $protectedProperty; private $privateProperty; public function __construct() { unset( $this->publicProperty, $this->protectedProperty, $this->privateProperty ); } function __get($name) { echo '__get ' . $name . "\n"; return $this->$name; } function __set($name, $value) { echo '__set ' . $name . "\n"; $this->$name = $value; } function __isset($name) { echo '__isset ' . $name . "\n"; return isset($this->$name); } } $test = new Test(); $test->nonExisting; $test->publicProperty; $test->protectedProperty; $test->privateProperty; isset($test->nonExisting); isset($test->publicProperty); isset($test->protectedProperty); isset($test->privateProperty); $test->nonExisting = 'value'; $test->publicProperty = 'value'; $test->protectedProperty = 'value'; $test->privateProperty = 'value'; ?> --EXPECTF-- __get nonExisting Notice: Undefined index: nonExisting in %__set__get_006.php on line %d __get publicProperty Notice: Undefined index: publicProperty in %__set__get_006.php on line %d __get protectedProperty Notice: Undefined index: protectedProperty in %__set__get_006.php on line %d __get privateProperty Notice: Undefined index: protectedProperty in %__set__get_006.php on line %d __isset nonExisting __isset publicProperty __isset protectedProperty __isset privateProperty __set nonExisting __set publicProperty __set protectedProperty __set privateProperty
Output for git.master, git.master_jit, rfc.property-hooks
__get nonExisting Warning: Undefined property: Test::$nonExisting in /in/XWAgg on line 17 __get publicProperty Warning: Undefined property: Test::$publicProperty in /in/XWAgg on line 17 __get protectedProperty Warning: Undefined property: Test::$protectedProperty in /in/XWAgg on line 17 __get privateProperty Warning: Undefined property: Test::$privateProperty in /in/XWAgg on line 17 __isset nonExisting __isset publicProperty __isset protectedProperty __isset privateProperty __set nonExisting Deprecated: Creation of dynamic property Test::$nonExisting is deprecated in /in/XWAgg on line 22 __set publicProperty __set protectedProperty __set privateProperty --EXPECTF-- __get nonExisting Notice: Undefined index: nonExisting in %__set__get_006.php on line %d __get publicProperty Notice: Undefined index: publicProperty in %__set__get_006.php on line %d __get protectedProperty Notice: Undefined index: protectedProperty in %__set__get_006.php on line %d __get privateProperty Notice: Undefined index: protectedProperty in %__set__get_006.php on line %d __isset nonExisting __isset publicProperty __isset protectedProperty __isset privateProperty __set nonExisting __set publicProperty __set protectedProperty __set privateProperty

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:
34.95 ms | 404 KiB | 8 Q