3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Variable variable. $a = 'b'; $b = 'target'; var_dump($$a == $b); // Anon function with inclusion of scope. $fn = function($c) { var_dump($$c == 'target'); }; $fn($a); // I can use scope within using variable variable. $fn = fn($c) => $$c == 'target'; var_dump($fn($a)); // I can't return it though. $fn = fn($c) => $$c; var_dump($fn($a));
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) Warning: Undefined variable $b in /in/LrCEX on line 9 bool(false) Warning: Undefined variable $b in /in/LrCEX on line 14 bool(false) Warning: Undefined variable $b in /in/LrCEX on line 18 NULL

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