3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Initialize the array with a fixed length $array = new SplFixedArray(5); $array[1] = 2; $array[4] = "foo"; var_dump($array[0]); // NULL var_dump($array[1]); // int(2) var_dump($array["4"]); // string(3) "foo" // Increase the size of the array to 10 $array->setSize(10); $array[9] = "asdf"; // Shrink the array to a size of 2 $array->setSize(2); // The following lines throw a RuntimeException: Index invalid or out of range try { var_dump($array["non-numeric"]); } catch(RuntimeException $re) { echo "RuntimeException: ".$re->getMessage()."\n"; } try { var_dump($array[-1]); } catch(RuntimeException $re) { echo "RuntimeException: ".$re->getMessage()."\n"; } try { var_dump($array[5]); } catch(RuntimeException $re) { echo "RuntimeException: ".$re->getMessage()."\n"; }

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.0120.00316.61
8.3.50.0080.01322.92
8.3.40.0140.00018.93
8.3.30.0060.00819.25
8.3.20.0070.00020.34
8.3.10.0040.00421.89
8.3.00.0080.00019.80
8.2.180.0070.00718.41
8.2.170.0150.00622.96
8.2.160.0100.01020.48
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00819.22
8.2.110.0030.00622.25
8.2.100.0070.00317.91
8.2.90.0040.00418.88
8.2.80.0000.00819.28
8.2.70.0000.00817.59
8.2.60.0060.00318.03
8.2.50.0080.00318.07
8.2.40.0050.00217.93
8.2.30.0080.00019.42
8.2.20.0000.00717.71
8.2.10.0070.00018.09
8.2.00.0040.00417.68
8.1.280.0100.01025.92
8.1.270.0080.00023.89
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00323.83
8.1.230.0130.00019.12
8.1.220.0040.00417.76
8.1.210.0040.00418.77
8.1.200.0030.00617.13
8.1.190.0000.00817.53
8.1.180.0040.00418.88
8.1.170.0000.00918.61
8.1.160.0030.00618.85
8.1.150.0040.00418.75
8.1.140.0000.00817.31
8.1.130.0000.00817.76
8.1.120.0000.00717.35
8.1.110.0040.00417.27
8.1.100.0000.00717.33
8.1.90.0030.00617.41
8.1.80.0040.00417.41
8.1.70.0070.00017.25
8.1.60.0040.00417.47
8.1.50.0000.00917.45
8.1.40.0040.00417.48
8.1.30.0030.00517.74
8.1.20.0040.00417.64
8.1.10.0050.00317.58
8.1.00.0040.00417.55
8.0.300.0040.00418.77
8.0.290.0000.00817.05
8.0.280.0040.00418.46
8.0.270.0000.00717.23
8.0.260.0030.00317.28
8.0.250.0030.00316.96
8.0.240.0030.00317.01
8.0.230.0030.00317.10
8.0.220.0000.00716.88
8.0.210.0030.00316.88
8.0.200.0000.00616.97
8.0.190.0000.00717.09
8.0.180.0060.00317.05
8.0.170.0040.00416.86
8.0.160.0000.00716.98
8.0.150.0000.00716.93
8.0.140.0040.00416.97
8.0.130.0000.00613.41
8.0.120.0000.00816.91
8.0.110.0050.00217.01
8.0.100.0040.00416.81
8.0.90.0000.00716.88
8.0.80.0100.00717.00
8.0.70.0000.00716.86
8.0.60.0000.00716.78
8.0.50.0070.00016.70
8.0.30.0090.00917.17
8.0.20.0030.01617.41
8.0.10.0040.00416.91
8.0.00.0120.00616.63
7.4.330.0000.00615.02
7.4.320.0000.00616.47
7.4.300.0040.00416.52
7.4.290.0000.00716.61
7.4.280.0030.00516.64
7.4.270.0000.00616.61
7.4.260.0040.00416.56
7.4.250.0040.00416.57
7.4.240.0030.00316.51
7.4.230.0030.00316.73
7.4.220.0110.00616.63
7.4.210.0090.00616.57
7.4.200.0000.00716.52
7.4.160.0090.00616.64
7.4.150.0110.00817.40
7.4.140.0090.00917.86
7.4.130.0130.00516.48
7.4.120.0050.01316.47
7.4.110.0140.01116.48
7.4.100.0200.00516.64
7.4.90.0110.00616.41
7.4.80.0090.01319.39
7.4.70.0040.01416.45
7.4.60.0070.01016.71
7.4.50.0060.00316.56
7.4.40.0100.00716.60
7.4.30.0050.01116.63
7.4.00.0070.01014.91
7.3.330.0030.00313.11
7.3.320.0000.00513.26
7.3.310.0000.00716.30
7.3.300.0000.00816.38
7.3.290.0090.00616.36
7.3.280.0070.00716.39
7.3.270.0060.01217.40
7.3.260.0090.00916.39
7.3.250.0060.01416.54
7.3.240.0070.01416.61
7.3.230.0090.00616.39
7.3.210.0030.01316.44
7.3.200.0060.01719.39
7.3.190.0150.00316.63
7.3.180.0130.00316.50
7.3.170.0060.01316.46
7.3.160.0090.00616.48
7.2.330.0120.00616.78
7.2.320.0090.00916.75
7.2.310.0100.01316.79
7.2.300.0100.00616.67
7.2.290.0090.00916.76
7.2.80.0070.00716.64
7.2.60.0120.00316.65
7.2.00.0040.01419.25
7.1.200.0040.00715.91
7.1.100.0000.01518.17
7.1.70.0030.01317.40
7.1.60.0120.00416.96
7.1.50.0120.00317.02
7.1.40.0050.00516.83
7.1.30.0030.01416.71
7.1.20.0040.01816.80
7.1.10.0060.00616.55
7.1.00.0030.00516.67
7.0.200.0110.00516.70
7.0.190.0080.00816.88
7.0.180.0040.00416.56
7.0.170.0060.00916.57
7.0.160.0030.00616.39
7.0.150.0030.00716.27
7.0.140.0050.00316.45
7.0.130.0090.00016.56
7.0.120.0030.00516.66
7.0.110.0030.00916.47
7.0.100.0050.00516.50
7.0.90.0030.00616.32
7.0.80.0050.00216.51
7.0.70.0040.00416.45
7.0.60.0090.00616.27
7.0.50.0000.01716.48
7.0.40.0040.00414.81
7.0.30.0070.01114.67
7.0.20.0000.00814.67
7.0.10.0000.00714.67
7.0.00.0030.00614.67
5.6.300.0100.06020.93
5.6.290.0100.03520.79
5.6.280.0090.03521.05
5.6.270.0100.03421.04
5.6.260.0000.06020.87
5.6.250.0160.03820.88
5.6.240.0070.04520.87
5.6.230.0030.04320.92
5.6.220.0100.03620.82
5.6.210.0170.06020.81
5.6.200.0070.03920.96
5.6.190.0000.05020.86
5.6.180.0130.03920.77
5.6.170.0060.03820.93
5.6.160.0030.09620.82
5.6.150.0030.04420.82
5.6.140.0000.04520.77
5.6.130.0070.08020.86
5.6.120.0070.04020.93
5.6.110.0000.06821.03
5.6.100.0070.04020.82
5.6.90.0060.05220.94
5.6.80.0000.05620.21
5.6.70.0070.03620.20
5.6.60.0070.06720.20
5.6.50.0070.03720.21
5.6.40.0030.05620.21
5.6.30.0030.04020.21
5.6.20.0100.05320.34
5.6.10.0070.03420.34
5.6.00.0030.04120.16
5.5.380.0030.03717.48
5.5.370.0070.05617.50
5.5.360.0230.04317.40
5.5.350.0060.07817.45
5.5.340.0000.06417.86
5.5.330.0030.07417.94
5.5.320.0000.04818.00
5.5.310.0030.04517.75
5.5.300.0070.06317.96
5.5.290.0070.04417.83
5.5.280.0100.03418.02
5.5.270.0030.07717.98
5.5.260.0030.04317.98
5.5.250.0030.06917.77
5.5.240.0030.04417.22
5.5.230.0140.03817.35
5.5.220.0030.03717.32
5.5.210.0030.04017.50
5.5.200.0070.03717.21
5.5.190.0030.04017.29
5.5.180.0000.04317.09
5.5.160.0070.03617.07
5.5.150.0030.03717.34
5.5.140.0030.03717.29
5.5.130.0000.04017.38
5.5.120.0000.05117.45
5.5.110.0200.03317.30
5.5.100.0030.06917.29
5.5.90.0000.04517.09
5.5.80.0030.08917.21
5.5.70.0000.04117.20
5.5.60.0060.03516.95
5.5.50.0030.03617.11
5.5.40.0030.04016.94
5.5.30.0000.08217.32
5.5.20.0030.07816.94
5.5.10.0000.04417.18
5.5.00.0070.04417.26
5.4.450.0000.04519.47
5.4.440.0070.03719.16
5.4.430.0000.04319.37
5.4.420.0000.04419.37
5.4.410.0030.07219.26
5.4.400.0000.04618.83
5.4.390.0030.04018.83
5.4.380.0030.05818.84
5.4.370.0000.04019.02
5.4.360.0000.04119.14
5.4.350.0000.05718.93
5.4.340.0000.04319.08
5.4.320.0030.03819.14
5.4.310.0030.03919.07
5.4.300.0030.03619.09
5.4.290.0030.03719.04
5.4.280.0030.05919.05
5.4.270.0030.04419.14
5.4.260.0070.07018.88
5.4.250.0030.03919.00
5.4.240.0070.04018.93
5.4.230.0070.05018.98
5.4.220.0030.07119.11
5.4.210.0070.05819.00
5.4.200.0030.03718.91
5.4.190.0000.07318.84
5.4.180.0030.05918.95
5.4.170.0000.04119.04
5.4.160.0100.05019.03
5.4.150.0030.04418.81
5.4.140.0030.04316.69
5.4.130.0100.03616.63
5.4.120.0070.05516.43
5.4.110.0060.03916.57
5.4.100.0030.05016.64
5.4.90.0070.04016.36
5.4.80.0000.03716.34
5.4.70.0070.03116.60
5.4.60.0160.02516.56
5.4.50.0030.03616.48
5.4.40.0100.03816.49
5.4.30.0030.05716.66
5.4.20.0000.03716.43
5.4.10.0030.04816.47
5.4.00.0070.06916.00
5.3.290.0000.04014.86
5.3.280.0000.04914.75
5.3.270.0030.04014.76
5.3.260.0030.04514.74
5.3.250.0030.06814.67
5.3.240.0000.04114.67
5.3.230.0000.04414.73
5.3.220.0030.04014.67
5.3.210.0000.04214.67
5.3.200.0030.04014.68
5.3.190.0070.03214.67
5.3.180.0000.03914.73
5.3.170.0030.04714.67
5.3.160.0000.03914.68
5.3.150.0030.04814.67
5.3.140.0000.03914.67
5.3.130.0030.03614.70
5.3.120.0000.03814.74
5.3.110.0030.07614.67
5.3.100.0000.03814.67
5.3.90.0030.07114.67
5.3.80.0070.04214.67
5.3.70.0030.04214.67
5.3.60.0030.03614.67
5.3.50.0170.03714.67
5.3.40.0000.03914.67
5.3.30.0030.03314.67
5.3.20.0000.04114.67
5.3.10.0000.05414.67
5.3.00.0000.03814.67
5.2.170.0070.03314.67
5.2.160.0030.03414.67
5.2.150.0060.02514.67
5.2.140.0000.04214.67
5.2.130.0000.03214.67
5.2.120.0030.02714.67
5.2.110.0030.02914.67
5.2.100.0040.02914.67
5.2.90.0030.02814.67
5.2.80.0000.05614.67
5.2.70.0030.02814.67
5.2.60.0070.02714.67
5.2.50.0030.03214.67
5.2.40.0000.03114.67
5.2.30.0030.02814.67
5.2.20.0070.02414.67
5.2.10.0070.04214.67
5.2.00.0000.04414.67
5.1.60.0060.03914.67
5.1.50.0000.03214.67
5.1.40.0060.02214.67
5.1.30.0030.02614.67
5.1.20.0000.03214.67
5.1.10.0030.03714.67
5.1.00.0000.03614.67
5.0.50.0030.01914.67
5.0.40.0030.02014.67
5.0.30.0040.03214.67
5.0.20.0030.04014.67
5.0.10.0030.02514.67
5.0.00.0110.03214.67
4.4.90.0000.01714.67
4.4.80.0000.01614.67
4.4.70.0070.02314.67
4.4.60.0060.03214.67
4.4.50.0000.02614.67
4.4.40.0030.03014.67
4.4.30.0000.01614.67
4.4.20.0030.01314.67
4.4.10.0000.02314.67
4.4.00.0000.02614.67
4.3.110.0030.01514.67
4.3.100.0030.02714.67
4.3.90.0000.03314.67
4.3.80.0030.02614.67
4.3.70.0030.01314.67
4.3.60.0030.01514.67
4.3.50.0030.01414.67
4.3.40.0060.01814.67
4.3.30.0000.02714.67
4.3.20.0000.02514.67
4.3.10.0000.03314.67
4.3.00.0000.02314.67

preferences:
37.48 ms | 400 KiB | 5 Q