3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function setKey($sessionKeys, $value) { $sessionKeysArray = explode(':', $sessionKeys); $sessionKey = ''; foreach ($sessionKeysArray as $key){ $sessionKey .= "[\'$key\']"; } echo eval('&$_SESSION' . $sessionKey . ' = ' . $value . ';'); var_dump($_SESSION); } setKey('1:2:3', 77);
based on CT9Cj