3v4l.org

run code in 500+ 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, rfc.property-hooks, git.master_jit
Warning: Undefined variable $undefined in /in/VqsdQ 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:
56 ms | 2704 KiB | 4 Q