3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ function do_stuff(&$b) { $defined = 0; trigger_error("If I fixed the undefined variable but enabled this line instead, it will also turn b from an object into a string! So user-triggered notices bork it as well."); $x = $undefined || $defined ? 14 : 0; var_dump('In function:', $b); } } class B{} $a = new A(); $b = new B(); $a->do_stuff($b); var_dump('After function:', $b);
Output for git.master, git.master_jit, rfc.property-hooks
Notice: If I fixed the undefined variable but enabled this line instead, it will also turn b from an object into a string! So user-triggered notices bork it as well. in /in/DWllK on line 6 Warning: Undefined variable $undefined in /in/DWllK on line 7 string(12) "In function:" object(B)#2 (0) { } string(15) "After function:" object(B)#2 (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:
45.99 ms | 402 KiB | 8 Q