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.5.00.0050.00420.00
8.4.150.0020.00114.05
8.4.140.0140.00717.45
8.4.130.0130.00517.60
8.4.120.0150.00524.17
8.4.110.0130.00818.01
8.4.100.0100.01018.99
8.4.90.0120.00818.94
8.4.80.0020.00618.62
8.4.70.0120.00517.87
8.4.60.0120.00918.89
8.4.50.0110.00519.48
8.4.40.0100.01019.28
8.4.30.0120.00320.32
8.4.20.0070.01019.71
8.4.10.0030.00623.86
8.3.280.0120.01118.60
8.3.270.0140.00616.55
8.3.260.0110.00916.55
8.3.250.0090.01018.80
8.3.240.0120.00717.27
8.3.230.0110.00516.59
8.3.220.0060.00919.02
8.3.210.0100.00816.78
8.3.200.0050.00416.40
8.3.190.0110.00917.06
8.3.180.0100.00816.62
8.3.170.0070.01118.98
8.3.160.0110.00716.61
8.3.150.0070.00020.84
8.3.140.0030.00618.32
8.3.130.0030.00618.28
8.3.120.0080.00018.84
8.3.110.0040.01120.94
8.3.100.0040.00424.06
8.3.90.0030.00626.77
8.3.80.0090.00018.43
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.290.0110.00920.80
8.2.280.0090.01118.16
8.2.270.0110.00716.58
8.2.260.0000.00818.89
8.2.250.0100.00018.30
8.2.240.0040.00418.76
8.2.230.0000.00822.58
8.2.220.0090.00037.54
8.2.210.0080.00026.77
8.2.200.0100.00018.88
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.330.0120.00721.91
8.1.320.0100.00918.43
8.1.310.0080.00018.54
8.1.300.0040.01518.33
8.1.290.0060.00330.84
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:
98.61 ms | 403 KiB | 5 Q