3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $brin = 'Gynzy'; $salesorderid = 2562; $aantal = 4; $product_id = 45; $hallo = [ 'brin' => $brin, 'salesorderid' => $salesorderid // 'productlines' => [ // 'quantity' => $aantal, // 'product_id' => $product_id // ] ]; $hallo['productlines'] = ['quantity' => 5, 'product_id' => 678 ]; print_r ($hallo); ?>
based on IGBjl
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0rc3
Array ( [brin] => Gynzy [salesorderid] => 2562 [productlines] => Array ( [quantity] => 5 [product_id] => 678 ) )