3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr0 = [ [ 'id' => 107, 'name' => 'Sarah', 'msgSinleer' => 2, 'subject' => [], ], [ 'id' => 110, 'name' => 'Manuela', 'msgSinleer' => 27, 'subject' => [], ], ]; $arr1 = [ [ 'id' => 110, 'Cliente' => 'Alexis', 'body' => 'Hola', 'fecha' => '06/01/2021 11:35 AM', 'status' => 1, 'tiempoSinLeer' => '15 01:00', ], [ 'id' => 110, 'Cliente' => 'Alexis', 'body' => 'Hola asd asdasd', 'fecha' => '05/26/2021 11:35 AM', 'status' => 1, 'tiempoSinLeer' => '21 01:00', ], [ 'id' => 107, 'Cliente' => 'George', 'body' => 'vhgfshsgf', 'fecha' => '06/15/2021 03:48 PM', 'status' => 1, 'tiempoSinLeer' => '1 08:48', ], ]; foreach($arr0 as $key => $record) { foreach($arr1 as $subject) { if($record['id'] === $subject['id']) $arr0[$key]['subject'][] = $subject; } } echo '<pre>'; print_r($arr0); echo '</pre>';
Output for git.master, git.master_jit, rfc.property-hooks
<pre>Array ( [0] => Array ( [id] => 107 [name] => Sarah [msgSinleer] => 2 [subject] => Array ( [0] => Array ( [id] => 107 [Cliente] => George [body] => vhgfshsgf [fecha] => 06/15/2021 03:48 PM [status] => 1 [tiempoSinLeer] => 1 08:48 ) ) ) [1] => Array ( [id] => 110 [name] => Manuela [msgSinleer] => 27 [subject] => Array ( [0] => Array ( [id] => 110 [Cliente] => Alexis [body] => Hola [fecha] => 06/01/2021 11:35 AM [status] => 1 [tiempoSinLeer] => 15 01:00 ) [1] => Array ( [id] => 110 [Cliente] => Alexis [body] => Hola asd asdasd [fecha] => 05/26/2021 11:35 AM [status] => 1 [tiempoSinLeer] => 21 01:00 ) ) ) ) </pre>

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:
35.13 ms | 411 KiB | 5 Q