3v4l.org

run code in 300+ PHP versions simultaneously
<?php function my_func(int $n) { var_dump($n); } my_func('6'); // => (int) 6 my_func(3.1415); // => (int) 3 my_func(TRUE); // => (int) 1 my_func([]); // => (int) 1 my_func(NULL); // => Fatal error: Uncaught TypeError: Argument 1 passed to my_func() must be of the type integer, null given.

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.60.0060.01016.75
8.3.50.0100.00716.26
8.3.40.0140.00018.76
8.3.30.0150.00018.90
8.3.20.0080.00020.13
8.3.10.0030.00521.78
8.3.00.0030.00519.51
8.2.180.0110.00318.29
8.2.170.0110.00422.96
8.2.160.0100.00320.52
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0050.00321.06
8.2.120.0040.00426.35
8.2.110.0030.00622.13
8.2.100.0110.00017.78
8.2.90.0000.00917.84
8.2.80.0080.00017.97
8.2.70.0080.00517.50
8.2.60.0030.00617.93
8.2.50.0040.00418.10
8.2.40.0040.00420.55
8.2.30.0040.00421.01
8.2.20.0000.00818.06
8.2.10.0000.00718.05
8.2.00.0000.00717.91
8.1.280.0150.00425.92
8.1.270.0050.00322.23
8.1.260.0000.00726.35
8.1.250.0000.00728.09
8.1.240.0030.00622.05
8.1.230.0110.00020.88
8.1.220.0000.00817.74
8.1.210.0030.00618.96
8.1.200.0050.00517.23
8.1.190.0040.00417.13
8.1.180.0030.00518.10
8.1.170.0040.00418.43
8.1.160.0050.00318.87
8.1.150.0050.00218.84
8.1.140.0000.00819.50
8.1.130.0000.00718.77
8.1.120.0000.00717.35
8.1.110.0040.00417.24
8.1.100.0040.00417.30
8.1.90.0000.00717.27
8.1.80.0030.00317.34
8.1.70.0070.00017.33
8.1.60.0060.00317.44
8.1.50.0000.00817.33
8.1.40.0040.00417.39
8.1.30.0000.00817.65
8.1.20.0000.00917.53
8.1.10.0040.00417.46
8.1.00.0050.00517.51
8.0.300.0050.00319.91
8.0.290.0040.00416.63
8.0.280.0030.00318.27
8.0.270.0000.00717.27
8.0.260.0000.00716.82
8.0.250.0000.00717.01
8.0.240.0000.00816.86
8.0.230.0030.00316.97
8.0.220.0050.00216.77
8.0.210.0000.00716.93
8.0.200.0000.00616.98
8.0.190.0080.00016.83
8.0.180.0030.00516.84
8.0.170.0030.00316.91
8.0.160.0060.00316.88
8.0.150.0050.00216.84
8.0.140.0000.00716.83
8.0.130.0000.00513.37
8.0.120.0000.00716.86
8.0.110.0040.00416.94
8.0.100.0040.00416.84
8.0.90.0040.00416.94
8.0.80.0160.00016.87
8.0.70.0040.00416.80
8.0.60.0000.00716.92
8.0.50.0070.00016.92
8.0.30.0140.00316.96
8.0.20.0080.01017.40
8.0.10.0040.00317.05
8.0.00.0060.01216.50
7.4.330.0000.00515.55
7.4.320.0030.00316.45
7.4.300.0000.00616.59
7.4.290.0030.00616.36
7.4.280.0000.00916.48
7.4.270.0040.00416.46
7.4.260.0030.00316.45
7.4.250.0000.00916.51
7.4.240.0000.00716.55
7.4.230.0030.00316.55
7.4.220.0140.01116.54
7.4.210.0050.01116.59
7.4.200.0000.00716.62
7.4.160.0140.00416.44
7.4.150.0130.00717.40
7.4.140.0090.01017.86
7.4.130.0070.01116.44
7.4.120.0070.01216.38
7.4.110.0100.00716.39
7.4.100.0120.00916.42
7.4.90.0090.00916.30
7.4.80.0070.01119.39
7.4.70.0180.00316.49
7.4.60.0040.01216.28
7.4.50.0100.00516.46
7.4.40.0140.00316.41
7.4.30.0090.01216.25
7.4.00.0070.00714.99
7.3.330.0030.00313.25
7.3.320.0050.00013.27
7.3.310.0000.00816.38
7.3.300.0000.00716.27
7.3.290.0000.00716.17
7.3.280.0080.00916.28
7.3.270.0110.00717.40
7.3.260.0050.01116.41
7.3.250.0060.01216.38
7.3.240.0120.00516.30
7.3.230.0120.01216.60
7.3.210.0080.00816.58
7.3.200.0030.01316.45
7.3.190.0080.01616.34
7.3.180.0040.01116.40
7.3.170.0100.01016.50
7.3.160.0120.00316.36
7.3.120.0090.00614.90
7.3.110.0030.01014.85
7.3.100.0060.00614.59
7.3.90.0040.01214.58
7.3.80.0080.00314.89
7.3.70.0070.00714.83
7.3.60.0030.01014.88
7.3.50.0060.00314.61
7.3.40.0060.00914.49
7.3.30.0040.01114.48
7.3.20.0030.01016.30
7.3.10.0060.00616.56
7.3.00.0060.00716.45
7.2.330.0160.00716.61
7.2.320.0120.00416.69
7.2.310.0070.01016.35
7.2.300.0100.01016.29
7.2.290.0130.00316.39
7.2.240.0070.01015.07
7.2.230.0110.00414.80
7.2.220.0000.01014.73
7.2.210.0040.01114.83
7.2.200.0070.00714.82
7.2.190.0090.00914.71
7.2.180.0070.01114.74
7.2.170.0030.01014.88
7.2.160.0000.01714.91
7.2.150.0030.01016.56
7.2.140.0080.00816.64
7.2.130.0090.00716.69
7.2.120.0050.00916.63
7.2.110.0070.00916.66
7.2.100.0060.00816.63
7.2.90.0110.00916.69
7.2.80.0070.00816.69
7.2.70.0070.00716.86
7.2.60.0100.00816.76
7.2.50.0060.00716.72
7.2.40.0060.00716.56
7.2.30.0090.00516.67
7.2.20.0070.00816.73
7.2.10.0120.00516.77
7.2.00.0080.00717.24
7.1.330.0080.00815.58
7.1.320.0070.01015.73
7.1.310.0030.00716.02
7.1.300.0000.01415.68
7.1.290.0100.00715.46
7.1.280.0030.01215.83
7.1.270.0080.00615.72
7.1.260.0060.00615.85
7.1.250.0070.00715.75
7.1.240.0030.00715.70
7.1.230.0220.00315.54
7.1.220.0140.00315.90
7.1.210.0130.00315.62
7.1.200.0060.00915.68
7.1.190.0060.00615.91
7.1.180.0060.00615.75
7.1.170.0070.00715.83
7.1.160.0050.00815.73
7.1.150.0000.01415.70
7.1.140.0000.01515.86
7.1.130.0000.01415.76
7.1.120.0040.00715.71
7.1.110.0090.00715.60
7.1.100.0050.01116.78
7.1.90.0240.00815.80
7.1.80.0100.00415.91
7.1.70.0060.00916.50
7.1.60.0120.00825.37
7.1.50.0080.01025.18
7.1.40.0100.00824.93
7.1.30.0080.01225.19
7.1.20.0110.00924.97
7.1.10.0090.00516.27
7.1.00.0060.00716.27
7.0.330.0060.00615.33
7.0.320.0070.00415.39
7.0.310.0100.00515.54
7.0.300.0030.01215.25
7.0.290.0040.01115.58
7.0.280.0040.00815.13
7.0.270.0100.00315.30
7.0.260.0080.00315.36
7.0.250.0030.00715.31
7.0.240.0090.00615.50
7.0.230.0210.00615.21
7.0.220.0110.00515.51
7.0.210.0100.00615.46
7.0.200.0060.00815.97
7.0.190.0050.00715.84
7.0.180.0080.00415.70
7.0.170.0020.01015.72
7.0.160.0060.00615.83
7.0.150.0090.00315.74
7.0.140.0070.00615.85
7.0.130.0050.00515.98
7.0.120.0110.00315.93
7.0.110.0030.00915.86
7.0.100.0040.00615.76
7.0.90.0070.00615.88
7.0.80.0020.01115.79
7.0.70.0050.00615.71
7.0.60.0050.00815.72
7.0.50.0030.01015.75
7.0.40.0080.00614.84
7.0.30.0040.00714.98
7.0.20.0050.00715.00
7.0.10.0040.00614.93
7.0.00.0050.00814.95
5.6.380.0100.00614.07

preferences:
43.13 ms | 401 KiB | 5 Q