3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { $orderedids=array(7, 9, 5, 3); $tags=array( new Tag(3), new Tag(7), new Tag(5), new Tag(9) ); $flipped=array_flip($orderedids); return usort($tags, function($tag1, $tag2) { if ($flipped[$tag1->id]<$flipped[$tag2->id]) return -1; else if ($flipped[$tag1->id]==$flipped[$tag2->id]) return 0; else return 1; }); } class Tag { public $id; function __construct($id) { $this->id=$id; } } $rtags=test(); foreach ($rtags as $tag) echo $tag->id." ";

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.60.0100.01018.68
8.3.50.0140.00418.18
8.3.40.0090.00918.84
8.3.30.0120.00318.71
8.3.20.0040.00420.34
8.3.10.0080.00023.52
8.3.00.0050.00319.27
8.2.180.0080.00825.92
8.2.170.0150.00719.08
8.2.160.0110.00722.96
8.2.150.0020.00525.66
8.2.140.0000.00724.66
8.2.130.0000.00917.62
8.2.120.0000.00826.35
8.2.110.0130.00619.30
8.2.100.0090.00317.97
8.2.90.0000.00819.25
8.2.80.0050.00317.97
8.2.70.0060.00317.63
8.2.60.0060.00318.03
8.2.50.0000.00818.07
8.2.40.0000.00719.42
8.2.30.0070.00020.69
8.2.20.0070.00317.89
8.2.10.0040.00418.09
8.2.00.0070.00018.14
8.1.280.0140.00725.92
8.1.270.0060.00323.87
8.1.260.0000.00728.09
8.1.250.0040.00428.09
8.1.240.0140.00721.35
8.1.230.0120.00017.42
8.1.220.0030.00517.79
8.1.210.0030.00518.77
8.1.200.0030.00717.48
8.1.190.0030.00617.23
8.1.180.0050.00318.10
8.1.170.0040.00418.77
8.1.160.0000.00722.04
8.1.150.0040.00418.86
8.1.140.0000.00819.59
8.1.130.0000.00717.73
8.1.120.0050.00217.50
8.1.110.0000.01117.36
8.1.100.0000.00717.43
8.1.90.0030.00317.43
8.1.80.0000.00717.47
8.1.70.0050.00217.34
8.1.60.0030.00917.43
8.1.50.0030.00517.59
8.1.40.0030.00617.41
8.1.30.0060.00317.77
8.1.20.0000.00817.69
8.1.10.0000.00817.57
8.1.00.0030.00517.54
8.0.300.0060.00318.77
8.0.290.0040.00416.63
8.0.280.0030.00518.52
8.0.270.0030.00316.98
8.0.260.0000.00617.17
8.0.250.0030.00517.04
8.0.240.0070.00016.90
8.0.230.0030.00316.89
8.0.220.0000.00716.96
8.0.210.0000.00916.88
8.0.200.0070.00016.91
8.0.190.0070.00016.98
8.0.180.0000.00716.91
8.0.170.0040.00716.85
8.0.160.0070.00016.89
8.0.150.0070.00016.90
8.0.140.0070.00016.82
8.0.130.0030.00313.31
8.0.120.0080.00016.86
8.0.110.0050.00216.99
8.0.100.0000.00816.98
8.0.90.0000.00717.02
8.0.80.0090.00616.88
8.0.70.0000.00716.80
8.0.60.0040.00416.94
8.0.50.0020.00517.02
8.0.30.0050.01317.28
8.0.20.0090.01017.40
8.0.10.0050.00317.13
8.0.00.0130.00816.76
7.4.330.0000.00516.71
7.4.320.0000.00616.63
7.4.300.0060.00016.46
7.4.290.0070.00016.63
7.4.280.0000.00716.50
7.4.270.0060.00016.52
7.4.260.0070.00016.36
7.4.250.0040.00416.40
7.4.240.0000.00716.57
7.4.230.0000.00716.69
7.4.220.0180.00316.60
7.4.210.0140.00416.64
7.4.200.0040.00416.26
7.4.160.0040.01316.59
7.4.150.0090.00917.40
7.4.140.0100.01317.86
7.4.130.0110.01016.55
7.4.120.0120.00816.42
7.4.110.0090.00916.70
7.4.100.0100.00716.58
7.4.90.0070.01016.36
7.4.80.0130.00619.39
7.4.70.0120.01016.51
7.4.60.0130.00316.60
7.4.50.0050.00616.64
7.4.40.0030.01316.38
7.4.30.0040.01316.42
7.4.00.0050.01214.93
7.3.330.0000.00513.29
7.3.320.0030.00313.19
7.3.310.0000.00716.38
7.3.300.0030.00316.39
7.3.290.0080.00916.43
7.3.280.0120.00516.36
7.3.270.0080.00817.40
7.3.260.0170.00616.37
7.3.250.0120.00616.39
7.3.240.0140.00616.51
7.3.230.0070.01416.39
7.3.210.0060.00916.55
7.3.200.0150.00916.38
7.3.190.0120.00616.36
7.3.180.0100.01016.50
7.3.170.0070.01016.35
7.3.160.0000.01616.66
7.3.120.0060.01315.06
7.3.110.0100.01014.89
7.3.100.0040.01114.85
7.3.90.0030.00614.88
7.3.80.0110.00314.79
7.3.70.0070.00714.68
7.3.60.0040.01114.74
7.3.50.0070.00715.00
7.3.40.0030.00614.73
7.3.30.0000.01514.98
7.3.20.0060.00616.86
7.3.10.0100.00516.61
7.3.00.0050.01116.68
7.2.330.0120.00616.61
7.2.320.0030.01516.56
7.2.310.0060.01016.77
7.2.300.0100.00716.69
7.2.290.0070.01016.72
7.2.250.0120.00614.82
7.2.240.0160.00014.84
7.2.230.0060.01015.02
7.2.220.0080.00815.02
7.2.210.0000.01515.01
7.2.200.0000.00914.96
7.2.190.0090.00915.09
7.2.180.0070.00314.95
7.2.170.0030.01015.15
7.2.130.0060.00916.94
7.2.120.0100.00716.87
7.2.110.0060.00617.07
7.2.100.0070.00716.91
7.2.90.0030.00917.08
7.2.80.0080.00817.05
7.2.70.0000.01016.93
7.2.60.0030.01216.85
7.2.50.0040.01116.87
7.2.40.0070.00716.80
7.2.30.0030.01017.01
7.2.20.0080.00316.84
7.2.10.0030.01217.09
7.2.00.0100.00318.26
7.1.330.0000.01215.88
7.1.320.0040.00815.48
7.1.310.0070.00715.79
7.1.300.0070.01115.77
7.1.290.0000.01215.83
7.1.280.0040.01115.90
7.1.270.0070.00715.84
7.1.260.0060.00615.44
7.1.250.0060.00315.57
7.1.200.0050.00515.71
7.1.100.0070.00718.34
7.1.70.0060.00617.18
7.1.60.0070.01719.36
7.1.50.0100.01016.70
7.1.00.0070.07322.43
7.0.200.0040.00416.61
7.0.60.0130.08019.91
7.0.50.0000.08017.86
7.0.40.0070.04320.30
7.0.30.0330.05020.24
7.0.20.0130.04720.12
7.0.10.0100.07720.15
7.0.00.0130.06320.05
5.6.280.0100.03020.92
5.6.210.0100.08320.70
5.6.200.0130.07318.16
5.6.190.0030.09720.64
5.6.180.0500.07020.50
5.6.170.0400.07020.51
5.6.160.0130.04720.47
5.6.150.0070.03718.18
5.6.140.0070.06018.12
5.6.130.0100.03718.28
5.6.120.0100.05021.05
5.6.110.0130.08321.04
5.6.100.0070.08721.12
5.6.90.0070.08320.98
5.6.80.0100.08720.37
5.5.350.2870.03320.38
5.5.340.0130.07318.01
5.5.330.0070.08320.40
5.5.320.0100.08020.31
5.5.310.0130.04320.49
5.5.300.0100.05017.94
5.5.290.0100.07718.01
5.5.280.0100.04720.75
5.5.270.0070.04320.73
5.5.260.0070.04020.66
5.5.250.0070.07720.70
5.5.240.0230.07720.34

preferences:
39.95 ms | 401 KiB | 5 Q