3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('MAX_LOOPS',5); function withRefValue($elements, $transform) { for ($i=0; $i<$elements; $i++) { $a[] = "v.$i"; } $counter=0; foreach ($a as $k=>&$v) { eval($transform); $counter++; if ($counter>MAX_LOOPS) { break; } } echo "--> State of array after loop:\n"; var_dump($a); } echo "\nPopping elements off end of an unreferenced array, using &\$value."; $transform = 'array_pop($a);'; withRefValue(1, $transform); withRefValue(2, $transform); withRefValue(3, $transform); withRefValue(4, $transform); withRefValue(5, $transform); withRefValue(6, $transform); withRefValue(7, $transform); withRefValue(8, $transform);

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.40.0060.00918.71
8.3.30.0080.00619.10
8.3.20.0080.00020.39
8.3.10.0050.00323.48
8.3.00.0000.00817.50
8.2.170.0110.00422.96
8.2.160.0000.01320.55
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0110.00426.16
8.2.120.0000.00821.02
8.2.110.0060.00322.31
8.2.100.0000.01219.76
8.2.90.0050.00318.92
8.2.80.0080.00017.97
8.2.70.0080.00417.50
8.2.60.0030.00518.04
8.2.50.0000.00918.07
8.2.40.0000.00818.22
8.2.30.0000.00718.13
8.2.20.0000.00817.70
8.2.10.0050.00318.20
8.2.00.0000.00717.66
8.1.270.0090.00023.97
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0040.01223.82
8.1.230.0060.00619.16
8.1.220.0060.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00317.25
8.1.190.0040.00417.25
8.1.180.0090.00018.10
8.1.170.0080.00318.65
8.1.160.0040.00421.97
8.1.150.0050.00218.81
8.1.140.0000.00717.51
8.1.130.0030.00317.79
8.1.120.0000.00717.52
8.1.110.0000.00717.44
8.1.100.0000.00817.52
8.1.90.0040.00417.52
8.1.80.0050.00217.43
8.1.70.0050.00317.45
8.1.60.0050.00317.64
8.1.50.0090.00017.54
8.1.40.0030.00617.54
8.1.30.0080.00017.62
8.1.20.0110.00017.68
8.1.10.0070.00017.61
8.1.00.0000.00917.60
8.0.300.0070.00018.77
8.0.290.0060.00316.88
8.0.280.0040.00418.41
8.0.270.0020.00517.35
8.0.260.0030.00317.32
8.0.250.0080.00017.02
8.0.240.0050.00317.00
8.0.230.0030.00316.98
8.0.220.0030.00316.98
8.0.210.0000.00716.95
8.0.200.0000.00716.97
8.0.190.0000.00717.00
8.0.180.0030.00516.97
8.0.170.0000.00816.96
8.0.160.0000.00716.98
8.0.150.0040.00416.95
8.0.140.0000.01116.88
8.0.130.0000.00613.44
8.0.120.0000.00816.86
8.0.110.0040.00416.91
8.0.100.0040.00417.03
8.0.90.0040.00417.00
8.0.80.0120.01016.93
8.0.70.0000.00716.89
8.0.60.0040.00416.77
8.0.50.0040.00416.95
8.0.30.0090.01117.12
8.0.20.0020.01817.40
8.0.10.0030.00616.99
8.0.00.0080.01116.74
7.4.330.0060.00015.00
7.4.320.0030.00316.66
7.4.300.0000.00616.55
7.4.290.0030.00316.43
7.4.280.0040.00416.45
7.4.270.0040.00416.50
7.4.260.0070.00016.47
7.4.250.0040.00416.41
7.4.240.0050.00216.64
7.4.230.0030.00616.45
7.4.220.0120.01516.61
7.4.210.0090.00616.59
7.4.200.0030.00316.53
7.4.160.0060.01016.58
7.4.150.0110.00617.40
7.4.140.0090.01017.86
7.4.130.0160.00616.43
7.4.120.0110.00716.51
7.4.110.0120.00616.50
7.4.100.0140.00416.53
7.4.90.0000.01616.57
7.4.80.0170.00419.39
7.4.70.0120.01116.46
7.4.60.0090.00916.60
7.4.50.0040.00416.61
7.4.40.0120.00616.43
7.4.30.0070.01016.64
7.4.00.0100.00714.95
7.3.330.0030.00313.34
7.3.320.0060.00013.39
7.3.310.0030.00316.29
7.3.300.0000.00716.39
7.3.290.0040.01116.45
7.3.280.0100.00616.35
7.3.270.0110.01417.40
7.3.260.0150.00416.60
7.3.240.0030.01416.57
7.3.230.0120.00616.57
7.3.210.0130.00716.67
7.3.200.0100.00719.39
7.3.190.0120.00616.73
7.3.180.0090.00816.57
7.3.170.0060.00916.69
7.3.160.0050.01116.54
7.2.330.0130.00616.52
7.2.320.0130.00416.71
7.2.310.0050.01316.74
7.2.300.0070.01016.81
7.2.290.0070.01016.81
7.2.60.0100.00716.94
7.2.00.0060.00619.68
7.1.200.0060.00315.75
7.1.100.0060.00818.15
7.1.70.0090.00316.68
7.1.60.0090.00919.40
7.1.50.0120.00616.92
7.1.00.0070.07022.28
7.0.200.0000.00716.79
7.0.140.0000.08022.12
7.0.60.0070.05319.97
7.0.50.0070.04318.00
7.0.40.0000.05720.09
7.0.30.0530.07020.20
7.0.20.0070.05020.15
7.0.10.0130.07720.19
7.0.00.0070.07320.09
5.6.280.0030.07721.05
5.6.210.0100.07720.63
5.6.200.0100.04318.14
5.6.190.0130.08020.67
5.6.180.0170.04320.63
5.6.170.0270.07720.47
5.6.160.0000.09020.39
5.6.150.0100.07718.24
5.6.140.0100.08018.18
5.6.130.0030.04018.18
5.6.120.0130.08021.02
5.6.110.0030.08320.95
5.6.100.0200.07021.13
5.6.90.0100.04321.05
5.6.80.0100.07720.26
5.5.350.0230.04720.30
5.5.340.0070.07317.97
5.5.330.0070.04020.47
5.5.320.0500.06720.52
5.5.310.0400.07720.31
5.5.300.0100.05717.97
5.5.290.0100.07717.98
5.5.280.0030.04320.89
5.5.270.0000.09020.89
5.5.260.0130.08720.96
5.5.250.0000.09320.80
5.5.240.0200.06720.19
5.4.450.0530.04019.41
5.4.440.0530.04319.41
5.4.430.0530.03719.32
5.4.420.0370.04719.54
5.4.410.0400.04319.41
5.4.400.0170.04019.23
5.4.390.0330.04019.13
5.4.380.0600.08318.62
5.4.370.0430.05718.71
5.4.360.0330.05018.77
5.4.350.0300.05318.79
5.4.340.0470.06718.79
5.4.320.0020.04212.52
5.4.310.0060.04012.52
5.4.300.0110.03412.52
5.4.290.0050.04112.52
5.4.280.0020.03912.41
5.4.270.0060.03712.41
5.4.260.0050.03912.41
5.4.250.0060.03812.41
5.4.240.0080.03412.41
5.4.230.0060.03712.40
5.4.220.0050.03712.41
5.4.210.0060.03612.41
5.4.200.0040.04112.40
5.4.190.0090.03412.40
5.4.180.0040.03912.40
5.4.170.0060.03712.41
5.4.160.0060.03712.40
5.4.150.0060.03712.40
5.4.140.0090.03512.08
5.4.130.0030.04012.07
5.4.120.0090.03512.03
5.4.110.0060.03512.02
5.4.100.0070.03812.02
5.4.90.0080.03712.02
5.4.80.0070.03612.02
5.4.70.0040.03612.01
5.4.60.0070.03512.02
5.4.50.0060.03512.02
5.4.40.0020.03912.00
5.4.30.0050.03812.00
5.4.20.0110.03112.00
5.4.10.0080.03412.00
5.4.00.0070.03511.50
5.3.290.0050.04112.80
5.3.280.0020.04312.71
5.3.270.0080.03812.72
5.3.260.0080.03812.72
5.3.250.0080.03512.72
5.3.240.0090.03412.72
5.3.230.0070.03712.71
5.3.220.0060.03812.68
5.3.210.0100.03712.68
5.3.200.0060.04012.68
5.3.190.0070.03712.68
5.3.180.0060.03712.68
5.3.170.0060.03712.66
5.3.160.0100.03312.67
5.3.150.0100.03312.67
5.3.140.0060.03612.66
5.3.130.0070.03712.66
5.3.120.0050.03912.66
5.3.110.0050.04012.65
5.3.100.0060.04012.14
5.3.90.0030.04012.11
5.3.80.0040.03812.11
5.3.70.0090.03412.11
5.3.60.0060.03712.09
5.3.50.0060.03612.04
5.3.40.0070.03512.04
5.3.30.0050.03612.00
5.3.20.0050.03711.78
5.3.10.0060.03711.74
5.3.00.0060.03711.73
5.2.170.0050.0359.24
5.2.160.0050.0309.23
5.2.150.0040.0339.23
5.2.140.0040.0329.23
5.2.130.0070.0309.19
5.2.120.0050.0309.20
5.2.110.0040.0319.20
5.2.100.0030.0319.20
5.2.90.0070.0289.20
5.2.80.0050.0309.19
5.2.70.0050.0309.19
5.2.60.0050.0339.14
5.2.50.0060.0449.12
5.2.40.0070.0279.09
5.2.30.0030.0359.07
5.2.20.0060.0349.06
5.2.10.0050.0348.95
5.2.00.0030.0308.81
5.1.60.0040.0248.09
5.1.50.0030.0268.09
5.1.40.0050.0238.07
5.1.30.0040.0278.42
5.1.20.0030.0288.44
5.1.10.0020.0318.16
5.1.00.0090.0238.17
5.0.50.0060.0186.64
5.0.40.0040.0196.51
5.0.30.0010.0346.32
5.0.20.0010.0226.28
5.0.10.0040.0206.27
5.0.00.0070.0286.27
4.4.90.0040.0154.78
4.4.80.0030.0164.76
4.4.70.0030.0154.75
4.4.60.0000.0194.75
4.4.50.0040.0144.77
4.4.40.0010.0274.71
4.4.30.0030.0154.76
4.4.20.0060.0124.84
4.4.10.0030.0164.84
4.4.00.0010.0284.76
4.3.110.0020.0164.67
4.3.100.0000.0184.66
4.3.90.0040.0134.63
4.3.80.0030.0234.58
4.3.70.0030.0144.63
4.3.60.0020.0154.63
4.3.50.0020.0164.63
4.3.40.0010.0264.54
4.3.30.0010.0173.30
4.3.20.0010.0173.29
4.3.10.0030.0143.24
4.3.00.0030.02015.96

preferences:
38.96 ms | 400 KiB | 5 Q