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.2.80.0070.00716.40
7.2.60.0070.00716.80
7.2.00.0000.01119.42
7.1.200.0090.00315.95
7.1.100.0080.00317.94
7.1.70.0000.00816.92
7.1.60.0100.01319.32
7.1.50.0140.00716.99
7.1.00.0100.07022.37
7.0.200.0060.00316.84
7.0.140.0030.07022.11
7.0.60.0130.07319.93
7.0.50.0200.06717.72
7.0.40.0000.05020.26
7.0.30.0570.06320.23
7.0.20.0230.07020.24
7.0.10.0370.06720.09
7.0.00.0030.09020.05
5.6.280.0070.06721.00
5.6.210.0130.07320.75
5.6.200.0100.05018.25
5.6.190.0070.05020.63
5.6.180.1170.04720.68
5.6.170.0300.07720.55
5.6.160.0200.04720.45
5.6.150.0070.07318.14
5.6.140.0030.06318.21
5.6.130.0100.03318.28
5.6.120.0100.08021.13
5.6.110.0070.08720.97
5.6.100.0070.06721.14
5.6.90.0000.04320.97
5.6.80.0100.07720.52
5.6.70.4230.04320.38
5.5.350.0230.07020.40
5.5.340.0030.08718.10
5.5.330.0000.05720.41
5.5.320.0270.07320.20
5.5.310.0200.08020.30
5.5.300.0030.04318.08
5.5.290.0100.07718.08
5.5.280.0070.07720.77
5.5.270.0100.03720.87
5.5.260.0100.08020.77
5.5.250.0100.07020.79
5.5.240.0130.07020.16
5.4.450.0030.03319.65
5.4.440.0570.06019.55
5.4.430.0670.04319.56
5.4.420.0700.00019.56
5.4.410.0700.00019.11
5.4.400.0670.00019.08
5.4.390.0630.00019.06
5.4.380.0630.00019.08
5.4.370.0670.00019.11
5.4.360.0600.00019.05
5.4.350.0670.00019.07
5.4.340.0070.03612.02
5.4.320.0070.03612.51
5.4.310.0070.03812.50
5.4.300.0060.03912.51
5.4.290.0040.04012.51
5.4.280.0080.03612.40
5.4.270.0090.03612.40
5.4.260.0070.03712.40
5.4.250.0040.04012.41
5.4.240.0030.04212.41
5.4.230.0080.04012.39
5.4.220.0110.03612.40
5.4.210.0060.04612.40
5.4.200.0070.04212.39
5.4.190.0070.03812.39
5.4.180.0080.04112.39
5.4.170.0070.03712.40
5.4.160.0080.03712.39
5.4.150.0060.03712.39
5.4.140.0090.04312.07
5.4.130.0090.04312.07
5.4.120.0080.03412.02
5.4.110.0050.03712.02
5.4.100.0060.04312.02
5.4.90.0100.03812.02
5.4.80.0070.03712.01
5.4.70.0040.04112.01
5.4.60.0050.03612.01
5.4.50.0020.04012.01
5.4.40.0080.03712.00
5.4.30.0060.03912.00
5.4.20.0080.03312.00
5.4.10.0060.03612.00
5.4.00.0080.03411.49
5.3.290.0050.04612.80
5.3.280.0060.03712.71
5.3.270.0080.03712.72
5.3.260.0080.03712.72
5.3.250.0060.03612.72
5.3.240.0050.03812.72
5.3.230.0080.03612.71
5.3.220.0070.03512.68
5.3.210.0050.04012.68
5.3.200.0050.03812.68
5.3.190.0090.04612.68
5.3.180.0040.04212.68
5.3.170.0090.03612.67
5.3.160.0050.03812.67
5.3.150.0050.04412.68
5.3.140.0030.04212.66
5.3.130.0050.04412.66
5.3.120.0050.04012.66
5.3.110.0030.04412.66
5.3.100.0060.03712.13
5.3.90.0080.04012.11
5.3.80.0050.03912.11
5.3.70.0040.03812.11
5.3.60.0080.03712.09
5.3.50.0080.03812.04
5.3.40.0070.05512.04
5.3.30.0060.03511.99
5.3.20.0050.03511.78
5.3.10.0060.03511.74
5.3.00.0080.04311.73
5.2.170.0040.0329.21
5.2.160.0050.0319.21
5.2.150.0040.0319.21
5.2.140.0120.0249.21
5.2.130.0110.0289.17
5.2.120.0060.0299.18
5.2.110.0060.0309.18
5.2.100.0070.0279.18
5.2.90.0050.0289.17
5.2.80.0050.0329.17
5.2.70.0040.0319.17
5.2.60.0040.0319.13
5.2.50.0030.0319.10
5.2.40.0100.0259.07
5.2.30.0040.0329.05
5.2.20.0050.0309.04
5.2.10.0050.0278.95
5.2.00.0060.0278.80
5.1.60.0020.0308.08
5.1.50.0050.0238.08
5.1.40.0070.0228.07
5.1.30.0040.0308.41
5.1.20.0060.0268.44
5.1.10.0020.0298.16
5.1.00.0040.0258.16
5.0.50.0050.0206.64
5.0.40.0050.0186.50
5.0.30.0040.0306.31
5.0.20.0040.0206.28
5.0.10.0060.0246.26
5.0.00.0030.0336.25
4.4.90.0030.0154.78
4.4.80.0020.0174.75
4.4.70.0040.0174.76
4.4.60.0020.0174.75
4.4.50.0020.0164.77
4.4.40.0030.0264.71
4.4.30.0080.0144.76
4.4.20.0050.0144.84
4.4.10.0020.0184.85
4.4.00.0040.0294.76
4.3.110.0030.0204.66
4.3.100.0050.0134.66
4.3.90.0040.0144.64
4.3.80.0050.0234.59
4.3.70.0030.0154.63
4.3.60.0050.0134.63
4.3.50.0040.0144.62
4.3.40.0020.0254.54
4.3.30.0020.0163.30
4.3.20.0020.0203.28
4.3.10.0030.0183.24
4.3.00.0200.03012.63

preferences:
32.71 ms | 400 KiB | 5 Q