3v4l.org

run code in 300+ PHP versions simultaneously
<?php function strict() { $backtrace = debug_backtrace(0, 2); if (false === $backtrace || count($backtrace) !== 2) { throw new \RuntimeException('strict() must be called from within a function'); } $expectedTypes = func_get_args(); $receivedTypes = array_map('gettype', $backtrace[1]['args']); if (count($expectedTypes) !== count($receivedTypes)) { throw new \InvalidArgumentException('Got ' . count($receivedTypes) . ' arguments, expected ' . count($expectedTypes)); } for ($i = 0; $i < count($expectedTypes); $i++) { if ($expectedTypes[$i] !== $receivedTypes[$i]) { throw new \InvalidArgumentException('Expected argument ' . ($i + 1) . ' to be of type ' . $expectedTypes[$i] . ', received ' . $receivedTypes[$i]); } } } function myargs($a, $b) { strict('string', 'int'); echo 'Hello'; } myargs('hello', 4);

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.0100.00616.63
8.3.50.0110.00416.28
8.3.40.0140.00418.66
8.3.30.0110.00418.75
8.3.20.0070.00020.39
8.3.10.0080.00023.60
8.3.00.0080.00019.69
8.2.180.0120.00918.13
8.2.170.0150.00022.96
8.2.160.0060.00920.35
8.2.150.0060.00324.18
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00017.75
8.2.110.0090.00319.19
8.2.100.0000.01118.05
8.2.90.0050.00319.41
8.2.80.0040.00417.97
8.2.70.0090.00017.75
8.2.60.0060.00617.87
8.2.50.0030.00618.07
8.2.40.0040.00421.13
8.2.30.0040.00420.66
8.2.20.0040.00417.83
8.2.10.0040.00418.20
8.2.00.0040.00418.04
8.1.280.0040.01825.92
8.1.270.0040.01223.88
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0060.00321.00
8.1.230.0040.00817.83
8.1.220.0060.00317.77
8.1.210.0000.00818.77
8.1.200.0050.00517.48
8.1.190.0050.00317.25
8.1.180.0080.00018.10
8.1.170.0000.00820.43
8.1.160.0050.00222.02
8.1.150.0000.00718.89
8.1.140.0000.00819.60
8.1.130.0030.00317.66
8.1.120.0000.00817.34
8.1.110.0000.00717.54
8.1.100.0040.00417.45
8.1.90.0000.00817.47
8.1.80.0000.00817.39
8.1.70.0000.00717.43
8.1.60.0040.00417.53
8.1.50.0030.00617.53
8.1.40.0040.00417.54
8.1.30.0030.00617.72
8.1.20.0000.00917.58
8.1.10.0000.00817.43
8.1.00.0040.00417.54
8.0.300.0000.00718.77
8.0.290.0000.00816.88
8.0.280.0000.00718.37
8.0.270.0050.00217.27
8.0.260.0040.00417.26
8.0.250.0040.00417.06
8.0.240.0030.00317.08
8.0.230.0050.00216.95
8.0.220.0030.00516.95
8.0.210.0000.00716.86
8.0.200.0000.00617.03
8.0.190.0000.00717.01
8.0.180.0000.00817.00
8.0.170.0080.00017.02
8.0.160.0070.00016.95
8.0.150.0000.00716.94
8.0.140.0000.00816.90
8.0.130.0000.00513.41
8.0.120.0030.00516.93
8.0.110.0050.00316.91
8.0.100.0040.00416.93
8.0.90.0040.00416.99
8.0.80.0080.00816.88
8.0.70.0040.00416.98
8.0.60.0050.00217.01
8.0.50.0070.00016.82
8.0.30.0060.01117.32
8.0.20.0140.00617.40
8.0.10.0040.00316.98
8.0.00.0100.01016.89
7.4.330.0020.00215.08
7.4.320.0030.00316.64
7.4.300.0000.00716.61
7.4.290.0030.00316.53
7.4.280.0000.00716.52
7.4.270.0030.00316.54
7.4.260.0030.00316.58
7.4.250.0050.00216.61
7.4.240.0000.00816.54
7.4.230.0000.00716.65
7.4.220.0030.02016.64
7.4.210.0110.00416.58
7.4.200.0030.00316.42
7.4.160.0160.00416.55
7.4.150.0140.00317.40
7.4.140.0120.00717.86
7.4.130.0150.00316.62
7.4.120.0160.00516.49
7.4.110.0100.00716.59
7.4.100.0140.00716.54
7.4.90.0100.00716.61
7.4.80.0170.00019.39
7.4.70.0120.00916.58
7.4.60.0100.00616.64
7.4.50.0040.00416.61
7.4.40.0090.01516.74
7.4.30.0160.00316.55
7.4.00.0070.01114.96
7.3.330.0030.00313.44
7.3.320.0000.00513.22
7.3.310.0070.00016.49
7.3.300.0030.00316.41
7.3.290.0060.00816.38
7.3.280.0080.00716.47
7.3.270.0110.00817.40
7.3.260.0070.01116.50
7.3.250.0090.01216.36
7.3.240.0070.01216.56
7.3.230.0040.01716.66
7.3.210.0100.00716.45
7.3.200.0090.00616.83
7.3.190.0110.01216.61
7.3.180.0070.00716.48
7.3.170.0130.00316.46
7.3.160.0070.01416.55
7.2.330.0110.00616.48
7.2.320.0080.01716.49
7.2.310.0080.00816.76
7.2.300.0100.00616.71
7.2.290.0130.00616.87
7.2.60.0070.00717.14
7.2.00.0070.01019.20
7.1.200.0200.00515.49
7.1.100.0060.01218.09
7.1.70.0030.00517.16
7.1.60.0040.02119.50
7.1.50.0180.00717.02
7.1.00.0000.08022.27
7.0.200.0580.00714.89
7.0.60.0100.07719.89
7.0.50.0130.07317.88
7.0.40.0170.08020.23
7.0.30.0300.07720.04
7.0.20.0200.04320.20
7.0.10.0100.05320.21
7.0.00.0000.08020.33
5.6.280.0000.03321.14
5.6.210.0100.08320.63
5.6.200.0170.07018.19
5.6.190.0070.06320.55
5.6.180.0270.04320.55
5.6.170.0200.05020.53
5.6.160.0100.08320.47
5.6.150.0070.03718.16
5.6.140.0100.05318.24
5.6.130.0170.06318.14
5.6.120.0100.08021.08
5.6.110.0130.06320.97
5.6.100.0130.06321.01
5.6.90.0070.06321.00
5.6.80.0070.03720.45
5.5.350.0030.03320.39
5.5.340.0100.05718.09
5.5.330.0030.04320.20
5.5.320.3100.05020.42
5.5.310.0370.06020.34
5.5.300.0030.04718.00
5.5.290.0070.05317.92
5.5.280.0030.08720.86
5.5.270.0070.05720.79
5.5.260.0170.06020.81
5.5.250.0030.08720.72
5.5.240.0070.07320.30
5.4.450.0800.05719.71
5.4.440.0800.05319.47
5.4.430.0830.06719.55
5.4.420.0830.04319.57
5.4.410.0630.06319.04
5.4.400.0730.05319.16
5.4.390.0870.06019.15
5.4.380.0730.05019.23
5.4.370.0730.05719.26
5.4.360.0730.05719.16
5.4.350.0900.04318.84
5.4.340.0900.04319.15
5.4.320.0730.05719.26
5.4.310.0700.05019.38
5.4.300.0830.04019.12
5.4.290.0770.04718.98
5.4.280.0770.04719.25
5.4.270.0830.05019.14
5.4.260.0770.04319.25
5.4.250.0730.05319.05
5.4.240.0870.06719.21
5.4.230.0830.05719.07
5.4.220.0700.05719.14
5.4.210.0800.04719.16
5.4.200.0800.04319.14
5.4.190.0700.05719.14
5.4.180.0700.05718.86
5.4.170.0900.05019.14
5.4.160.0800.05318.82
5.4.150.0670.05718.82
5.4.140.0730.05016.59
5.4.130.0700.05016.38
5.4.120.0770.04716.56
5.4.110.0830.04316.65
5.4.100.0800.05716.64
5.4.90.0770.05016.65
5.4.80.0770.04716.28
5.4.70.0200.04016.49
5.4.60.0000.07716.60
5.4.50.0000.06716.52
5.4.40.0130.03716.43
5.4.30.0300.04716.48
5.4.20.0070.07016.43

preferences:
47.76 ms | 400 KiB | 5 Q