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--) { $insert = $return; $return = array(); $return[$arg[$i-1]] = $insert; } foreach($return as $k => $v) { $_SESSION[$k] = $v; } echo '<pre>'; print_r($_SESSION); echo '</pre>';
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<pre>Array ( [objet] => Array ( [membre] => Array ( [id] => 5 ) ) ) </pre>