3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = [ "a" => 1, "b" => "hello", "c" => 5.5, "d" => true, ]; $y = new stdClass(); $y->a = 1; $y->b = "hello"; $y->c = 5.5; $y->d = true; $t1 = hrtime(true); for ($i = 0; $i < 6000000; $i++) { $a = $x["a"]; $b = $x["b"]; $c = $x["c"]; $d = $x["d"]; } $t2 = hrtime(true); $t3 = hrtime(true); for ($i = 0; $i < 6000000; $i++) { $a = $y->a; $b = $y->b; $c = $y->c; $d = $y->d; } $t4 = hrtime(true); echo "With array : " . (($t2 - $t1) / 1000000) . " ms\n"; echo "With object: " . (($t4 - $t3) / 1000000) . " ms\n"; class A { public $a; public $b; public $c; public $d; }

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.130.0070.26018.31
8.3.120.0100.26819.04
8.3.110.0030.27020.94
8.3.100.0030.26224.06
8.3.90.0030.25326.77
8.3.80.0070.37218.40
8.3.70.0170.47716.50
8.3.60.0130.48618.55
8.3.50.0100.45618.14
8.3.40.0070.49818.83
8.3.30.0100.51918.75
8.3.20.0100.27722.27
8.3.10.0070.27820.32
8.3.00.0100.32222.57
8.2.250.0030.29218.46
8.2.240.0030.29517.19
8.2.230.0070.25722.58
8.2.220.0070.26737.54
8.2.210.0030.25126.77
8.2.200.0070.32618.06
8.2.190.0200.48816.58
8.2.180.0030.49918.54
8.2.170.0070.47822.96
8.2.160.0070.48221.02
8.2.150.0070.27824.18
8.2.140.0030.26224.66
8.2.130.0030.28626.16
8.2.120.0030.27221.05
8.2.110.0030.61320.94
8.2.100.0100.34317.78
8.2.90.0030.42117.91
8.2.80.0000.35918.05
8.2.70.0030.35518.05
8.2.60.0030.34418.09
8.2.50.0030.35118.10
8.2.40.0030.34319.27
8.2.30.0030.35219.39
8.2.20.0070.43018.14
8.2.10.0030.35719.51
8.2.00.0100.35419.25
8.1.300.0070.29118.68
8.1.290.0100.33918.88
8.1.280.0100.51525.92
8.1.270.0070.26222.46
8.1.260.0070.31626.35
8.1.250.0100.30328.09
8.1.240.0070.57522.18
8.1.230.0100.35322.69
8.1.220.0030.37417.74
8.1.210.0070.34718.89
8.1.200.0070.37417.22
8.1.190.0030.38217.36
8.1.180.0000.35418.10
8.1.170.0070.36518.57
8.1.160.0000.36718.86
8.1.150.0000.35518.96
8.1.140.0030.38522.62
8.1.130.0070.34620.12
8.1.120.0070.35117.49
8.1.110.0030.35717.43
8.1.100.0000.42517.54
8.1.90.0000.36717.49
8.1.80.0030.38117.46
8.1.70.0070.35117.52
8.1.60.0030.56817.59
8.1.50.0030.56817.57
8.1.40.0030.56717.52
8.1.30.0070.56617.57
8.1.20.0000.57117.64
8.1.10.0000.58117.62
8.1.00.0030.56817.54
8.0.300.0030.37621.93
8.0.290.0000.35716.63
8.0.280.0000.35618.45
8.0.270.0070.36617.21
8.0.260.0100.35820.15
8.0.250.0030.35416.95
8.0.240.0030.35816.91
8.0.230.0000.38717.02
8.0.220.0070.36116.87
8.0.210.0030.36916.88
8.0.200.0100.38916.95
8.0.190.0000.57516.84
8.0.180.0030.58416.96
8.0.170.0100.57016.95
8.0.160.0070.56516.89
8.0.150.0100.56416.80
8.0.140.0000.57416.89
8.0.130.0160.64513.30
8.0.120.0100.56316.80
8.0.110.0000.57317.02
8.0.100.0060.56716.88
8.0.90.0000.57416.77
8.0.80.0000.88116.96
8.0.70.0030.57216.87
8.0.60.0030.57016.85
8.0.50.0030.56716.75
8.0.30.0170.49916.99
8.0.20.0240.87217.17
8.0.10.0070.58117.00
8.0.00.0160.87517.01
7.4.330.0000.37915.55
7.4.320.0070.36916.54
7.4.300.0030.37016.56
7.4.290.0000.59716.51
7.4.280.0070.60016.45
7.4.270.0000.59216.48
7.4.260.0000.59113.13
7.4.250.0070.58616.33
7.4.240.0030.59416.46
7.4.230.0100.58316.59
7.4.220.0050.58916.58
7.4.210.0161.00416.62
7.4.200.0030.59316.59
7.4.130.0130.94716.82
7.4.120.0101.00116.54
7.4.110.0100.92616.37
7.4.100.0321.16116.26
7.4.90.0030.90616.44
7.4.80.0130.88319.39
7.4.70.0141.07516.55
7.4.60.0101.05016.43
7.4.50.0030.73716.50
7.4.40.0261.13216.37
7.4.00.0070.85714.98
7.3.330.0000.62916.16
7.3.320.0030.62513.21
7.3.310.0000.62816.35
7.3.300.0000.63316.28
7.3.290.0100.61716.34
7.3.280.0071.08416.35
7.3.260.0171.16016.49
7.3.240.0111.01016.46
7.3.230.0101.04816.52
7.3.210.0061.00716.48
7.3.200.0101.03616.58
7.3.190.0100.97516.61
7.3.180.0030.99016.44
7.3.170.0221.10316.39
7.3.160.0071.04216.25
7.3.120.0050.81014.94
7.3.110.0070.85514.70
7.3.100.0031.04615.01
7.3.90.0050.95214.87
7.3.80.0081.01314.88
7.3.70.0080.91114.77
7.3.60.0051.01614.71
7.3.50.0110.97114.70
7.3.40.0070.91414.79
7.3.30.0081.02914.93
7.3.20.0120.95215.68
7.3.10.0100.95615.73
7.3.00.0110.92515.75
7.2.330.0080.00916.47
7.2.320.0120.00616.64
7.2.310.0060.01016.70
7.2.300.0030.01316.69
7.2.290.0030.01316.69
7.2.250.0030.01614.86
7.2.240.0130.00614.64
7.2.230.0060.00614.88
7.2.220.0090.00614.75
7.2.210.0100.00214.80
7.2.200.0080.00614.83
7.2.190.0050.00614.73
7.2.180.0070.00514.84
7.2.170.0030.01014.75
7.2.160.0080.00614.83
7.2.150.0180.00615.22
7.2.140.0100.00714.91
7.2.130.0120.00615.28
7.2.120.0030.01214.87
7.2.110.0110.00715.11
7.2.100.0030.01314.78
7.2.90.0120.00415.15
7.2.80.0070.01114.88
7.2.70.0070.01015.10
7.2.60.0120.00815.21
7.2.50.0080.00815.23
7.2.40.0120.00414.89
7.2.30.0040.01215.21
7.2.20.0060.00914.88
7.2.10.0030.01314.81
7.2.00.0110.00714.93
7.1.330.0040.01115.69
7.1.320.0100.00714.72
7.1.310.0060.00614.89
7.1.300.0110.00314.76
7.1.290.0080.00614.90
7.1.280.0100.00814.67
7.1.270.0050.00514.78
7.1.260.0070.00814.80
7.1.250.0090.00913.91

preferences:
29.97 ms | 403 KiB | 5 Q