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.40.0110.00418.60
8.3.30.0140.00019.15
8.3.20.0000.00820.35
8.3.10.0000.00823.64
8.3.00.0040.00419.13
8.2.170.0070.01422.96
8.2.160.0090.00620.28
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0030.01326.16
8.2.120.0040.00422.27
8.2.110.0060.00319.27
8.2.100.0090.00317.91
8.2.90.0080.00019.28
8.2.80.0030.00517.97
8.2.70.0040.00417.50
8.2.60.0050.00318.03
8.2.50.0040.00418.07
8.2.40.0030.00520.01
8.2.30.0060.00319.79
8.2.20.0040.00417.71
8.2.10.0000.00818.08
8.2.00.0040.00717.67
8.1.270.0060.00323.66
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00622.05
8.1.230.0040.00818.96
8.1.220.0030.00617.74
8.1.210.0000.00818.77
8.1.200.0030.00717.35
8.1.190.0000.00917.23
8.1.180.0030.00618.10
8.1.170.0030.00518.46
8.1.160.0040.00421.86
8.1.150.0070.00318.58
8.1.140.0050.00217.47
8.1.130.0070.00017.76
8.1.120.0030.00417.41
8.1.110.0000.00717.34
8.1.100.0070.00017.42
8.1.90.0000.00717.39
8.1.80.0000.00717.38
8.1.70.0040.00417.33
8.1.60.0000.00817.56
8.1.50.0030.00617.55
8.1.40.0030.00617.54
8.1.30.0050.00317.67
8.1.20.0040.00417.72
8.1.10.0040.00417.42
8.1.00.0050.00217.37
8.0.300.0000.00818.77
8.0.290.0060.00316.75
8.0.280.0040.00418.38
8.0.270.0030.00317.29
8.0.260.0050.00217.27
8.0.250.0040.00416.82
8.0.240.0000.00816.93
8.0.230.0000.00716.95
8.0.220.0040.00416.73
8.0.210.0050.00316.74
8.0.200.0060.00016.89
8.0.190.0000.00716.83
8.0.180.0030.00416.80
8.0.170.0040.00416.89
8.0.160.0050.00216.90
8.0.150.0050.00316.80
8.0.140.0030.00416.82
8.0.130.0050.00013.29
8.0.120.0040.00416.79
8.0.110.0030.00616.85
8.0.100.0000.00716.68
8.0.90.0040.00416.89
8.0.80.0090.00616.78
8.0.70.0040.00416.66
8.0.60.0000.00716.87
8.0.50.0000.00816.87
8.0.30.0110.00816.93
8.0.20.0150.00817.41
8.0.10.0040.00416.83
8.0.00.0090.01116.88
7.4.330.0000.00515.02
7.4.320.0030.00316.48
7.4.300.0040.00416.50
7.4.290.0030.00316.45
7.4.280.0000.00916.48
7.4.270.0030.00316.51
7.4.260.0040.00416.65
7.4.250.0000.00816.42
7.4.240.0030.00416.62
7.4.230.0000.00716.57
7.4.220.0070.01016.56
7.4.210.0040.01216.55
7.4.200.0000.00716.64
7.4.190.0000.00716.68
7.4.160.0060.01016.60
7.4.150.0090.00917.40
7.4.140.0070.00917.86
7.4.130.0100.00816.53
7.4.120.0130.00816.68
7.4.110.0130.00916.61
7.4.100.0110.00816.48
7.4.90.0070.01116.54
7.4.80.0160.00719.39
7.4.70.0120.00416.40
7.4.60.0170.00316.61
7.4.50.0050.00316.41
7.4.40.0040.01522.77
7.4.30.0100.01016.61
7.4.10.0160.00314.84
7.4.00.0080.00814.78
7.3.330.0050.00013.33
7.3.320.0050.00013.18
7.3.310.0040.00416.35
7.3.300.0030.00316.21
7.3.290.0160.00316.33
7.3.280.0120.00616.31
7.3.270.0140.00317.40
7.3.260.0100.00716.46
7.3.250.0150.00516.33
7.3.240.0090.01216.53
7.3.230.0030.01416.59
7.3.210.0140.00716.67
7.3.200.0100.01419.39
7.3.190.0070.01016.36
7.3.180.0080.00816.51
7.3.170.0090.00616.70
7.3.160.0130.00316.29
7.3.130.0030.01614.88
7.3.120.0060.00714.78
7.3.110.0160.00014.74
7.3.100.0080.00614.96
7.3.90.0070.00714.86
7.3.80.0070.00715.05
7.3.70.0030.01014.79
7.3.60.0030.01014.77
7.3.50.0060.00714.79
7.3.40.0090.00614.74
7.3.30.0070.00714.73
7.3.20.0080.00416.63
7.3.10.0050.00616.53
7.3.00.0060.00816.44
7.2.330.0110.01116.56
7.2.320.0110.00516.25
7.2.310.0100.01016.54
7.2.300.0080.00816.50
7.2.290.0030.01316.74
7.2.260.0070.01114.86
7.2.250.0070.01014.84
7.2.240.0070.01014.61
7.2.230.0100.00314.63
7.2.220.0040.00815.06
7.2.210.0080.00815.10
7.2.200.0030.01115.09
7.2.190.0090.00314.95
7.2.180.0080.00414.86
7.2.170.0040.01114.72
7.2.160.0030.00614.95
7.2.150.0030.01016.68
7.2.140.0070.00716.96
7.2.130.0090.00716.77
7.2.120.0650.00815.95
7.2.110.0550.01015.84
7.2.100.0320.01016.11
7.2.90.0500.00616.03
7.2.80.0570.00816.04
7.2.70.0610.00715.98
7.2.60.0340.00816.26
7.2.50.0840.01116.01
7.2.40.0500.00716.09
7.2.30.0580.01016.01
7.2.20.0460.00815.96
7.2.10.0220.00815.92
7.2.00.0460.00516.82
7.1.330.0060.00915.56
7.1.320.0040.01515.82
7.1.310.0000.01415.62
7.1.300.0060.00915.70
7.1.290.0060.00615.93
7.1.280.0000.01315.49
7.1.270.0120.00315.54
7.1.260.0030.01015.81
7.1.250.0060.00515.71
7.1.240.0890.00914.81
7.1.230.0690.00714.72
7.1.220.0880.00514.88
7.1.210.0670.00414.78
7.1.200.0520.00915.11
7.1.190.1080.00914.63
7.1.180.0880.01114.75
7.1.170.0800.00614.60
7.1.160.0490.00614.68
7.1.150.0720.00714.71
7.1.140.0420.00814.81
7.1.130.0530.00814.63
7.1.120.0430.00614.70
7.1.110.0560.00214.66
7.1.100.0450.01015.76
7.1.90.0240.01014.93
7.1.80.0270.00814.65
7.1.70.0230.00715.44
7.1.60.0240.00816.29
7.1.50.0270.00821.43
7.1.40.0200.01414.83
7.1.30.0300.01214.70
7.1.20.0230.00814.76
7.1.10.0220.01014.59
7.1.00.0100.03017.05
7.0.330.0030.00715.00
7.0.320.0870.00614.38
7.0.310.0710.00614.45
7.0.300.0800.00514.52
7.0.290.0870.00514.45
7.0.280.0590.00714.31
7.0.270.0380.00814.37
7.0.260.0850.00514.46
7.0.250.0390.00914.41
7.0.240.0610.00514.30
7.0.230.0220.00914.37
7.0.220.0230.00614.30
7.0.210.0250.00314.49
7.0.200.0170.00614.99
7.0.190.0280.00614.45
7.0.180.0260.00814.54
7.0.170.0250.00514.43
7.0.160.0260.00714.55
7.0.150.0160.00914.42
7.0.140.0220.02616.93
7.0.130.0320.00814.64
7.0.120.0240.01214.34
7.0.110.0200.00714.49
7.0.100.0300.00514.47
7.0.90.2060.00614.60
7.0.80.0190.01014.40
7.0.70.0110.02416.84
7.0.60.0050.03616.92
7.0.50.0100.03116.97
7.0.40.0090.01915.74
7.0.30.0110.03515.69
7.0.20.0110.02115.62
7.0.10.0060.02915.61
7.0.00.0090.01915.71
5.6.400.0080.00013.84
5.6.390.0040.00814.48
5.6.380.0070.00913.93
5.6.370.0080.01114.27
5.6.360.0060.01014.12
5.6.350.0120.00514.27
5.6.340.0160.00314.01
5.6.330.0120.00614.13
5.6.320.0080.01014.25
5.6.310.0140.00414.22
5.6.300.0080.00814.19
5.6.290.0100.01114.28
5.6.280.0080.02816.41
5.6.270.0080.00914.20
5.6.260.0130.00514.24
5.6.250.0100.00514.38
5.6.240.0100.00914.37
5.6.230.0110.00514.06
5.6.220.0050.02316.40
5.6.210.0060.02916.37
5.6.200.0100.03116.48
5.6.190.0100.03116.49
5.6.180.0060.02116.60
5.6.170.0100.01816.40
5.6.160.0060.02816.64
5.6.150.0050.02116.52
5.6.140.0090.01716.43
5.6.130.0080.01916.55
5.6.120.0060.01716.47
5.6.110.0080.02016.47
5.6.100.0050.02116.47
5.6.90.0050.01816.44
5.6.80.0070.01616.34
5.6.70.0080.01716.13
5.6.60.0040.02116.34
5.6.50.0080.01816.21
5.6.40.0060.01916.28
5.6.30.0060.01816.16
5.6.20.0020.02016.24
5.6.10.0050.01716.22
5.6.00.0060.01816.23
5.5.380.0170.00011.18
5.5.370.0090.00311.38
5.5.360.0050.04515.66
5.5.350.0070.02315.82
5.5.340.0020.03716.02
5.5.330.0070.03815.92
5.5.320.0060.03016.06
5.5.310.0070.02816.06
5.5.300.0050.02216.07
5.5.290.0060.02516.00
5.5.280.0080.02215.85
5.5.270.0040.04815.96
5.5.260.0100.03716.04
5.5.250.0050.02515.87
5.5.240.0050.01915.64
5.5.230.0030.02315.66
5.5.220.0000.02815.65
5.5.210.0030.02315.59
5.5.200.0060.02415.69
5.5.190.0070.02115.67
5.5.180.0060.02215.69
5.5.170.0190.00314.05
5.5.160.0090.04015.66
5.5.150.0050.02015.70
5.5.140.0100.02315.65
5.5.130.0100.01515.55
5.5.120.0080.02015.46
5.5.110.0030.02215.49
5.5.100.0070.01815.67
5.5.90.0070.03815.31
5.5.80.0060.02215.55
5.5.70.0040.02515.54
5.5.60.0070.01815.51
5.5.50.0080.02815.63
5.5.40.0100.03415.59
5.5.30.0060.04415.52
5.5.20.0080.02915.45
5.5.10.0070.03015.55
5.5.00.0000.04715.50
5.4.450.0030.02215.09
5.4.440.0060.02015.20
5.4.430.0040.02615.28
5.4.420.0030.02315.25
5.4.410.0050.03515.26
5.4.400.0000.02615.04
5.4.390.0050.02015.02
5.4.380.0060.02015.05
5.4.370.0070.02114.98
5.4.360.0050.03715.15
5.4.350.0070.02715.06
5.4.340.0050.02214.97
5.4.330.0090.00410.85
5.4.320.0060.02015.15
5.4.310.0070.02115.17
5.4.300.0050.02114.80
5.4.290.0030.02314.90
5.4.280.0080.02014.96
5.4.270.0070.02015.08
5.4.260.0060.02315.02
5.4.250.0070.02015.22
5.4.240.0090.01815.04
5.4.230.0070.02015.13
5.4.220.0020.02614.92
5.4.210.0050.03015.09
5.4.200.0030.04614.97
5.4.190.0120.03314.92
5.4.180.0090.03614.96
5.4.170.0070.04014.87
5.4.160.0090.03215.02
5.4.150.0080.03015.09
5.4.140.0040.03013.73
5.4.130.0060.04113.72
5.4.120.0070.02413.70
5.4.110.0100.02513.76
5.4.100.0060.02913.79
5.4.90.0100.01813.73
5.4.80.0050.03213.68
5.4.70.0080.03713.74
5.4.60.0050.02613.79
5.4.50.0080.03813.76
5.4.40.0070.04113.71
5.4.30.0080.03313.70
5.4.20.0080.03013.57
5.4.10.0040.03513.82
5.4.00.0080.03613.35
5.3.290.0020.02512.77
5.3.280.0040.02112.47
5.3.270.0020.04512.59
5.3.260.0060.03812.66
5.3.250.0060.03612.57
5.3.240.0060.02312.44
5.3.230.0090.02712.59
5.3.220.0050.03312.56
5.3.210.0020.04412.47
5.3.200.0060.02712.39
5.3.190.0070.03612.60
5.3.180.0090.03912.59
5.3.170.0070.02512.58
5.3.160.0060.03812.63
5.3.150.0080.03212.66
5.3.140.0110.01812.62
5.3.130.0090.02812.57
5.3.120.0080.04112.44
5.3.110.0090.03912.40
5.3.100.0050.04012.37
5.3.90.0080.03312.34
5.3.80.0080.03812.26
5.3.70.0040.02912.23
5.3.60.0080.03712.25
5.3.50.0120.02512.26
5.3.40.0060.04012.04
5.3.30.0030.03212.12
5.3.20.0070.03512.01
5.3.10.0050.03312.00
5.3.00.0050.03111.89
5.2.170.0060.03511.35
5.2.160.0040.03111.35
5.2.150.0060.03211.36
5.2.140.0060.03311.35
5.2.130.0050.03011.34
5.2.120.0050.03311.21
5.2.110.0080.03011.32
5.2.100.0080.03011.30
5.2.90.0060.02211.31
5.2.80.0070.02711.27
5.2.70.0050.01811.26
5.2.60.0050.03011.25
5.2.50.0060.03211.18
5.2.40.0040.03611.35
5.2.30.0080.02811.26
5.2.20.0060.02911.28
5.2.10.0070.03011.17
5.2.00.0030.03411.17
5.1.60.0040.01811.17
5.1.50.0050.02111.17
5.1.40.0020.02911.17
5.1.30.0080.02111.17
5.1.20.0070.02611.17
5.1.10.0040.02811.17
5.1.00.0050.02011.17
5.0.50.0040.01811.17
5.0.40.0050.02311.17
5.0.30.0050.03311.17
5.0.20.0040.02211.17
5.0.10.0000.02411.17
5.0.00.0060.02011.17
4.4.90.0020.02011.17
4.4.80.0050.01711.17
4.4.70.0040.01811.17
4.4.60.0020.02011.17
4.4.50.0030.01711.17
4.4.40.0030.02511.17
4.4.30.0030.02011.17
4.4.20.0030.01511.17
4.4.10.0050.01811.17
4.4.00.0020.02511.17
4.3.110.0050.01811.17
4.3.100.0000.01811.17
4.3.90.0050.01711.17
4.3.80.0000.02011.17
4.3.70.0020.02011.17
4.3.60.0030.01811.17
4.3.50.0020.01711.17
4.3.40.0040.02711.17
4.3.30.0020.02011.17
4.3.20.0030.02011.17
4.3.10.0030.01611.17
4.3.00.0020.02211.17

preferences:
54.48 ms | 400 KiB | 5 Q