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]"; } $_SESSION{$sessionKey} = $value; var_dump($_SESSION); return !empty(self::getKey($sessionKey)); } setKey(1:2:3, 77);
based on 84OnC
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected ':', expecting ',' or ')' in /in/H19oZ on line 17
Process exited with code 255.
Output for 5.5.24 - 5.6.16
Parse error: syntax error, unexpected ':' in /in/H19oZ on line 17
Process exited with code 255.
Output for 5.3.21 - 5.4.45
Fatal error: Can't use function return value in write context in /in/H19oZ on line 14
Process exited with code 255.