3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function setKey($sessionKeys, $value) { $sessionKeysArray = explode(':', $sessionKeys); $sessionKey = ''; $keys = '[\'' . implode('\'][\'', $sessionKeysArray) . '\']'; eval('$tmp = is_array(&$_SESSION' . $sessionKey . ') = ' . $value . ' : \'xxx\';'); var_dump($tmp); } $_SESSION['1']['2'] = array(); setKey('1:2:3', 77);
based on lnfVQ
Output for 7.0.0 - 7.2.0
Parse error: syntax error, unexpected '&' in /in/7thKU(9) : eval()'d code on line 1
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Fatal error: Call-time pass-by-reference has been removed in /in/7thKU(9) : eval()'d code on line 1
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Deprecated: Call-time pass-by-reference has been deprecated in /in/7thKU(9) : eval()'d code on line 1 Fatal error: Can't use function return value in write context in /in/7thKU(9) : eval()'d code on line 1
Process exited with code 255.