3v4l.org

run code in 300+ PHP versions simultaneously
<?php $zero = 0; // global scope $f1 = function() use ($zero) { $one = 1; // third-level closure scope of f4 echo $one; $f2 = function() use ($zero, $one) { $two = 2; // second-level closure scope of f4 echo $one; $f3 = function() use ($zero, $one, $two) { $three = 3; // first-level closure scope of f4 $f4 = function() use ($zero, $one, $two, $three) { $four = 4; // local scope of f4 var_dump($zero + $one + $two + $three + $four); }; $f4(); }; }; }; $f1(); $f2();
Output for git.master, git.master_jit, rfc.property-hooks
1 Warning: Undefined variable $f2 in /in/0v2Aq on line 22 Fatal error: Uncaught Error: Value of type null is not callable in /in/0v2Aq:22 Stack trace: #0 {main} thrown in /in/0v2Aq on line 22
Process exited with code 255.

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