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.0140.00016.50
8.3.50.0100.01121.19
8.3.40.0110.00718.79
8.3.30.0120.00418.88
8.3.20.0070.00020.13
8.3.10.0080.00023.68
8.3.00.0080.00019.56
8.2.180.0110.01118.29
8.2.170.0040.01122.96
8.2.160.0180.00420.52
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00017.88
8.2.110.0040.00722.07
8.2.100.0060.00618.03
8.2.90.0040.00419.35
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0000.00917.93
8.2.50.0030.00718.07
8.2.40.0040.00421.04
8.2.30.0000.00820.51
8.2.20.0040.00417.89
8.2.10.0020.00518.20
8.2.00.0000.00718.19
8.1.280.0140.00725.92
8.1.270.0070.01323.82
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0090.00022.66
8.1.230.0080.00419.26
8.1.220.0000.00917.79
8.1.210.0040.00418.77
8.1.200.0030.00617.50
8.1.190.0030.00517.35
8.1.180.0040.00418.10
8.1.170.0000.00820.34
8.1.160.0040.00421.94
8.1.150.0000.00818.95
8.1.140.0050.00319.78
8.1.130.0000.00717.59
8.1.120.0050.00217.43
8.1.110.0030.00517.46
8.1.100.0000.00717.46
8.1.90.0040.00417.50
8.1.80.0000.00717.35
8.1.70.0000.00817.50
8.1.60.0040.00417.59
8.1.50.0080.00317.55
8.1.40.0070.00017.57
8.1.30.0030.00617.66
8.1.20.0030.00517.69
8.1.10.0040.00417.50
8.1.00.0000.00817.39
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0080.00018.46
8.0.270.0030.00317.27
8.0.260.0000.00717.27
8.0.250.0040.00417.07
8.0.240.0070.00017.05
8.0.230.0040.00417.01
8.0.220.0030.00416.88
8.0.210.0040.00416.86
8.0.200.0060.00017.04
8.0.190.0040.00417.01
8.0.180.0040.00417.02
8.0.170.0000.00816.90
8.0.160.0070.00017.02
8.0.150.0070.00016.89
8.0.140.0040.00416.91
8.0.130.0030.00313.36
8.0.120.0040.00416.92
8.0.110.0040.00416.93
8.0.100.0000.00816.79
8.0.90.0030.00316.80
8.0.80.0140.00016.97
8.0.70.0000.00716.96
8.0.60.0000.00716.85
8.0.50.0070.00017.09
8.0.30.0100.01017.16
8.0.20.0090.01017.40
8.0.10.0000.00717.16
8.0.00.0120.00916.83
7.4.330.0050.00015.08
7.4.320.0000.00616.50
7.4.300.0070.00016.43
7.4.290.0030.00316.44
7.4.280.0030.00516.61
7.4.270.0080.00016.54
7.4.260.0070.00016.62
7.4.250.0030.00616.59
7.4.240.0020.00516.54
7.4.230.0040.00416.45
7.4.220.0090.01616.64
7.4.210.0060.00916.55
7.4.200.0030.00316.52
7.4.160.0060.01216.57
7.4.150.0120.00617.40
7.4.140.0110.01017.86
7.4.130.0170.00316.38
7.4.120.0180.00216.54
7.4.110.0150.00416.35
7.4.100.0140.00416.36
7.4.90.0120.00616.52
7.4.80.0000.01819.39
7.4.70.0120.00916.47
7.4.60.0030.01316.62
7.4.50.0000.00816.42
7.4.40.0130.00316.50
7.4.30.0130.00416.67
7.4.00.0090.00614.87
7.3.330.0050.00013.22
7.3.320.0030.00313.45
7.3.310.0030.00316.56
7.3.300.0030.00316.30
7.3.290.0050.01216.42
7.3.280.0060.01316.37
7.3.270.0070.01017.40
7.3.260.0130.00616.66
7.3.240.0130.00516.66
7.3.230.0130.00316.61
7.3.210.0030.01316.62
7.3.200.0100.00616.71
7.3.190.0060.01216.40
7.3.180.0060.00916.54
7.3.170.0100.00616.62
7.3.160.0090.00816.41
7.2.330.0070.01116.46
7.2.320.0160.00316.54
7.2.310.0100.00616.61
7.2.300.0160.00016.81
7.2.290.0130.00716.59
7.2.60.0040.00717.16
7.2.00.0030.01319.44
7.1.200.0100.00315.67
7.1.70.0000.01317.20
7.1.60.0060.00617.24
7.1.50.0030.02017.11
7.1.00.0030.07722.30
7.0.200.0030.00916.50
7.0.60.0170.07320.02
7.0.50.0030.05317.90
7.0.40.0100.08320.04
7.0.30.0370.06320.25
7.0.20.0300.08020.24
7.0.10.0000.08320.33
7.0.00.0030.05020.09
5.6.280.0030.03020.79
5.6.210.0100.07320.55
5.6.200.0100.04318.25
5.6.190.0100.08720.50
5.6.180.0330.05320.77
5.6.170.0400.08020.40
5.6.160.0170.07320.51
5.6.150.0030.07718.23
5.6.140.0030.03718.19
5.6.130.0100.08318.13
5.6.120.0100.08021.03
5.6.110.0070.08021.00
5.6.100.0100.08320.97
5.6.90.0130.07320.99
5.6.80.0130.05320.53
5.5.350.0030.08320.42
5.5.340.0130.07318.09
5.5.330.0070.04320.57
5.5.320.2900.04020.51
5.5.310.0270.07720.38
5.5.300.0100.07717.96
5.5.290.0030.08317.95
5.5.280.0070.04320.86
5.5.270.0130.06720.76
5.5.260.0070.07320.99
5.5.250.0100.07720.63
5.5.240.0030.07320.31
5.4.450.0770.05319.20
5.4.440.0230.06319.48
5.4.430.0130.08019.58
5.4.420.0930.06019.48
5.4.410.0770.06319.45
5.4.400.0670.05718.88
5.4.390.0370.05319.13
5.4.380.0070.05718.98
5.4.370.0030.06019.14
5.4.360.0500.05719.15
5.4.350.0670.04319.29
5.4.340.0630.07019.15
5.4.320.0130.07319.22
5.4.310.0100.07018.89
5.4.300.0500.08318.87
5.4.290.0730.07319.14
5.4.280.0800.06719.12
5.4.270.0700.05319.12
5.4.260.0730.05318.98
5.4.250.0800.05719.14
5.4.240.0830.05019.00
5.4.230.0800.04318.86
5.4.220.0870.05019.05
5.4.210.0730.06019.12
5.4.200.0770.05719.21
5.4.190.0730.06019.25
5.4.180.0830.05719.07
5.4.170.0870.05718.83
5.4.160.0970.07019.11
5.4.150.0830.06718.82
5.4.140.0700.05016.58
5.4.130.0670.05716.82
5.4.120.0870.04716.46
5.4.110.0700.05716.65
5.4.100.0900.05016.65
5.4.90.0830.04716.66
5.4.80.0730.04016.46
5.4.70.0300.05016.57
5.4.60.0030.03316.43
5.4.50.0000.03716.44
5.4.40.0200.04316.51
5.4.30.0170.04016.54
5.4.20.0070.06016.39

preferences:
53.68 ms | 401 KiB | 5 Q