3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo_exported = var_export(array(2 => TRUE), TRUE); $foo_string = 'Array(2 => TRUE)'; $bar = array(); $baz = 'baz'; eval('$bar[$baz]["exported"] = $foo_exported;'); eval('$bar[$baz]["string"] = $foo_string;'); print_r($bar); echo $foo_exported;
based on ZoJ6h
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [baz] => Array ( [exported] => array ( 2 => true, ) [string] => Array(2 => TRUE) ) ) array ( 2 => true, )