3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo 'Getting reference to a variable that is not yet set.' . "\n"; $ampA = &$a; for ($a = 0; $a < 10; $a++) { echo $ampA . ', '; } echo "\n\n"; $i = 0; echo 'Getting reference to an existing scalar variable.' . "\n"; $ampI = &$i; for ($i = 0; $i < 10; $i++) { echo $ampI . ', '; } echo "\n\n"; $arr = array(); echo 'Getting reference to an existing array.' . "\n"; $ampArr = &$arr; for ($i = 0; $i < 10; $i++) { $arr['i'] = $i; echo $ampArr['i'] . ', '; } echo "\n\n"; $secondArr = array(); echo 'Getting reference to an array element that does not exist yet.' . "\n"; $ampSecondArrJ = &$secondArr['j']; for ($i = 0; $i < 10; $i++) { $secondArr['j'] = $i; echo $ampSecondArrJ . ', '; } echo "\n\n"; $foreachedArr = array(); $ampForeachedVal = &$foreachedVal; $foreachedArr = [[0],[1],[2],[3],[4],[5],[6],[7],[8],[9]]; echo 'Getting reference to a value created by a foreach.' . "\n"; foreach ($foreachedArr as $foreachedVal) { echo $ampForeachedVal[0] . ', '; }

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.4.10.0030.01419.57
8.3.140.0000.00818.68
8.3.130.0090.00018.21
8.3.120.0030.00620.81
8.3.110.0070.00320.94
8.3.100.0030.00524.06
8.3.90.0030.01226.77
8.3.80.0110.00017.97
8.3.70.0120.00316.50
8.3.60.0060.00918.45
8.3.50.0100.00818.19
8.3.40.0040.01118.70
8.3.30.0090.00618.70
8.3.20.0040.00419.22
8.3.10.0050.00323.49
8.3.00.0000.00820.69
8.2.260.0040.01216.50
8.2.250.0040.00418.45
8.2.240.0040.00417.27
8.2.230.0060.00322.58
8.2.220.0070.00437.54
8.2.210.0090.00926.77
8.2.200.0000.01016.75
8.2.190.0070.00716.60
8.2.180.0040.01118.41
8.2.170.0070.01422.96
8.2.160.0140.00420.22
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0030.00519.65
8.2.120.0000.00726.35
8.2.110.0030.00622.21
8.2.100.0000.01217.91
8.2.90.0040.00417.73
8.2.80.0030.00617.97
8.2.70.0050.00317.80
8.2.60.0040.00418.16
8.2.50.0060.00318.10
8.2.40.0070.00022.31
8.2.30.0070.00019.40
8.2.20.0080.00018.23
8.2.10.0040.00418.19
8.2.00.0050.00317.98
8.1.310.0000.00816.03
8.1.300.0030.01320.39
8.1.290.0090.00030.84
8.1.280.0120.00625.92
8.1.270.0030.00522.19
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.01019.44
8.1.230.0070.00417.95
8.1.220.0000.00917.74
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0040.00417.22
8.1.180.0000.00818.10
8.1.170.0030.00518.52
8.1.160.0000.00818.81
8.1.150.0030.00618.81
8.1.140.0040.00422.13
8.1.130.0030.00320.15
8.1.120.0040.00417.48
8.1.110.0070.00317.36
8.1.100.0000.00817.43
8.1.90.0060.00317.48
8.1.80.0030.00517.47
8.1.70.0050.00317.44
8.1.60.0090.00017.59
8.1.50.0030.00517.55
8.1.40.0060.00617.43
8.1.30.0030.00617.60
8.1.20.0000.00817.67
8.1.10.0000.00817.61
8.1.00.0040.00417.53
8.0.300.0080.00018.77
8.0.290.0000.00716.75
8.0.280.0090.00018.33
8.0.270.0030.00317.20
8.0.260.0040.00418.38
8.0.250.0000.00717.03
8.0.240.0040.00416.93
8.0.230.0060.00016.93
8.0.220.0000.00716.83
8.0.210.0070.00016.80
8.0.200.0000.00616.85
8.0.190.0050.00316.90
8.0.180.0050.00516.89
8.0.170.0000.00916.93
8.0.160.0070.00316.92
8.0.150.0000.00716.96
8.0.140.0000.00816.89
8.0.130.0030.00313.25
8.0.120.0040.00416.84
8.0.110.0040.00416.84
8.0.100.0070.00016.84
8.0.90.0020.00516.78
8.0.80.0060.01316.86
8.0.70.0070.00016.86
8.0.60.0000.00716.87
8.0.50.0040.00416.80
8.0.30.0110.01016.98
8.0.20.0080.01217.40
8.0.10.0040.00416.91
8.0.00.0100.00816.70
7.4.330.0000.00515.55
7.4.320.0070.00016.64
7.4.300.0000.00716.59
7.4.290.0000.00616.61
7.4.280.0040.00416.53
7.4.270.0000.00716.46
7.4.260.0000.00716.61
7.4.250.0000.00716.54
7.4.240.0030.00316.58
7.4.230.0070.00016.51
7.4.220.0000.00816.61
7.4.210.0120.00316.62
7.4.200.0030.00316.64
7.4.160.0070.01016.45
7.4.140.0110.00717.86
7.4.130.0060.01216.64
7.4.120.0090.01016.49
7.4.110.0110.01616.64
7.4.100.0110.00816.44
7.4.90.0090.00916.50
7.4.80.0130.00319.39
7.4.70.0050.01516.42
7.4.60.0030.01416.62
7.4.50.0100.00716.44
7.4.40.0170.00016.62
7.4.00.0070.00315.26
7.3.330.0000.00613.27
7.3.320.0050.00013.21
7.3.310.0050.00516.39
7.3.300.0000.00716.33
7.3.290.0070.00016.41
7.3.280.0080.00716.34
7.3.260.0100.01216.38
7.3.240.0130.00616.57
7.3.230.0080.01016.37
7.3.210.0120.00616.64
7.3.200.0110.00716.36
7.3.190.0160.00516.41
7.3.180.0080.00816.53
7.3.170.0100.01016.42
7.3.160.0090.01316.65
7.2.330.0060.01216.68
7.2.320.0110.01116.66
7.2.310.0090.00816.78
7.2.300.0060.01116.96
7.2.290.0110.00716.72
7.2.120.0040.01016.77
7.2.110.0100.00516.50
7.2.100.0060.00816.52
7.2.90.0120.00316.55
7.2.80.0070.00816.63
7.2.70.0070.00616.96
7.2.60.0070.00716.68
7.2.50.0080.00816.74
7.2.40.0110.00516.94
7.2.30.0070.00817.01
7.2.20.0110.00616.87
7.2.10.0100.00716.87
7.2.00.0060.01016.99
7.1.240.0100.00315.78
7.1.230.0080.00615.69
7.1.220.0070.00915.81
7.1.210.0030.00915.74
7.1.200.0050.00915.63
7.1.190.0080.00615.80
7.1.180.0080.00615.77
7.1.170.0090.00515.47
7.1.160.0080.00715.79
7.1.150.0040.00915.86
7.1.140.0060.01115.79
7.1.130.0130.00015.62
7.1.120.0090.00615.56
7.1.110.0050.00915.62
7.1.100.0070.00715.64
7.1.90.0050.01015.70
7.1.80.0090.00715.70
7.1.70.0050.01115.71
7.1.60.0080.00615.87
7.1.50.0070.00815.52
7.1.40.0070.00915.77
7.1.30.0090.00415.80
7.1.20.0060.00615.63
7.1.10.0070.00815.55
7.1.00.0080.00615.79
5.6.380.0090.00614.36

preferences:
52.1 ms | 403 KiB | 5 Q