3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = []; $a = ['itemListElement' => ['@type' => 'ListItem', 'position' => '1', 'item' => ['name' => 'testName1']]]; $b = ['itemListElement' => ['@type' => 'ListItem', 'position' => '2', 'item' => ['name' => 'testName2']]]; array_push($array, $a); array_push($array, $b); var_dump($array);
based on s174A
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
array(2) { [0]=> array(1) { ["itemListElement"]=> array(3) { ["@type"]=> string(8) "ListItem" ["position"]=> string(1) "1" ["item"]=> array(1) { ["name"]=> string(9) "testName1" } } } [1]=> array(1) { ["itemListElement"]=> array(3) { ["@type"]=> string(8) "ListItem" ["position"]=> string(1) "2" ["item"]=> array(1) { ["name"]=> string(9) "testName2" } } } }