3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array ( 298 => array ( 'dates' => array ( 0 => '2020-12-26 10:39:13', 1 => '2020-12-15 12:18:23', 2 => '2020-12-22 12:27:46', 3 => '2020-12-24 10:51:00', 4 => '2020-12-26 10:01:44', 5 => '2020-12-26 10:31:55', 6 => '2020-12-26 10:48:33', 7 => '2020-12-26 10:56:34' ), ), 184 => array ( 'dates' => array ( 0 => '2020-11-16 07:52:33', 1 => '2020-12-24 13:01:14' ), ), 182 => array ( 'dates' => array ( 0 => '2021-01-05 08:50:27' ), ) ); $array2 = array ( 298 => array ( 'dates' => array ( 0 => '2020-11-16 07:38:26', 1 => '2020-11-16 07:47:05', 2 => '2020-12-15 12:20:07', 3 => '2020-12-24 10:52:35' ), ), 184 => array ( 'dates' => array ( 0 => '2020-11-16 07:53:12' ), ), 53 => array ( 'dates' => array ( 0 => '2020-11-16 07:53:12' ), ) ); $keys = array_unique(array_merge(array_keys($array1), array_keys($array2))); $result = array(); foreach ($keys as $key) { $result[$key]['dates'] = array_merge($array1[$key]['dates'] ?? [], $array2[$key]['dates'] ?? []); } print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [298] => Array ( [dates] => Array ( [0] => 2020-12-26 10:39:13 [1] => 2020-12-15 12:18:23 [2] => 2020-12-22 12:27:46 [3] => 2020-12-24 10:51:00 [4] => 2020-12-26 10:01:44 [5] => 2020-12-26 10:31:55 [6] => 2020-12-26 10:48:33 [7] => 2020-12-26 10:56:34 [8] => 2020-11-16 07:38:26 [9] => 2020-11-16 07:47:05 [10] => 2020-12-15 12:20:07 [11] => 2020-12-24 10:52:35 ) ) [184] => Array ( [dates] => Array ( [0] => 2020-11-16 07:52:33 [1] => 2020-12-24 13:01:14 [2] => 2020-11-16 07:53:12 ) ) [182] => Array ( [dates] => Array ( [0] => 2021-01-05 08:50:27 ) ) [53] => Array ( [dates] => Array ( [0] => 2020-11-16 07:53:12 ) ) )

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:
155.64 ms | 409 KiB | 5 Q