3v4l.org

run code in 300+ PHP versions simultaneously
<?php $canonicalIds = [ 'first', 'second', 'third', 'fourth', 'fifth', 'sixth', ]; $putContent = [ [ 'id' => 'fifth', 'value' => 55, ], [ 'id' => 'second', 'value' => 22, ], [ 'id' => 'fourth', 'value' => 44, ], [ 'id' => null, 'value' => 7, ], ]; $toCreate = array_filter($putContent, static function (array $item): bool { return null === $item['id']; }); $toUpdate = array_uintersect( $putContent, array_map(static function (string $id): array { return ['id' => $id]; }, $canonicalIds), static function (array $putItem, array $canonicalItem): int { return $putItem['id'] <=> $canonicalItem['id']; } ); $toDelete = array_diff($canonicalIds, array_column($toUpdate, 'id')); var_dump($toCreate, $toUpdate, $toDelete);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.70.0110.01116.63
8.3.60.0070.01018.43
8.3.50.0190.00316.85
8.3.40.0000.01420.32
8.3.30.0150.00318.54
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0040.00426.16
8.2.190.0100.01316.88
8.2.180.0120.00918.41
8.2.170.0040.01118.73
8.2.160.0160.00022.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00026.16
8.2.110.0000.01019.31
8.2.100.0120.00018.03
8.2.90.0040.00419.17
8.2.80.0050.00318.05
8.2.70.0050.00317.63
8.2.60.0000.00817.50
8.2.50.0030.00517.75
8.2.40.0050.00318.35
8.2.30.0000.00718.08
8.2.20.0090.00018.96
8.2.10.0090.00618.97
8.2.00.0060.01118.93
8.1.280.0120.00325.92
8.1.270.0030.00621.94
8.1.260.0140.00426.35
8.1.250.0030.00628.09
8.1.240.0060.00323.88
8.1.230.0030.00722.16
8.1.220.0090.00017.74
8.1.210.0000.00918.77
8.1.200.0060.00317.47
8.1.190.0000.01017.30
8.1.180.0060.00618.10
8.1.170.0030.00618.48
8.1.160.0070.00018.95
8.1.150.0050.00318.70
8.1.140.0110.00718.60
8.1.130.0080.00818.61
8.1.120.0140.00418.61
8.1.110.0160.00018.63
8.1.100.0130.00318.68
8.1.90.0140.00318.76
8.1.80.0070.01018.64
8.1.70.0090.01018.62
8.1.60.0170.00318.77
8.1.50.0160.00618.71
8.1.40.0140.00718.85
8.1.30.0120.00618.84
8.1.20.0080.00818.72
8.1.10.0070.00818.61
8.1.00.0120.00618.66
8.0.300.0000.00718.77
8.0.290.0000.00816.58
8.0.280.0000.00718.47
8.0.270.0060.01118.02
8.0.260.0070.00717.92
8.0.250.0070.00417.98
8.0.240.0090.00517.97
8.0.230.0120.00318.03
8.0.220.0050.01018.08
8.0.210.0080.00418.03
8.0.200.0050.00518.07
8.0.190.0080.00418.14
8.0.180.0160.00018.09
8.0.170.0050.01017.96
8.0.160.0110.00418.07
8.0.150.0070.00517.99
8.0.140.0070.00718.04
8.0.130.0040.00817.86
8.0.120.0120.00017.87
8.0.110.0080.00517.92
8.0.100.0090.00417.92
8.0.90.0160.00018.07
8.0.80.0140.00017.89
8.0.70.0130.00317.91
8.0.60.0110.00718.01
8.0.50.0160.00017.85
8.0.30.0100.00517.91
8.0.20.0100.00518.09
8.0.10.0000.01418.18

preferences:
30.81 ms | 402 KiB | 5 Q