3v4l.org

run code in 500+ PHP versions simultaneously
<?php $movements = [ ['id' => 90415, 'oldDate' => '2024-08-27', 'newDate' => '2024-08-28'], ['id' => 90415, 'oldDate' => '2024-08-28', 'newDate' => '2024-08-27'], ['id' => 90409, 'oldDate' => '2024-08-21', 'newDate' => '2024-08-22'], ['id' => 90409, 'oldDate' => '2024-08-22', 'newDate' => '2024-08-23'], ]; var_export( array_values( array_filter( array_reduce( $movements, function($carry, $move) { $carry[$move['id']] ??= $move; $carry[$move['id']]['newDate'] = $move['newDate']; return $carry; } ), fn($move) => $move['oldDate'] != $move['newDate'] ) ) );
Output for git.master_jit, git.master, rfc.property-hooks
array ( 0 => array ( 'id' => 90409, 'oldDate' => '2024-08-21', 'newDate' => '2024-08-23', ), )

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:
40.74 ms | 987 KiB | 4 Q