3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arg = array('objet', 'membre', 'id', 5); $limit = count($arg) - 1; $return = $arg[$limit]; for($i = $limit; $i > 0; $i--) $return = array($arg[$i-1] => $return); foreach($return as $k => $v) $_SESSION[$k] = $v; echo '<pre>'; print_r($_SESSION); echo '</pre>';
Output for 4.3.0 - 7.1.0
<pre>Array ( [objet] => Array ( [membre] => Array ( [id] => 5 ) ) ) </pre>