3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function __get($k) { $this->$k = 42; return 0; } } $a = 42; try { $a %= 0; } catch (Error $e) { echo $e->getMessage(), "\n"; } var_dump($a); $test = new ArrayObject; $test[0] = 42; try { $test[0] %= 0; } catch (Error $e) { echo $e->getMessage(), "\n"; } var_dump($test); $test2 = new Test; try { $test2->prop %= 0; } catch (Error $e) { echo $e->getMessage(), "\n"; } var_dump($test2);
Output for git.master, git.master_jit, rfc.property-hooks
Modulo by zero int(42) Modulo by zero object(ArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> array(1) { [0]=> int(42) } } Deprecated: Creation of dynamic property Test::$prop is deprecated in /in/H17Zf on line 4 Modulo by zero object(Test)#1 (1) { ["prop"]=> int(42) }

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:
56.78 ms | 401 KiB | 8 Q