3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function __set($key, $value) { trigger_error("Class uses undeclared property: " . __CLASS__ . "->" . $key, E_USER_WARNING); $this->{$key} = $value; } public function usesDynamicProp() { $this->undeclaredProp = "test value"; } public function getsDynamicProp() { var_dump($this->undeclaredProp); } } $o = new Test(); $o->usesDynamicProp(); $o->getsDynamicProp(); // Subsequent calls do not trigger the warning because the property exists, so it will only occur once per script execution $o->usesDynamicProp();
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Class uses undeclared property: Test->undeclaredProp in /in/SgUUG on line 8 Deprecated: Creation of dynamic property Test::$undeclaredProp is deprecated in /in/SgUUG on line 9 string(10) "test value"

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:
29.07 ms | 405 KiB | 5 Q