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('a'); echo teste(27); echo teste(18);

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.0060.00914.75
7.3.120.0040.01114.69
7.3.110.0080.00415.07
7.3.100.0160.00014.79
7.3.90.0070.00714.89
7.3.80.0040.00714.95
7.3.70.0100.00314.90
7.3.60.0000.01614.84
7.3.50.0060.00314.72
7.3.40.0030.01014.88
7.3.30.0070.00414.85
7.3.20.0040.01216.72
7.3.10.0040.00816.55
7.3.00.0080.00316.76
7.2.250.0100.01014.83
7.2.240.0040.01515.13
7.2.230.0090.00015.11
7.2.220.0030.01014.94
7.2.210.0080.00514.95
7.2.200.0120.00315.07
7.2.190.0070.01014.75
7.2.180.0000.01215.07
7.2.170.0030.01015.07
7.2.130.0100.00716.76
7.2.120.0080.00016.82
7.2.110.0040.00816.88
7.2.100.0070.00716.89
7.2.90.0110.00316.76
7.2.80.0030.01716.86
7.2.70.0000.00816.86
7.2.60.0020.01216.82
7.2.50.0030.00517.02
7.2.40.0100.00316.63
7.2.30.0030.00616.79
7.2.20.0030.00916.65
7.2.10.0100.00016.94
7.2.00.0000.01318.04
7.1.330.0090.00615.54
7.1.320.0070.00315.81
7.1.310.0070.00715.75
7.1.300.0040.01115.58
7.1.290.0120.00015.66
7.1.280.0090.00015.80
7.1.270.0060.00315.68
7.1.260.0080.00415.90
7.1.250.0060.00315.73
7.1.200.0080.00415.51
7.1.100.0110.00317.82
7.1.70.0000.00717.24
7.1.60.0100.01619.32
7.1.50.0030.01317.05
7.1.00.0000.08022.36
7.0.200.0030.00316.70
7.0.140.0030.07321.98
7.0.60.0100.06320.00
7.0.50.0100.08317.95
7.0.40.0100.04019.96
7.0.30.0330.04320.07
7.0.20.0370.07720.23
7.0.10.0030.07020.07
7.0.00.0070.09320.33
5.6.280.0000.07721.08
5.6.210.0070.05720.66
5.6.200.0030.04018.25
5.6.190.0230.07020.64
5.6.180.0270.06720.55
5.6.170.0470.06320.62
5.6.160.0030.08020.46
5.6.150.0000.05718.29
5.6.140.0200.06718.14
5.6.130.0130.07718.20
5.6.120.0070.08720.81
5.6.110.0100.07020.95
5.6.100.0130.07721.04
5.6.90.0100.07720.96
5.6.80.0030.04020.49
5.5.350.0130.07720.42
5.5.340.0200.06317.95
5.5.330.0130.03320.40
5.5.320.0470.06720.28
5.5.310.0470.06320.29
5.5.300.0070.05018.02
5.5.290.0070.08017.96
5.5.280.0070.07320.90
5.5.270.0070.07720.97
5.5.260.0030.04020.73
5.5.250.0170.07020.70
5.5.240.0130.05720.26
5.4.450.1070.05719.62
5.4.440.1000.05319.63
5.4.430.0100.08019.29
5.4.420.0830.00019.41
5.4.410.0670.00019.21
5.4.400.0630.00018.92
5.4.390.0600.00019.21
5.4.380.0630.00019.13
5.4.370.0630.00019.21
5.4.360.0700.00018.99
5.4.350.0630.00019.16
5.4.340.0070.03812.02
5.4.320.0080.04212.51
5.4.310.0060.03812.50
5.4.300.0070.03612.51
5.4.290.0060.03812.50
5.4.280.0070.03412.40
5.4.270.0070.03412.40
5.4.260.0050.03712.40
5.4.250.0080.03412.40
5.4.240.0050.03812.40
5.4.230.0160.05312.39
5.4.220.0020.04012.39
5.4.210.0060.04312.40
5.4.200.0060.03912.39
5.4.190.0050.04012.39
5.4.180.0090.03312.39
5.4.170.0060.03612.40
5.4.160.0090.03312.40
5.4.150.0070.03512.39
5.4.140.0050.03812.07
5.4.130.0050.03612.07
5.4.120.0070.03512.02
5.4.110.0040.03812.01
5.4.100.0100.03312.02
5.4.90.0060.03612.02
5.4.80.0050.04212.02
5.4.70.0050.03612.01
5.4.60.0060.03412.02
5.4.50.0080.03412.01
5.4.40.0050.03512.00
5.4.30.0070.03612.00
5.4.20.0050.03912.00
5.4.10.0040.03612.00
5.4.00.0060.03511.49
5.3.290.0070.03912.80
5.3.280.0020.04212.71
5.3.270.0090.03712.72
5.3.260.0080.03712.72
5.3.250.0040.03912.72
5.3.240.0050.04212.72
5.3.230.0050.04312.71
5.3.220.0100.03412.68
5.3.210.0070.04112.68
5.3.200.0070.04112.68
5.3.190.0040.04112.68
5.3.180.0070.03612.67
5.3.170.0080.03712.67
5.3.160.0070.03612.67
5.3.150.0060.03612.67
5.3.140.0110.04212.66
5.3.130.0040.04312.65
5.3.120.0080.03612.66
5.3.110.0100.03412.66
5.3.100.0080.03912.13
5.3.90.0060.03712.11
5.3.80.0060.03612.10
5.3.70.0070.03512.11
5.3.60.0030.03912.09
5.3.50.0100.03312.03
5.3.40.0080.03612.03
5.3.30.0040.03611.98
5.3.20.0110.03111.77
5.3.10.0080.03211.74
5.3.00.0050.03611.73
5.2.170.0050.0299.22
5.2.160.0040.0309.22
5.2.150.0070.0309.22
5.2.140.0090.0289.21
5.2.130.0050.0299.17
5.2.120.0050.0359.17
5.2.110.0040.0319.18
5.2.100.0040.0299.18
5.2.90.0080.0269.18
5.2.80.0030.0349.18
5.2.70.0050.0299.17
5.2.60.0070.0289.13
5.2.50.0040.0319.09
5.2.40.0050.0299.07
5.2.30.0050.0329.05
5.2.20.0050.0289.04
5.2.10.0060.0278.95
5.2.00.0010.0348.81
5.1.60.0090.0198.08
5.1.50.0050.0248.08
5.1.40.0070.0228.07
5.1.30.0040.0268.42
5.1.20.0040.0278.44
5.1.10.0050.0258.16
5.1.00.0060.0248.16
5.0.50.0050.0196.64
5.0.40.0020.0206.50
5.0.30.0030.0316.31
5.0.20.0040.0196.28
5.0.10.0030.0216.27
5.0.00.0050.0306.25
4.4.90.0030.0164.78
4.4.80.0030.0154.75
4.4.70.0020.0164.75
4.4.60.0030.0154.75
4.4.50.0020.0164.77
4.4.40.0010.0264.71
4.4.30.0050.0134.76
4.4.20.0030.0164.84
4.4.10.0040.0144.85
4.4.00.0010.0264.76
4.3.110.0020.0164.67
4.3.100.0010.0164.66
4.3.90.0000.0174.63
4.3.80.0030.0244.59
4.3.70.0030.0154.63
4.3.60.0030.0144.62
4.3.50.0020.0164.62
4.3.40.0030.0234.54
4.3.30.0030.0153.30
4.3.20.0010.0173.27
4.3.10.0010.0163.24
4.3.00.0000.0237.07

preferences:
38.45 ms | 400 KiB | 5 Q