3v4l.org

run code in 300+ PHP versions simultaneously
<?php $finalArr = array(); $newArr = array( 'title' => 'lorem', 'vehicles' => array( // New dimension added here array( 'type' => 'sedan', 'price' => 2900, ), ) ); array_push($finalArr, $newArr); $index = array_search('lorem', array_column($finalArr, 'title')); $addArr = array( 'type' => 'truck', 'price' => 4750 ); array_push($finalArr[$index]['vehicles'], $addArr); print_r($finalArr);
Output for git.master_jit, git.master, rfc.property-hooks
Array ( [0] => Array ( [title] => lorem [vehicles] => Array ( [0] => Array ( [type] => sedan [price] => 2900 ) [1] => Array ( [type] => truck [price] => 4750 ) ) ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
25.01 ms | 406 KiB | 5 Q