3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(phpversion()); function teste ($arg) { $var = function() use ($arg) { if(filter_var($arg, FILTER_VALIDATE_INT)){ throw new Exception("It\'s not a INT\n"); } if($arg % 2 == 0) return 'PAR'; return 'IMPAR'; }; return $var(); } echo teste(27); echo teste(18); //echo teste('a');

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)
7.4.00.0080.01114.99
7.3.120.0050.01314.93
7.3.110.0060.01014.98
7.3.100.0020.01214.93
7.3.90.0130.00014.92
7.3.80.0060.00914.84
7.3.70.0050.00714.89
7.3.60.0080.00514.93
7.3.50.0120.00214.87
7.3.40.0080.00714.84
7.3.30.0050.00714.72
7.3.20.0070.00716.47
7.3.10.0030.01016.54
7.3.00.0050.00716.84
7.2.250.0060.01315.10
7.2.240.0110.00514.66
7.2.230.0070.00815.13
7.2.220.0070.00714.86
7.2.210.0060.00714.98
7.2.200.0050.01114.97
7.2.190.0070.00514.87
7.2.180.0050.01014.90
7.2.170.0100.00814.74
7.2.160.0060.00914.96
7.2.150.0110.00416.89
7.2.140.0090.00616.88
7.2.130.0090.00616.61
7.2.120.0070.01016.87
7.2.110.0080.00616.89
7.2.100.0070.00416.91
7.2.90.0090.00916.92
7.2.80.0160.00016.91
7.2.70.0040.01116.89
7.2.60.0030.00816.69
7.2.50.0100.01016.99
7.2.40.0030.01017.01
7.2.30.0060.00917.01
7.2.20.0030.01416.84
7.2.10.0130.00316.71
7.2.00.0070.01016.78
7.1.330.0030.01115.73
7.1.320.0030.00915.80
7.1.310.0090.00615.76
7.1.300.0080.00515.77
7.1.290.0100.00515.68
7.1.280.0030.00715.73
7.1.270.0100.00315.61
7.1.260.0050.00915.87
7.1.250.0080.00315.88
7.1.200.0080.00615.74
7.1.100.0030.00918.28
7.1.70.0070.00317.17
7.1.60.0070.01719.32
7.1.50.0060.01617.12
7.1.00.0030.07722.43
7.0.200.0030.00516.77
7.0.140.0030.07022.12
7.0.60.0070.08719.92
7.0.50.0130.05717.84
7.0.40.0030.09020.04
7.0.30.0470.05020.26
7.0.20.0200.08720.15
7.0.10.0170.08020.09
7.0.00.0030.05720.07
5.6.280.0070.07021.10
5.6.210.0130.04720.72
5.6.200.0100.04018.17
5.6.190.0100.04020.51
5.6.180.0170.05320.77
5.6.170.0370.06020.44
5.6.160.0130.06020.48
5.6.150.0130.04718.18
5.6.140.0270.04718.18
5.6.130.0030.05318.18
5.6.120.0000.08720.94
5.6.110.0130.07720.99
5.6.100.0030.07721.04
5.6.90.0070.05320.97
5.6.80.0030.04020.38
5.5.350.0230.07320.33
5.5.340.0100.07717.99
5.5.330.0030.09020.21
5.5.320.0270.04020.25
5.5.310.0330.08020.27
5.5.300.0070.08318.07
5.5.290.0100.07718.07
5.5.280.0070.08320.88
5.5.270.0070.04720.86
5.5.260.0000.04720.88
5.5.250.0100.07720.68
5.5.240.0300.06720.36
5.4.450.0200.05019.20
5.4.440.0200.05719.55
5.4.430.0170.05019.16
5.4.420.0700.00019.38
5.4.410.0670.00019.29
5.4.400.0700.00019.39
5.4.390.0730.00019.12
5.4.380.0670.00019.07
5.4.370.0630.00019.11
5.4.360.0630.00019.05
5.4.350.0670.00019.11
5.4.340.0110.03212.02
5.4.320.0060.04012.51
5.4.310.0060.03712.50
5.4.300.0060.03512.50
5.4.290.0060.03712.51
5.4.280.0070.03312.41
5.4.270.0060.03612.40
5.4.260.0050.03812.40
5.4.250.0060.03812.40
5.4.240.0090.03412.41
5.4.230.0080.03912.39
5.4.220.0050.03812.40
5.4.210.0050.03712.39
5.4.200.0070.03912.40
5.4.190.0070.03512.39
5.4.180.0040.03812.39
5.4.170.0060.03712.39
5.4.160.0080.03512.39
5.4.150.0110.04512.39
5.4.140.0040.03912.07
5.4.130.0080.03312.06
5.4.120.0070.03612.02
5.4.110.0070.04212.02
5.4.100.0070.03812.01
5.4.90.0030.04012.02
5.4.80.0080.03512.02
5.4.70.0050.03912.02
5.4.60.0060.03612.01
5.4.50.0040.03612.01
5.4.40.0060.03412.00
5.4.30.0040.03812.00
5.4.20.0060.03512.00
5.4.10.0080.03312.00
5.4.00.0090.03411.49
5.3.290.0040.04312.80
5.3.280.0070.03712.71
5.3.270.0060.03912.73
5.3.260.0060.03812.72
5.3.250.0070.03712.72
5.3.240.0060.04412.72
5.3.230.0070.04012.71
5.3.220.0060.03612.68
5.3.210.0080.03912.68
5.3.200.0070.03512.68
5.3.190.0090.04812.68
5.3.180.0070.04612.68
5.3.170.0090.03512.67
5.3.160.0090.03612.68
5.3.150.0040.04112.68
5.3.140.0060.03712.66
5.3.130.0080.03712.66
5.3.120.0100.03812.65
5.3.110.0060.03912.66
5.3.100.0020.04112.13
5.3.90.0050.04112.11
5.3.80.0090.03512.11
5.3.70.0120.03012.11
5.3.60.0070.03512.09
5.3.50.0080.03812.04
5.3.40.0050.03712.04
5.3.30.0060.03512.00
5.3.20.0060.04211.78
5.3.10.0090.03511.75
5.3.00.0060.03611.73
5.2.170.0030.0329.21
5.2.160.0050.0289.21
5.2.150.0040.0319.21
5.2.140.0040.0349.21
5.2.130.0050.0289.18
5.2.120.0040.0299.18
5.2.110.0060.0299.18
5.2.100.0040.0329.18
5.2.90.0030.0329.18
5.2.80.0010.0339.17
5.2.70.0030.0329.17
5.2.60.0060.0299.13
5.2.50.0040.0309.09
5.2.40.0050.0299.07
5.2.30.0040.0309.05
5.2.20.0030.0309.04
5.2.10.0020.0308.95
5.2.00.0050.0288.81
5.1.60.0050.0228.09
5.1.50.0060.0238.09
5.1.40.0060.0238.07
5.1.30.0050.0308.42
5.1.20.0060.0288.43
5.1.10.0070.0268.16
5.1.00.0040.0258.16
5.0.50.0040.0256.64
5.0.40.0030.0206.50
5.0.30.0060.0326.31
5.0.20.0050.0176.28
5.0.10.0020.0216.26
5.0.00.0030.0376.25
4.4.90.0040.0184.78
4.4.80.0020.0164.76
4.4.70.0030.0154.76
4.4.60.0040.0144.75
4.4.50.0040.0144.77
4.4.40.0020.0264.71
4.4.30.0030.0164.76
4.4.20.0030.0164.85
4.4.10.0040.0154.85
4.4.00.0010.0264.76
4.3.110.0030.0154.67
4.3.100.0030.0144.66
4.3.90.0010.0164.64
4.3.80.0020.0254.59
4.3.70.0040.0144.63
4.3.60.0040.0144.63
4.3.50.0040.0154.63
4.3.40.0010.0264.54
4.3.30.0040.0163.30
4.3.20.0080.0163.27
4.3.10.0020.0173.24
4.3.00.0000.0237.21

preferences:
31.46 ms | 400 KiB | 5 Q