3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ ['id' => 3, 'other' => 'some string', 'timestamp' => '2000-01-01 12:12:12'], ['id' => 4, 'other' => 'some string', 'timestamp' => '1900-01-01 01:12:23'], ['id' => 5, 'other' => 'toker', 'timestamp' => '1900-04-20 00:04:20'], ]; $filterBy = [ ['id' => 3, 'other' => 'some string', 'timestamp' => '2000-01-01 00:00:00'], ['id' => 5, 'other' => 'toker', 'timestamp' => '1900-04-20 00:04:20'], ]; var_dump( array_udiff( $input, $filterBy, fn($a, $b) => $a <=> $b ) );
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
array(2) { [0]=> array(3) { ["id"]=> int(3) ["other"]=> string(11) "some string" ["timestamp"]=> string(19) "2000-01-01 12:12:12" } [1]=> array(3) { ["id"]=> int(4) ["other"]=> string(11) "some string" ["timestamp"]=> string(19) "1900-01-01 01:12:23" } }

preferences:
51.07 ms | 1017 KiB | 4 Q