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(new \stdClass()); // => Fatal error: Uncaught TypeError: Argument 1 passed to my_func() must be of the type integer, array given my_func([]); // => Fatal error: Uncaught TypeError: Argument 1 passed to my_func() must be of the type integer, array given my_func(NULL); // => ... 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.0090.00916.63
8.3.50.0110.00716.34
8.3.40.0070.00719.02
8.3.30.0140.00018.71
8.3.20.0070.00020.17
8.3.10.0000.00821.72
8.3.00.0080.00019.18
8.2.180.0140.00018.41
8.2.170.0060.00922.96
8.2.160.0100.00320.38
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0100.00020.91
8.2.120.0080.00026.35
8.2.110.0000.00820.43
8.2.100.0040.00819.43
8.2.90.0000.00819.09
8.2.80.0000.00817.97
8.2.70.0080.00317.50
8.2.60.0040.00418.04
8.2.50.0040.00418.10
8.2.40.0050.00320.50
8.2.30.0000.00820.84
8.2.20.0080.00017.88
8.2.10.0000.00718.04
8.2.00.0000.00717.97
8.1.280.0060.01325.92
8.1.270.0050.00322.06
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0030.00717.23
8.1.230.0110.00019.10
8.1.220.0080.00017.74
8.1.210.0000.00918.77
8.1.200.0060.00317.23
8.1.190.0060.00319.01
8.1.180.0030.00518.10
8.1.170.0000.00818.57
8.1.160.0040.00418.91
8.1.150.0050.00318.71
8.1.140.0000.00819.37
8.1.130.0040.00418.76
8.1.120.0050.00217.23
8.1.110.0040.00417.31
8.1.100.0000.00717.35
8.1.90.0040.00417.24
8.1.80.0000.00717.33
8.1.70.0040.00417.36
8.1.60.0100.00017.48
8.1.50.0040.00417.36
8.1.40.0030.00517.34
8.1.30.0060.00317.51
8.1.20.0000.00717.44
8.1.10.0040.00417.39
8.1.00.0050.00317.45
8.0.300.0040.00420.05
8.0.290.0060.00316.63
8.0.280.0030.00518.29
8.0.270.0000.00717.18
8.0.260.0060.00016.82
8.0.250.0000.00716.83
8.0.240.0040.00416.95
8.0.230.0030.00316.91
8.0.220.0070.00016.93
8.0.210.0050.00316.86
8.0.200.0050.00316.95
8.0.190.0050.00316.82
8.0.180.0040.00416.95
8.0.170.0000.00716.91
8.0.160.0040.00416.99
8.0.150.0000.00816.77
8.0.140.0000.00716.88
8.0.130.0000.00613.31
8.0.120.0050.00316.81
8.0.110.0030.00316.92
8.0.100.0040.00416.89
8.0.90.0000.00716.77
8.0.80.0000.01616.88
8.0.70.0000.00716.87
8.0.60.0040.00416.76
8.0.50.0040.00416.91
8.0.30.0130.00617.03
8.0.20.0120.01317.40
8.0.10.0000.00716.83
8.0.00.0070.01116.62
7.4.330.0000.00515.55
7.4.320.0030.00616.48
7.4.300.0000.00616.41
7.4.290.0040.00416.34
7.4.280.0030.00616.34
7.4.270.0040.00416.43
7.4.260.0000.00716.32
7.4.250.0040.00416.48
7.4.240.0050.00216.50
7.4.230.0000.00716.56
7.4.220.0070.01116.61
7.4.210.0090.00816.40
7.4.200.0000.00716.64
7.4.160.0110.00916.44
7.4.150.0110.00717.40
7.4.140.0140.00717.86
7.4.130.0030.01416.51
7.4.120.0100.01216.60
7.4.110.0070.01016.50
7.4.100.0130.00716.54
7.4.90.0030.01816.32
7.4.80.0090.01519.39
7.4.70.0120.00916.46
7.4.60.0070.01016.36
7.4.50.0100.00616.41
7.4.40.0120.00616.58
7.4.30.0070.01416.47
7.4.10.0030.01014.66
7.4.00.0080.01014.96
7.3.330.0000.00513.31
7.3.320.0000.00513.29
7.3.310.0070.00016.36
7.3.300.0000.00716.16
7.3.290.0070.00016.13
7.3.280.0090.00716.27
7.3.270.0110.00717.40
7.3.260.0090.00816.38
7.3.250.0110.00816.38
7.3.240.0100.00816.33
7.3.230.0110.00616.50
7.3.210.0110.00716.31
7.3.200.0040.01516.42
7.3.190.0130.00716.44
7.3.180.0030.01316.48
7.3.170.0060.01016.18
7.3.160.0040.01116.36
7.3.130.0070.01314.90
7.3.120.0070.00914.76
7.3.110.0090.00714.71
7.3.100.0060.00914.90
7.3.90.0080.00514.73
7.3.80.0050.01014.74
7.3.70.0080.00514.76
7.3.60.0030.00914.75
7.3.50.0050.00714.55
7.3.40.0050.00714.86
7.3.30.0030.01014.74
7.3.20.0050.00616.58
7.3.10.0100.00516.56
7.3.00.0100.00316.50
7.2.330.0090.00916.54
7.2.320.0100.00716.52
7.2.310.0110.00616.61
7.2.300.0150.00316.52
7.2.290.0100.00616.69
7.2.260.0030.01414.97
7.2.250.0120.00714.97
7.2.240.0050.01214.91
7.2.230.0080.00815.05
7.2.220.0050.00714.79
7.2.210.0050.00814.99
7.2.200.0020.00814.69
7.2.190.0080.00514.95
7.2.180.0030.01214.94
7.2.170.0050.00714.91
7.2.160.0000.00915.02
7.2.150.0080.00416.82
7.2.140.0130.00016.73
7.2.130.0000.01216.74
7.2.120.0060.00916.71
7.2.110.0070.01016.81
7.2.100.0060.00616.87
7.2.90.0070.00316.54
7.2.80.0080.00516.66
7.2.70.0060.00316.88
7.2.60.0060.00516.71
7.2.50.0100.00616.95
7.2.40.0030.01516.70
7.2.30.0040.01116.80
7.2.20.0090.00616.70
7.2.10.0050.00516.47
7.2.00.0060.00518.07
7.1.330.0080.00815.87
7.1.320.0050.00515.64
7.1.310.0080.00515.87
7.1.300.0030.00915.83
7.1.290.0050.01215.66
7.1.280.0030.01015.73
7.1.270.0020.01315.78
7.1.260.0080.00615.81
7.1.250.0030.00515.92
7.1.240.0130.00015.78
7.1.230.0060.00615.71
7.1.220.0000.01015.77
7.1.210.0060.01015.85
7.1.200.0090.00215.62
7.1.190.0040.00815.51
7.1.180.0080.00415.48
7.1.170.0030.01015.72
7.1.160.0000.01815.88
7.1.150.0100.00015.62
7.1.140.0070.00715.61
7.1.130.0030.00715.59
7.1.120.0040.00815.48
7.1.110.0060.00615.54
7.1.100.0080.00616.79
7.1.90.0070.00315.56
7.1.80.0120.00315.42
7.1.70.0060.00616.47
7.1.60.0100.01025.42
7.1.50.0080.01225.28
7.1.40.0120.00925.01
7.1.30.0080.01225.08
7.1.20.0130.00825.10
7.1.10.0040.00916.02
7.1.00.0060.00616.06
7.0.330.0030.01315.31
7.0.320.0100.00015.28
7.0.310.0120.00015.21
7.0.300.0040.00715.39
7.0.290.0000.01515.33
7.0.280.0040.00815.48
7.0.270.0030.00715.07
7.0.260.0000.00915.35
7.0.250.0040.00715.23
7.0.240.0030.00915.58
7.0.230.0070.00415.18
7.0.220.0060.00615.47
7.0.210.0040.01115.45
7.0.200.0050.00915.85
7.0.190.0060.00415.93
7.0.180.0050.00715.82
7.0.170.0030.00915.78
7.0.160.0030.01015.90
7.0.150.0030.00815.69
7.0.140.0040.00615.81
7.0.130.0030.00915.87
7.0.120.0030.01015.84
7.0.110.0090.00316.02
7.0.100.0080.00415.99
7.0.90.0030.00915.80
7.0.80.0040.00716.07
7.0.70.0050.00815.81
7.0.60.0030.00915.86
7.0.50.0060.00615.78
7.0.40.0030.00714.88
7.0.30.0060.00815.07
7.0.20.0030.01214.93
7.0.10.0070.00614.84
7.0.00.0040.00714.73
5.6.400.0050.00814.51
5.6.390.0040.01014.05
5.6.380.0040.00814.29
5.6.370.0100.00614.06
5.6.360.0000.01514.31
5.6.350.0000.01714.20
5.6.340.0080.00414.06
5.6.330.0070.00714.45
5.6.320.0060.00614.00
5.6.310.0040.01113.79
5.6.300.0040.00713.93
5.6.290.0120.00014.12
5.6.280.0070.00714.48
5.6.270.0000.01214.04
5.6.260.0040.00914.11
5.6.250.0030.00714.41
5.6.240.0070.00713.84
5.6.230.0040.00714.13
5.6.220.0030.01214.01
5.6.210.0060.00614.14
5.6.200.0070.00414.07
5.6.190.0030.00914.05
5.6.180.0030.00714.15
5.6.170.0060.00314.18
5.6.160.0060.00914.01
5.6.150.0090.00614.13
5.6.140.0110.00313.91
5.6.130.0000.01114.32
5.6.120.0090.00013.98
5.6.110.0060.00914.18
5.6.100.0030.01013.98
5.6.90.0090.00313.96
5.6.80.0040.00813.99
5.6.70.0040.00413.95
5.6.60.0040.00413.94
5.6.50.0060.00314.29
5.6.40.0030.01213.88
5.6.30.0130.00314.22
5.6.20.0030.01314.13
5.6.10.0040.01113.83
5.6.00.0090.00614.04

preferences:
53.25 ms | 400 KiB | 5 Q