3v4l.org

run code in 300+ PHP versions simultaneously
<?php $entity_a = new stdClass; $entity_a->weight = 32; $entity_a->label = 'foo'; $entity_b = clone $entity_a; $entity_b->label = 'bar'; $list = array($entity_a, $entity_b); usort($list, 'xsort'); echo var_dump($entity_b); echo var_dump($list[0]); if ($entity_b === $list[0]) { echo 'success'; } function xsort($a, $b) { $a_weight = isset($a->weight) ? $a->weight : 0; $b_weight = isset($b->weight) ? $b->weight : 0; if ($a_weight == $b_weight) { echo 'yay'; $a_label = $a->label; $b_label = $b->label; return strnatcasecmp($a_label, $b_label); } return ($a_weight < $b_weight) ? -1 : 1; }

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.0110.01118.43
8.3.50.0090.00618.18
8.3.40.0070.00718.97
8.3.30.0060.00819.04
8.3.20.0050.00220.34
8.3.10.0040.00423.53
8.3.00.0050.00319.02
8.2.180.0040.01518.41
8.2.170.0150.00022.96
8.2.160.0140.00022.16
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0140.00726.16
8.2.120.0080.00021.12
8.2.110.0030.00620.47
8.2.100.0030.00919.21
8.2.90.0060.00319.36
8.2.80.0000.00817.97
8.2.70.0040.00817.50
8.2.60.0050.00318.04
8.2.50.0060.00318.07
8.2.40.0040.00418.32
8.2.30.0040.00418.21
8.2.20.0040.00417.68
8.2.10.0030.00518.20
8.2.00.0040.00417.63
8.1.280.0060.00925.92
8.1.270.0030.00618.95
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.87
8.1.230.0040.00819.02
8.1.220.0000.00817.80
8.1.210.0050.00318.77
8.1.200.0030.00617.47
8.1.190.0040.00417.35
8.1.180.0070.00018.10
8.1.170.0030.00618.61
8.1.160.0040.00421.95
8.1.150.0020.00518.86
8.1.140.0000.00819.14
8.1.130.0030.00317.77
8.1.120.0050.00317.39
8.1.110.0030.00617.36
8.1.100.0040.00417.44
8.1.90.0050.00317.53
8.1.80.0000.00717.43
8.1.70.0000.00717.38
8.1.60.0040.00817.52
8.1.50.0040.00417.60
8.1.40.0040.00417.51
8.1.30.0040.00417.65
8.1.20.0050.00217.57
8.1.10.0000.00817.67
8.1.00.0040.00417.43
8.0.300.0040.00418.77
8.0.290.0050.00216.75
8.0.280.0000.00718.46
8.0.270.0000.00817.21
8.0.260.0030.00317.27
8.0.250.0000.00716.99
8.0.240.0060.00316.98
8.0.230.0000.00716.90
8.0.220.0040.00416.88
8.0.210.0040.00416.95
8.0.200.0040.00417.01
8.0.190.0030.00617.00
8.0.180.0050.00216.89
8.0.170.0040.00416.97
8.0.160.0000.00717.00
8.0.150.0040.00416.82
8.0.140.0000.00716.90
8.0.130.0030.00313.38
8.0.120.0000.00816.82
8.0.110.0050.00316.82
8.0.100.0080.00016.90
8.0.90.0000.00816.87
8.0.80.0040.01116.89
8.0.70.0070.00016.94
8.0.60.0000.00816.88
8.0.50.0000.00716.74
8.0.30.0150.00517.16
8.0.20.0090.01017.45
8.0.10.0080.00017.07
8.0.00.0140.00516.78
7.4.330.0020.00215.03
7.4.320.0040.00416.52
7.4.300.0030.00316.41
7.4.290.0070.00016.60
7.4.280.0030.00616.59
7.4.270.0030.00316.43
7.4.260.0000.00716.49
7.4.250.0000.00816.41
7.4.240.0040.00316.54
7.4.230.0000.00716.59
7.4.220.0090.00916.59
7.4.210.0090.00816.39
7.4.200.0000.00716.45
7.4.160.0090.00616.59
7.4.150.0090.01217.40
7.4.140.0130.00617.86
7.4.130.0100.00716.44
7.4.120.0070.01016.61
7.4.110.0030.01616.40
7.4.100.0110.00816.32
7.4.90.0120.00616.45
7.4.80.0090.01519.39
7.4.70.0030.01716.54
7.4.60.0030.01316.43
7.4.50.0000.00916.46
7.4.40.0110.01116.43
7.4.30.0070.01016.39
7.4.00.0100.00315.19
7.3.330.0030.00313.41
7.3.320.0050.00013.20
7.3.310.0080.00016.24
7.3.300.0000.00716.38
7.3.290.0070.00916.36
7.3.280.0040.01216.34
7.3.270.0070.01017.40
7.3.260.0170.00016.62
7.3.250.0130.00516.48
7.3.240.0080.00816.64
7.3.230.0140.00816.61
7.3.210.0100.00716.32
7.3.200.0130.01019.39
7.3.190.0030.01416.45
7.3.180.0100.00716.68
7.3.170.0100.01316.65
7.3.160.0120.00316.42
7.2.330.0090.00916.70
7.2.320.0100.01316.57
7.2.310.0110.00816.76
7.2.300.0070.01316.42
7.2.290.0070.01016.86
7.2.60.0030.00716.58
7.2.00.0100.00319.43
7.1.200.0220.00315.59
7.1.100.0670.00615.97
7.1.70.0030.01316.93
7.1.60.0070.01819.46
7.1.50.0130.01017.01
7.1.00.0000.08022.30
7.0.200.0030.01016.86
7.0.140.0000.03721.95
7.0.110.0100.03719.83
7.0.100.0070.07719.79
7.0.90.0100.04319.85
7.0.80.0100.03719.89
7.0.70.0100.03719.86
7.0.60.0070.06319.60
7.0.50.0000.07720.35
7.0.40.0070.04020.14
7.0.30.0130.06320.14
7.0.20.0000.08320.00
7.0.10.0070.07319.98
7.0.00.0130.07020.02
5.6.280.0070.07021.04
5.6.250.0070.04020.64
5.6.240.0000.04320.50
5.6.230.0000.06720.66
5.6.220.0030.06720.60
5.6.210.0100.06320.55
5.6.200.0070.05021.22
5.6.190.0130.04321.20
5.6.180.0070.06720.88
5.6.170.0070.07720.94
5.6.160.0100.06320.88
5.6.150.0030.06321.09
5.6.140.0030.07020.87
5.6.130.0000.08320.88
5.6.120.0130.07720.86
5.6.110.0100.08020.88
5.6.100.0200.06721.02
5.6.90.0070.08321.22
5.6.80.0070.07720.37
5.6.70.0170.06320.48
5.6.60.0200.06720.47
5.6.50.0070.07720.60
5.6.40.0170.07020.40
5.6.30.0030.09020.53
5.6.20.0000.04320.45
5.6.10.0130.07320.33
5.6.00.0130.07020.55
5.5.380.0070.03720.50
5.5.370.0030.03720.52
5.5.360.0000.04720.42
5.5.350.0070.07720.43
5.5.340.0030.05320.91
5.5.330.0030.07720.73
5.5.320.0070.07720.91
5.5.310.0170.07320.73
5.5.300.0070.07720.84
5.5.290.0030.07320.69
5.5.280.0030.05320.79
5.5.270.0100.07720.98
5.5.260.0070.07720.91
5.5.250.0130.07320.71
5.5.240.0130.06320.30
5.5.230.0100.07320.07
5.5.220.0070.07720.14
5.5.210.0130.07020.21
5.5.200.0100.07320.27
5.5.190.0070.05020.04
5.5.180.0170.07020.26
5.5.160.0130.07720.29
5.5.150.0100.08020.17
5.5.140.0130.06020.25
5.5.130.0030.07720.14
5.5.120.0100.07720.11
5.5.110.0100.07720.33
5.5.100.0100.07720.11
5.5.90.0130.06720.14
5.5.80.0070.08020.18
5.5.70.0070.07720.02
5.5.60.0070.07319.90
5.5.50.0070.07719.95
5.5.40.0130.07319.91
5.5.30.0070.07719.98
5.5.20.0030.06020.11
5.5.10.0130.07319.98
5.5.00.0030.04019.98
5.4.450.0000.09019.47
5.4.440.0030.07719.30
5.4.430.0070.08019.30
5.4.420.0100.07719.63
5.4.410.0100.07019.36
5.4.400.0130.07018.99
5.4.390.0100.07719.15
5.4.380.0130.04018.98
5.4.370.0070.07718.99
5.4.360.0030.08018.95
5.4.350.0100.07719.05
5.4.340.0100.04319.09
5.4.320.0100.07019.16
5.4.310.0000.08319.13
5.4.300.0100.07719.18
5.4.290.0200.05319.01
5.4.280.0100.07319.06
5.4.270.0030.06719.00
5.4.260.0070.07318.99
5.4.250.0200.05319.28
5.4.240.0030.07719.13
5.4.230.0030.08319.19
5.4.220.0100.07319.00
5.4.210.0000.08319.02
5.4.200.0030.08019.27
5.4.190.0000.08019.00
5.4.180.0070.07319.27
5.4.170.0070.04019.27
5.4.160.0070.04319.13
5.4.150.0030.07719.29
5.4.140.0070.07316.53
5.4.130.0200.06016.27
5.4.120.0030.07316.31
5.4.110.0100.07016.40
5.4.100.0170.06716.58
5.4.90.0070.07716.65
5.4.80.0100.06316.52
5.4.70.0100.07016.55
5.4.60.0070.07316.52
5.4.50.0130.07016.63
5.4.40.0070.07016.25
5.4.30.0000.08016.54
5.4.20.0030.08016.51
5.4.10.0130.06316.44
5.4.00.0030.05015.86
5.3.290.0100.07714.81
5.3.280.0070.06014.57
5.3.270.0070.07314.76
5.3.260.0200.06014.58
5.3.250.0070.07714.69
5.3.240.0070.07714.63
5.3.230.0170.07014.65
5.3.220.0000.09014.66
5.3.210.0070.07714.57
5.3.200.0070.07014.70
5.3.190.0000.08014.61
5.3.180.0030.07314.70
5.3.170.0100.07014.58
5.3.160.0070.06714.57
5.3.150.0030.04714.43
5.3.140.0070.08014.63
5.3.130.0130.07014.57
5.3.120.0000.06014.63
5.3.110.0070.07014.63
5.3.100.0000.07314.17
5.3.90.0130.07014.04
5.3.80.0070.07314.24
5.3.70.0100.07014.00
5.3.60.0070.07014.09
5.3.50.0130.07313.80
5.3.40.0070.05714.18
5.3.30.0100.07013.92
5.3.20.0030.07313.82
5.3.10.0070.07013.69
5.3.00.0070.07713.78
5.2.170.0070.06311.28
5.2.160.0100.05311.25
5.2.150.0070.06011.15
5.2.140.0000.06311.17
5.2.130.0030.05711.05
5.2.120.0030.05711.11
5.2.110.0070.06311.11
5.2.100.0070.06311.11
5.2.90.0030.04011.07
5.2.80.0070.05311.18
5.2.70.0100.05711.11
5.2.60.0100.05310.91
5.2.50.0000.04311.08
5.2.40.0100.04311.08
5.2.30.0030.03711.20
5.2.20.0070.05311.09
5.2.10.0070.04310.87
5.2.00.0000.05010.72
5.1.60.0000.03310.00
5.1.50.0030.0509.95
5.1.40.0070.0379.97
5.1.30.0100.05010.29
5.1.20.0130.05010.32
5.1.10.0000.06010.04
5.1.00.0070.05010.32
5.0.50.0070.0339.87
5.0.40.0030.0439.87
5.0.30.0030.0639.87
5.0.20.0030.0409.87
5.0.10.0000.0409.87
5.0.00.0070.0639.87
4.4.90.0070.0309.87
4.4.80.0070.0279.87
4.4.70.0130.0239.87
4.4.60.0030.0209.87
4.4.50.0030.0379.87
4.4.40.0030.0539.87
4.4.30.0030.0209.87
4.4.20.0000.0379.87
4.4.10.0070.0279.87
4.4.00.0030.0509.87
4.3.110.0000.0379.87
4.3.100.0030.0339.87
4.3.90.0000.0239.87
4.3.80.0000.0579.87
4.3.70.0000.0379.87
4.3.60.0000.0379.87
4.3.50.0030.0239.87
4.3.40.0030.0509.87
4.3.30.0030.0339.87
4.3.20.0000.0309.87
4.3.10.0000.0379.87
4.3.00.0030.0309.87

preferences:
51.93 ms | 400 KiB | 5 Q