3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check_num_range(int $num) { if ($num < 0 || $num > 100) trigger_error('Invalid range'); } // Somewhere far from function definition. $num = "100 dogs"; // Somewhere far from $num definition. check_num_range($num); // Trying to check validity, int and range. echo 'You have '.$num. ' now <br />'; // But $num could have any string. // "check_num_range((int)$num)" wouldn't help also.

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.4.140.0150.00917.71
8.4.130.0100.00718.59
8.4.120.0150.00620.41
8.4.110.0150.00617.98
8.4.100.0070.00518.04
8.4.90.0140.00620.63
8.4.80.0120.00718.82
8.4.70.0130.00722.39
8.4.60.0150.00520.62
8.4.50.0090.00619.70
8.4.40.0170.00319.46
8.4.30.0130.00417.61
8.4.20.0060.01317.59
8.4.10.0070.01017.57
8.3.270.0120.00716.70
8.3.260.0130.00716.73
8.3.250.0050.00416.30
8.3.240.0120.01016.32
8.3.230.0100.01016.79
8.3.220.0030.00418.72
8.3.210.0140.00818.47
8.3.200.0040.00516.47
8.3.190.0130.00517.16
8.3.180.0120.00716.82
8.3.170.0000.00716.83
8.3.160.0070.01117.22
8.3.150.0100.00318.71
8.3.140.0030.00617.37
8.3.130.0070.00718.50
8.3.120.0070.00418.84
8.3.110.0100.01020.94
8.3.100.0100.00724.06
8.3.90.0130.00626.77
8.3.80.0000.00917.97
8.3.70.0070.01118.30
8.3.60.0040.01118.68
8.3.50.0140.00822.02
8.3.40.0120.00918.92
8.3.30.0120.00619.01
8.3.20.0080.00020.20
8.3.10.0030.00623.66
8.3.00.0040.00420.89
8.2.290.0070.00516.84
8.2.280.0030.00518.52
8.2.270.0060.00317.17
8.2.260.0030.00616.77
8.2.250.0040.00417.04
8.2.240.0000.00917.37
8.2.230.0080.00022.58
8.2.220.0100.00637.54
8.2.210.0170.00026.77
8.2.200.0050.00516.75
8.2.190.0120.00616.58
8.2.180.0070.01118.67
8.2.170.0070.00722.96
8.2.160.0070.01022.17
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0050.00319.56
8.2.110.0070.00322.28
8.2.100.0100.00317.78
8.2.90.0000.00819.09
8.2.80.0040.00417.97
8.2.70.0030.00717.63
8.2.60.0040.00417.92
8.2.50.0100.00018.07
8.2.40.0050.00319.60
8.2.30.0060.00318.00
8.2.20.0000.00817.73
8.2.10.0080.00018.14
8.2.00.0000.00717.77
8.1.330.0110.00818.64
8.1.320.0110.00816.07
8.1.310.0140.00018.40
8.1.300.0170.00017.98
8.1.290.0050.00530.84
8.1.280.0110.00725.92
8.1.270.0130.00918.79
8.1.260.0070.00026.35
8.1.250.0110.00028.09
8.1.240.0040.00424.02
8.1.230.0110.00019.21
8.1.220.0050.00317.74
8.1.210.0030.00618.77
8.1.200.0090.00317.22
8.1.190.0050.00316.98
8.1.180.0000.00818.10
8.1.170.0030.00618.50
8.1.160.0000.00721.89
8.1.150.0040.00418.82
8.1.140.0070.00017.30
8.1.130.0000.00717.79
8.1.120.0030.00317.37
8.1.110.0000.00717.37
8.1.100.0040.00417.35
8.1.90.0070.00017.44
8.1.80.0000.00717.39
8.1.70.0070.00017.38
8.1.60.0060.00317.55
8.1.50.0060.00317.59
8.1.40.0000.00817.51
8.1.30.0000.00817.67
8.1.20.0030.00617.63
8.1.10.0040.00417.58
8.1.00.0080.00017.41
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0030.00318.40
8.0.270.0070.00016.88
8.0.260.0040.00417.20
8.0.250.0040.00416.87
8.0.240.0070.00016.91
8.0.230.0000.00716.83
8.0.220.0070.00016.88
8.0.210.0070.00016.92
8.0.200.0030.00616.92
8.0.190.0000.00716.96
8.0.180.0050.00316.93
8.0.170.0070.00316.90
8.0.160.0040.00416.89
8.0.150.0050.00216.87
8.0.140.0030.00416.80
8.0.130.0050.00313.31
8.0.120.0030.00516.82
8.0.110.0030.00316.84
8.0.100.0000.00816.86
8.0.90.0080.00016.95
8.0.80.0090.01216.96
8.0.70.0090.00016.77
8.0.60.0040.00416.88
8.0.50.0000.00716.95
8.0.30.0120.00517.01
8.0.20.0110.00817.40
8.0.10.0040.00416.94
8.0.00.0130.00616.99
7.4.330.0050.00015.09
7.4.320.0030.00316.41
7.4.300.0000.00716.58
7.4.290.0080.00016.60
7.4.280.0050.00316.62
7.4.270.0000.00716.66
7.4.260.0000.00816.56
7.4.250.0080.00016.54
7.4.240.0020.00516.53
7.4.230.0070.00016.42
7.4.220.0120.01216.63
7.4.210.0030.01416.49
7.4.200.0020.00516.50
7.4.160.0100.00616.57
7.4.150.0100.00717.40
7.4.140.0080.01017.86
7.4.130.0080.00816.57
7.4.120.0120.00516.55
7.4.110.0130.00616.45
7.4.100.0060.01116.63
7.4.90.0120.00416.60
7.4.80.0060.01119.39
7.4.70.0070.01016.48
7.4.60.0090.00916.51
7.4.50.0030.00616.72
7.4.40.0100.01016.49
7.4.30.0090.01216.67
7.4.00.0090.00615.09
7.3.330.0050.00013.30
7.3.320.0030.00213.25
7.3.310.0070.00016.41
7.3.300.0040.00416.38
7.3.290.0080.01116.38
7.3.280.0070.00916.39
7.3.270.0070.01717.40
7.3.260.0140.00316.29
7.3.250.0100.00716.56
7.3.240.0100.01016.42
7.3.230.0080.01116.66
7.3.210.0140.01116.57
7.3.200.0100.01019.39
7.3.190.0140.00716.48
7.3.180.0150.00016.36
7.3.170.0070.01016.44
7.3.160.0090.00616.48
7.2.330.0060.01216.71
7.2.320.0100.01016.71
7.2.310.0100.00616.75
7.2.300.0130.00316.65
7.2.290.0150.00816.73
7.2.60.0040.00416.70
7.2.00.0030.01219.17
7.1.200.0090.00315.75
7.1.100.0040.00418.03
7.1.70.0000.00717.12
7.1.60.0030.01719.22
7.1.50.0250.00634.86
7.1.00.0030.07722.36
7.0.200.0000.01016.78
7.0.140.0030.03722.09
7.0.100.0100.05019.97
7.0.90.0000.04720.03
7.0.80.0070.03719.85
7.0.70.0100.03719.84
7.0.60.0030.04319.93
7.0.50.0100.03720.26
7.0.40.0070.04020.10
7.0.30.0030.04020.10
7.0.20.0030.03320.18
7.0.10.0030.03320.04
7.0.00.0030.04720.14
5.6.280.0100.06720.86
5.6.250.0030.04720.61
5.6.240.0030.04320.64
5.6.230.0030.04720.63
5.6.220.0070.04020.70
5.6.210.0100.03320.61
5.6.200.0030.05021.08
5.6.190.0070.03320.98
5.6.180.0130.04721.04
5.6.170.0030.04020.96
5.6.160.0030.04020.98
5.6.150.0070.03321.09
5.6.140.0000.04321.01
5.6.130.0100.04321.01
5.6.120.0030.04021.05
5.6.110.0000.04021.08
5.6.100.0030.03320.94
5.6.90.0030.03721.09
5.6.80.0030.03320.56
5.6.70.0100.02720.46
5.6.60.0030.03320.39
5.6.50.0070.06020.46
5.6.40.0100.07320.53
5.6.30.0070.04020.44
5.6.20.0000.04020.32
5.6.10.0070.04320.34
5.6.00.0070.04020.28
5.5.380.0030.04320.40
5.5.370.0030.04320.38
5.5.360.0070.04020.34
5.5.350.0130.02720.47
5.5.340.0130.03320.73
5.5.330.0030.03720.80
5.5.320.0130.03720.91
5.5.310.0100.03720.88
5.5.300.0100.03720.86
5.5.290.0100.03020.80
5.5.280.0070.03720.80
5.5.270.0070.03020.87
5.5.260.0030.03320.82
5.5.250.0100.03020.68
5.5.240.0030.03320.21
5.5.230.0070.03320.14
5.5.220.0070.04720.26
5.5.210.0130.02720.24
5.5.200.0030.07020.11
5.5.190.0070.04720.18
5.5.180.0070.04320.11
5.5.160.0030.08020.24
5.5.150.0030.04720.08
5.5.140.0000.07720.20
5.5.130.0070.04020.15
5.5.120.0070.04320.14
5.5.110.0200.06020.12
5.5.100.0030.03720.16
5.5.90.0070.06720.13
5.5.80.0030.08020.04
5.5.70.0030.07020.02
5.5.60.0070.06020.08
5.5.50.0030.03720.09
5.5.40.0130.04320.03
5.5.30.0170.07320.04
5.5.20.0070.04020.11
5.5.10.0030.04019.96
5.5.00.0130.07320.12
5.4.450.0030.04019.49
5.4.440.0030.04019.23
5.4.430.0070.03019.45
5.4.420.0100.03019.50
5.4.410.0000.03319.15
5.4.400.0100.03019.25
5.4.390.0070.03018.95
5.4.380.0070.02718.94
5.4.370.0000.05318.85
5.4.360.0070.07719.23
5.4.350.0130.06319.04
5.4.340.0070.06719.23
5.4.320.0070.07319.04
5.4.310.0000.04019.09
5.4.300.0070.04019.13
5.4.290.0070.07319.12
5.4.280.0100.07019.03
5.4.270.0030.04319.17
5.4.260.0070.04019.02
5.4.250.0030.05019.17
5.4.240.0100.07719.16
5.4.230.0070.04318.94
5.4.220.0070.03719.11
5.4.210.0100.06718.94
5.4.200.0070.06319.03
5.4.190.0000.03719.02
5.4.180.0070.07319.07
5.4.170.0000.06019.12
5.4.160.0130.06719.19
5.4.150.0000.08019.21
5.4.140.0100.06716.41
5.4.130.0070.04016.40
5.4.120.0070.03016.32
5.4.110.0030.05316.39
5.4.100.0000.04016.32
5.4.90.0070.03316.32
5.4.80.0030.03716.44
5.4.70.0000.05716.35
5.4.60.0000.06716.40
5.4.50.0030.05716.53
5.4.40.0030.03316.42
5.4.30.0070.05716.38
5.4.20.0100.04316.33
5.4.10.0000.04016.51
5.4.00.0170.06015.69
5.3.290.0070.04314.58
5.3.280.0070.03314.65
5.3.270.0070.07314.61
5.3.260.0130.06714.66
5.3.250.0030.07714.72
5.3.240.0070.06714.71
5.3.230.0070.05714.61
5.3.220.0100.06014.69
5.3.210.0030.03314.58
5.3.200.0000.04014.70
5.3.190.0000.04014.57
5.3.180.0070.04714.63
5.3.170.0070.05714.70
5.3.160.0070.06714.54
5.3.150.0030.04014.49
5.3.140.0000.04314.60
5.3.130.0100.07014.61
5.3.120.0000.07314.55
5.3.110.0030.03714.54
5.3.100.0070.03014.01
5.3.90.0030.07713.98
5.3.80.0100.07013.92
5.3.70.0000.04314.17
5.3.60.0070.03014.01
5.3.50.0030.06014.00
5.3.40.0130.07314.04
5.3.30.0070.04713.82
5.3.20.0100.06013.61
5.3.10.0030.05713.78
5.3.00.0030.04313.77
5.2.170.0030.07311.05
5.2.160.0070.05011.00
5.2.150.0000.06011.21
5.2.140.0000.03711.23
5.2.130.0030.05311.00
5.2.120.0000.04010.96
5.2.110.0030.03311.00
5.2.100.0070.03011.21
5.2.90.0100.05711.16
5.2.80.0030.05711.14
5.2.70.0000.03710.97
5.2.60.0070.05011.04
5.2.50.0030.03310.95
5.2.40.0000.03710.85
5.2.30.0030.05010.87
5.2.20.0030.03711.02
5.2.10.0130.04710.89
5.2.00.0100.05310.81
5.1.60.0030.02710.02
5.1.50.0030.05010.07
5.1.40.0000.0579.84
5.1.30.0100.05010.46
5.1.20.0070.02310.43
5.1.10.0000.03710.07
5.1.00.0100.04010.15
5.0.50.0030.0479.84
5.0.40.0030.0309.84
5.0.30.0070.0439.84
5.0.20.0070.0209.84
5.0.10.0030.0309.84
5.0.00.0030.0409.84
4.4.90.0000.0209.84
4.4.80.0000.0179.84
4.4.70.0000.0309.84
4.4.60.0030.0339.84
4.4.50.0030.0339.84
4.4.40.0000.0539.84
4.4.30.0000.0209.84
4.4.20.0030.0179.84
4.4.10.0070.0379.84
4.4.00.0070.0239.84
4.3.110.0000.0209.84
4.3.100.0100.0079.84
4.3.90.0000.0209.84
4.3.80.0070.0539.84
4.3.70.0030.0309.84
4.3.60.0000.0279.84
4.3.50.0000.0339.84
4.3.40.0070.0279.84
4.3.30.0000.0309.84
4.3.20.0000.0179.84
4.3.10.0030.0179.84
4.3.00.0000.0179.84

preferences:
32.95 ms | 403 KiB | 5 Q