3v4l.org

run code in 300+ PHP versions simultaneously
<?php // r() simply returns a reference to a given variable. function &r(&$v){return $v;} // Here, we have a scalar $a on which settype() fails to operate if // parentheses are involved. print "Scalar demonstration:\n"; $a = 1; // First with parentheses, then without. // v v settype( ( r($a) ) , "boolean"); var_dump($a); settype( r($a) , "boolean"); var_dump($a); // ^ ^ // Here is a similar situation where array_pop() fails to operate upon a // reference to an array if parentheses are involved. print "\nArray demonstration:\n"; $b = array("c"); // First with parentheses, then without. // v v array_pop( ( r($b) ) ); print_r($b); array_pop( r($b) ); print_r($b); // ^ ^

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.0060.00818.43
8.3.50.0140.00422.07
8.3.40.0120.00318.65
8.3.30.0110.00418.92
8.3.20.0040.00420.16
8.3.10.0080.00020.53
8.3.00.0080.00019.13
8.2.180.0130.00916.32
8.2.170.0110.00422.96
8.2.160.0130.00320.30
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0070.00022.04
8.2.110.0090.00020.34
8.2.100.0100.00018.03
8.2.90.0040.00419.05
8.2.80.0000.00917.97
8.2.70.0060.00317.63
8.2.60.0080.00017.80
8.2.50.0000.01318.07
8.2.40.0000.00818.09
8.2.30.0000.00719.33
8.2.20.0050.00217.52
8.2.10.0040.00418.09
8.2.00.0040.00417.84
8.1.280.0120.00325.92
8.1.270.0060.00323.98
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0080.00024.01
8.1.230.0000.01119.15
8.1.220.0090.00017.74
8.1.210.0050.00318.77
8.1.200.0000.00917.22
8.1.190.0040.00417.35
8.1.180.0030.00618.10
8.1.170.0000.00818.57
8.1.160.0000.00821.91
8.1.150.0040.00418.77
8.1.140.0040.00417.42
8.1.130.0030.00317.85
8.1.120.0030.00417.39
8.1.110.0050.00317.34
8.1.100.0070.00017.33
8.1.90.0030.00317.37
8.1.80.0040.00417.34
8.1.70.0080.00017.43
8.1.60.0080.00017.50
8.1.50.0040.00417.56
8.1.40.0030.00517.44
8.1.30.0060.00317.54
8.1.20.0000.00817.54
8.1.10.0020.00517.46
8.1.00.0050.00217.33
8.0.300.0080.00018.77
8.0.290.0000.00816.63
8.0.280.0030.00318.38
8.0.270.0070.00017.19
8.0.260.0060.00017.13
8.0.250.0000.00716.81
8.0.240.0000.00716.96
8.0.230.0040.00416.80
8.0.220.0040.00416.88
8.0.210.0070.00016.79
8.0.200.0000.00716.96
8.0.190.0030.00316.79
8.0.180.0040.00416.75
8.0.170.0080.00016.87
8.0.160.0000.00716.85
8.0.150.0080.00016.73
8.0.140.0040.00416.70
8.0.130.0030.00313.34
8.0.120.0000.00716.72
8.0.110.0000.00816.88
8.0.100.0050.00316.76
8.0.90.0070.00016.92
8.0.80.0090.01216.86
8.0.70.0040.00416.90
8.0.60.0040.00416.84
8.0.50.0040.00416.84
8.0.30.0150.00517.22
8.0.20.0050.01517.40
8.0.10.0000.00717.04
8.0.00.0110.00816.94
7.4.330.0000.00515.04
7.4.320.0000.00616.61
7.4.300.0060.00016.54
7.4.290.0000.00716.50
7.4.280.0050.00316.63
7.4.270.0040.00416.69
7.4.260.0030.00316.55
7.4.250.0000.00716.48
7.4.240.0040.00416.60
7.4.230.0070.00016.48
7.4.220.0030.01516.70
7.4.210.0030.01016.50
7.4.200.0050.00316.59
7.4.160.0060.01016.46
7.4.150.0130.00717.40
7.4.140.0120.00917.86
7.4.130.0090.00916.64
7.4.120.0030.01416.48
7.4.110.0030.01316.39
7.4.100.0100.00716.53
7.4.90.0130.00616.58
7.4.80.0150.00919.37
7.4.70.0060.00916.58
7.4.60.0150.00616.44
7.4.50.0080.00016.66
7.4.40.0090.00916.35
7.4.30.0100.00716.53
7.4.00.0060.00915.20
7.3.330.0000.00513.34
7.3.320.0000.00513.14
7.3.310.0070.00016.35
7.3.300.0000.00716.41
7.3.290.0040.01116.38
7.3.280.0120.00516.30
7.3.270.0100.01017.40
7.3.260.0110.00616.58
7.3.250.0090.00816.30
7.3.240.0140.00616.33
7.3.230.0040.01416.47
7.3.210.0100.00616.46
7.3.200.0100.00719.39
7.3.190.0090.00916.57
7.3.180.0070.01016.18
7.3.170.0040.01216.27
7.3.160.0070.01616.34
7.2.330.0100.00716.60
7.2.320.0090.00716.61
7.2.310.0070.01016.38
7.2.300.0090.00616.25
7.2.290.0080.00816.33
7.2.60.0070.00716.66
7.2.00.0030.01419.26
7.1.200.0060.00815.80
7.1.100.0040.00718.18
7.1.70.0000.00917.15
7.1.60.0070.01719.32
7.1.50.0100.01316.92
7.1.00.0070.07022.30
7.0.200.0000.01016.90
7.0.140.0000.07721.95
7.0.60.0100.05019.98
7.0.50.0030.06017.87
7.0.40.0070.08720.18
7.0.30.0170.05720.09
7.0.20.0130.04320.41
7.0.10.0100.07720.24
7.0.00.0070.04720.32
5.6.280.0100.06720.91
5.6.210.0030.08720.75
5.6.200.0030.05718.22
5.6.190.0130.07720.57
5.6.180.0370.07020.77
5.6.170.0200.04320.71
5.6.160.0070.07320.48
5.6.150.0030.04718.23
5.6.140.0070.05318.17
5.6.130.0070.08018.23
5.6.120.0030.04021.02
5.6.110.0100.03720.99
5.6.100.0130.04720.94
5.6.90.0030.08720.99
5.6.80.0030.05320.39
5.5.350.0170.03320.35
5.5.340.0030.06018.00
5.5.330.0000.04320.34
5.5.320.0300.04320.34
5.5.310.0300.05720.34
5.5.300.0030.08717.98
5.5.290.0130.07317.93
5.5.280.0070.08320.77
5.5.270.0170.07320.77
5.5.260.0100.06320.79
5.5.250.0030.04020.58
5.5.240.0070.07320.13
5.4.450.0530.06019.61
5.4.440.0300.06019.48
5.4.430.0800.05019.63
5.4.420.0930.05019.69
5.4.410.0770.06019.50
5.4.400.0900.06719.13
5.4.390.0670.05319.30
5.4.380.0670.06318.72
5.4.370.0370.05018.79
5.4.360.0370.05018.56
5.4.350.0370.04718.78
5.4.340.0400.05718.62
5.4.320.0070.04712.51
5.4.310.0070.03712.50
5.4.300.0080.03512.51
5.4.290.0060.03712.50
5.4.280.0050.03612.39
5.4.270.0070.03412.39
5.4.260.0080.03712.40
5.4.250.0050.03712.39
5.4.240.0090.03312.40
5.4.230.0060.03712.39
5.4.220.0070.03512.39
5.4.210.0050.03812.39
5.4.200.0120.03312.39
5.4.190.0060.03812.39
5.4.180.0030.04012.38
5.4.170.0050.03712.40
5.4.160.0090.03312.39
5.4.150.0110.03112.39
5.4.140.0070.04112.07
5.4.130.0080.03412.06
5.4.120.0050.03712.02
5.4.110.0060.03612.02
5.4.100.0030.03912.01
5.4.90.0050.03812.02
5.4.80.0040.03912.01
5.4.70.0070.03912.01
5.4.60.0060.03412.01
5.4.50.0030.03812.00
5.4.40.0050.04011.99
5.4.30.0090.03211.99
5.4.20.0100.03412.00
5.4.10.0070.03612.00
5.4.00.0040.03811.48
5.3.290.0090.04612.80
5.3.280.0070.04212.71
5.3.270.0100.03712.72
5.3.260.0030.04512.72
5.3.250.0060.03812.72
5.3.240.0060.03712.72
5.3.230.0080.03512.71
5.3.220.0070.03612.68
5.3.210.0080.03912.68
5.3.200.0100.03312.68
5.3.190.0080.03512.68
5.3.180.0060.03812.67
5.3.170.0100.03912.67
5.3.160.0070.03612.67
5.3.150.0050.04212.67
5.3.140.0090.03412.66
5.3.130.0060.03912.66
5.3.120.0090.04112.66
5.3.110.0040.04212.65
5.3.100.0090.04312.12
5.3.90.0030.03912.10
5.3.80.0080.03412.09
5.3.70.0050.04212.09
5.3.60.0040.04112.08
5.3.50.0040.03712.02
5.3.40.0050.03612.02
5.3.30.0060.03811.98
5.3.20.0080.03411.76
5.3.10.0070.03311.73
5.3.00.0060.03611.71
5.2.170.0040.0339.21
5.2.160.0070.0269.21
5.2.150.0050.0309.21
5.2.140.0080.0289.21
5.2.130.0040.0299.17
5.2.120.0030.0309.17
5.2.110.0040.0309.18
5.2.100.0040.0289.18
5.2.90.0060.0309.18
5.2.80.0100.0339.17
5.2.70.0060.0299.17
5.2.60.0060.0319.12
5.2.50.0040.0319.09
5.2.40.0040.0319.07
5.2.30.0060.0349.04
5.2.20.0060.0329.04
5.2.10.0080.0378.95
5.2.00.0100.0368.80
5.1.60.0050.0298.09
5.1.50.0040.0358.08
5.1.40.0060.0238.06
5.1.30.0050.0298.42
5.1.20.0040.0278.43
5.1.10.0020.0288.16
5.1.00.0030.0268.16
5.0.50.0050.0196.64
5.0.40.0030.0226.50
5.0.30.0040.0386.32
5.0.20.0030.0266.28
5.0.10.0060.0276.26
5.0.00.0030.0336.25
4.4.90.0030.0204.78
4.4.80.0010.0174.76
4.4.70.0040.0144.75
4.4.60.0020.0174.75
4.4.50.0020.0214.77
4.4.40.0040.0244.71
4.4.30.0030.0164.76
4.4.20.0030.0164.84
4.4.10.0050.0134.85
4.4.00.0020.0284.75
4.3.110.0020.0164.67
4.3.100.0020.0154.66
4.3.90.0010.0164.64
4.3.80.0030.0244.58
4.3.70.0020.0154.63
4.3.60.0010.0164.63
4.3.50.0020.0164.63
4.3.40.0040.0224.54
4.3.30.0010.0173.30
4.3.20.0020.0173.28
4.3.10.0040.0143.24
4.3.00.0130.0207.04

preferences:
41.82 ms | 401 KiB | 5 Q