3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public stdClass $prop; public function __set($x, $y) { echo "SET\n"; $this->$x = $y; } } $a = new A(); $a->prop = new stdClass; var_dump($a); $a->undeclared = new stdClass; var_dump($a); $a->prop = new stdClass; var_dump($a);
Output for git.master, git.master_jit, rfc.property-hooks
object(A)#1 (1) { ["prop"]=> object(stdClass)#2 (0) { } } SET Deprecated: Creation of dynamic property A::$undeclared is deprecated in /in/3Be7f on line 9 object(A)#1 (2) { ["prop"]=> object(stdClass)#2 (0) { } ["undeclared"]=> object(stdClass)#3 (0) { } } object(A)#1 (2) { ["prop"]=> object(stdClass)#4 (0) { } ["undeclared"]=> object(stdClass)#3 (0) { } }

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:
107.79 ms | 406 KiB | 5 Q