3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getVar(&$var) { $tmp = $var; // store the variable value $var = '_$_%&33xc$%^*7_r4'; // give the variable a new unique value $name = array_search($var, $GLOBALS); // search $GLOBALS for that unique value and return the key(variable) $var = $tmp; // restore the variable old value return $name; } $city = "San Francisco"; $age = 55; $object = new Stdclass; $arr = array(3, 5, 6); echo getVar($city). PHP_EOL; echo getVar($age). PHP_EOL; echo getVar($object). PHP_EOL; echo getVar($arr). PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
city age object arr

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