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', 'integer'); echo 'Hello'.PHP_EOL; } myargs('hello', 4); myargs(4, 'oof');

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.0110.00318.27
8.3.50.0110.00721.20
8.3.40.0090.00918.69
8.3.30.0110.00418.86
8.3.20.0040.00420.30
8.3.10.0030.00523.45
8.3.00.0060.00319.56
8.2.180.0110.01118.46
8.2.170.0000.01422.96
8.2.160.0160.00320.53
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0030.00617.63
8.2.110.0070.00322.29
8.2.100.0040.00819.57
8.2.90.0000.00817.75
8.2.80.0000.00918.66
8.2.70.0040.00417.75
8.2.60.0040.00417.63
8.2.50.0000.00917.75
8.2.40.0050.00317.63
8.2.30.0050.00317.75
8.2.20.0000.00917.79
8.2.10.0000.00718.02
8.2.00.0040.00418.05
8.1.280.0130.00925.92
8.1.270.0040.00423.98
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00320.84
8.1.230.0040.00717.89
8.1.220.0000.00817.79
8.1.210.0060.00318.77
8.1.200.0030.00617.35
8.1.190.0050.00317.36
8.1.180.0050.00318.10
8.1.170.0000.00817.62
8.1.160.0000.00718.90
8.1.150.0000.00818.79
8.1.140.0080.00019.72
8.1.130.0000.00717.68
8.1.120.0000.00817.52
8.1.110.0040.00417.49
8.1.100.0050.00217.53
8.1.90.0020.00517.51
8.1.80.0070.00017.49
8.1.70.0000.00717.53
8.1.60.0060.00317.59
8.1.50.0110.00017.58
8.1.40.0000.00817.53
8.1.30.0040.00417.59
8.1.20.0030.00617.74
8.1.10.0080.00017.61
8.1.00.0040.00417.51
8.0.300.0070.00018.77
8.0.290.0070.00016.75
8.0.280.0070.00017.98
8.0.270.0040.00418.13
8.0.260.0000.00617.23
8.0.250.0040.00416.93
8.0.240.0070.00017.02
8.0.230.0030.00317.02
8.0.220.0050.00216.93
8.0.210.0000.00816.94
8.0.200.0060.00016.91
8.0.190.0040.00417.08
8.0.180.0030.00616.88
8.0.170.0040.00416.89
8.0.160.0040.00416.94
8.0.150.0030.00316.91
8.0.140.0000.00716.91
8.0.130.0000.00613.49
8.0.120.0000.00916.92
8.0.110.0040.00416.90
8.0.100.0000.00717.00
8.0.90.0040.00316.83
8.0.80.0080.00616.93
8.0.70.0050.00316.84
8.0.60.0070.00016.89
8.0.50.0000.00816.92
8.0.30.0070.01017.18
8.0.20.0160.00817.41
8.0.10.0000.00816.97
8.0.00.0100.01016.85
7.4.330.0030.00315.08
7.4.320.0030.00316.58
7.4.300.0030.00316.68
7.4.290.0070.00016.51
7.4.280.0000.00816.53
7.4.270.0050.00316.60
7.4.260.0030.00316.47
7.4.250.0050.00216.48
7.4.240.0060.00216.57
7.4.230.0040.00416.72
7.4.220.0030.01616.60
7.4.210.0110.00416.45
7.4.200.0030.00316.60
7.4.160.0090.00916.49
7.4.150.0090.00917.40
7.4.140.0100.00817.86
7.4.130.0130.00716.57
7.4.120.0090.01316.52
7.4.110.0140.00516.38
7.4.100.0060.01516.32
7.4.90.0120.00816.52
7.4.80.0060.01019.39
7.4.70.0030.01816.64
7.4.60.0110.00616.52
7.4.50.0000.00816.54
7.4.40.0030.01316.58
7.4.30.0110.00516.35
7.4.10.0080.00915.03
7.4.00.0080.01015.11
7.3.330.0030.00313.39
7.3.320.0030.00313.30
7.3.310.0000.00716.50
7.3.300.0000.00716.48
7.3.290.0070.01316.38
7.3.280.0050.01116.40
7.3.270.0100.00717.40
7.3.260.0070.01016.42
7.3.240.0130.00716.42
7.3.230.0030.01316.48
7.3.210.0090.01016.40
7.3.200.0100.01316.50
7.3.190.0060.01616.36
7.3.180.0100.00716.38
7.3.170.0100.00616.59
7.3.160.0060.01616.37
7.3.130.0090.00814.82
7.3.120.0070.01014.90
7.3.110.0100.00614.86
7.3.100.0020.01314.85
7.3.90.0050.00914.88
7.3.80.0100.00314.89
7.3.70.0070.00914.85
7.3.60.0040.01114.84
7.3.50.0080.00614.86
7.3.40.0040.00714.85
7.3.30.0050.00814.82
7.3.20.0080.00616.78
7.3.10.0070.00616.52
7.3.00.0060.00816.73
7.2.330.0030.01416.44
7.2.320.0100.01316.82
7.2.310.0120.00916.70
7.2.300.0090.01316.69
7.2.290.0100.01016.57
7.2.260.0080.00914.94
7.2.250.0070.01114.97
7.2.240.0050.01015.27
7.2.230.0080.00815.00
7.2.220.0070.00715.04
7.2.210.0050.00915.13
7.2.200.0100.00414.99
7.2.190.0080.00915.03
7.2.180.0020.01315.15
7.2.170.0080.00415.11
7.2.160.0020.01115.23
7.2.150.0020.00717.11
7.2.140.0090.00417.01
7.2.130.0060.00916.76
7.2.120.0070.00516.88
7.2.110.0030.01117.00
7.2.100.0050.00816.78
7.2.90.0030.01116.85
7.2.80.0090.00617.00
7.2.70.0050.00916.90
7.2.60.0060.00617.04
7.2.50.0070.00716.79
7.2.40.0060.00817.00
7.2.30.0040.00916.95
7.2.20.0040.01016.93
7.2.10.0050.01016.95
7.2.00.0070.00817.43
7.1.330.0030.01115.84
7.1.320.0040.00915.77
7.1.310.0080.00515.79
7.1.300.0030.01015.88
7.1.290.0010.01115.62
7.1.280.0110.00215.53
7.1.270.0040.00815.88
7.1.260.0050.00915.73
7.1.250.0040.00815.77
7.1.240.0090.00715.81
7.1.230.0050.01015.83
7.1.220.0030.00915.84
7.1.210.0030.01015.76
7.1.200.0090.00415.84
7.1.190.0090.00515.68
7.1.180.0050.00815.96
7.1.170.0030.00915.80
7.1.160.0040.01015.74
7.1.150.0050.00615.86
7.1.140.0060.00815.85
7.1.130.0020.00915.78
7.1.120.0050.00815.84
7.1.110.0050.00515.70
7.1.100.0070.00516.63
7.1.90.0090.00315.83
7.1.80.0030.00915.78
7.1.70.0060.00816.20
7.1.60.0050.01116.93
7.1.50.0060.01116.11
7.1.40.0070.00715.96
7.1.30.0060.00615.88
7.1.20.0050.01015.68
7.1.10.0080.00815.58
7.1.00.0070.02717.94
7.0.330.0030.00815.36
7.0.320.0070.00515.38
7.0.310.0050.00815.29
7.0.300.0080.00815.40
7.0.290.0090.00515.48
7.0.280.0060.00515.28
7.0.270.0070.00315.52
7.0.260.0050.00715.34
7.0.250.0040.00815.54
7.0.240.0020.01115.56
7.0.230.0080.00515.45
7.0.220.0080.00715.55
7.0.210.0040.00715.45
7.0.200.0130.00715.04
7.0.190.0070.00615.30
7.0.180.0030.01015.49
7.0.170.0020.00915.45
7.0.160.0010.01015.36
7.0.150.0070.00515.34
7.0.140.0090.00515.23
7.0.130.0110.00315.16
7.0.120.0060.00515.53
7.0.110.0060.00515.48
7.0.100.0050.00715.40
7.0.90.0060.00615.36
7.0.80.0070.00515.25
7.0.70.0050.00815.45
7.0.60.0090.02617.05
7.0.50.0060.02916.24
7.0.40.0080.03315.65
7.0.30.0160.02715.75
7.0.20.0140.02815.70
7.0.10.0040.01915.79
7.0.00.0030.03315.76
5.6.400.0020.01314.52
5.6.390.0070.00614.46
5.6.380.0070.00714.67
5.6.370.0040.00814.43
5.6.360.0050.01214.18
5.6.350.0040.00614.52
5.6.340.0070.00614.39
5.6.330.0100.00314.36
5.6.320.0080.00414.60
5.6.310.0050.00714.65
5.6.300.0090.00514.42
5.6.290.0040.00714.27
5.6.280.0060.01716.71
5.6.270.0010.01014.41
5.6.260.0070.00714.36
5.6.250.0050.00714.39
5.6.240.0090.00514.68
5.6.230.0070.00514.35
5.6.220.0060.00714.33
5.6.210.0070.03116.33
5.6.200.0080.02915.70
5.6.190.0060.02216.40
5.6.180.0110.01716.38
5.6.170.0150.03616.42
5.6.160.0020.03616.45
5.6.150.0070.02015.81
5.6.140.0060.03115.69
5.6.130.0040.02515.70
5.6.120.0060.03516.61
5.6.110.0060.02916.67
5.6.100.0080.03216.60
5.6.90.0050.02016.58
5.6.80.0050.03116.46
5.6.70.0060.00314.50
5.6.60.0070.00614.45
5.6.50.0080.00614.44
5.6.40.0030.00814.29
5.6.30.0050.00814.30
5.6.20.0070.00714.22
5.6.10.0050.00914.53
5.6.00.0070.00814.07
5.5.380.0000.01314.47
5.5.370.0020.01514.21
5.5.360.0030.01114.46
5.5.350.0060.02616.47
5.5.340.0030.01815.46
5.5.330.0110.01416.25
5.5.320.1400.01916.39
5.5.310.0120.01816.34
5.5.300.0020.02715.66
5.5.290.0100.02215.56
5.5.280.0090.03016.63
5.5.270.0070.01816.45
5.5.260.0040.02816.47
5.5.250.0070.02516.34
5.5.240.0040.01816.23
5.5.230.0110.00514.41
5.5.220.0050.00714.50
5.5.210.0030.00914.22
5.5.200.0020.01014.42
5.5.190.0030.00614.35
5.5.180.0030.01114.37
5.5.170.0120.00214.25
5.5.160.0020.00914.19
5.5.150.0070.00814.35
5.5.140.0090.00614.33
5.5.130.0060.00814.34
5.5.120.0030.00814.14
5.5.110.0060.00514.39
5.5.100.0050.01013.96
5.5.90.0080.00714.19
5.5.80.0000.01214.52
5.5.70.0030.00914.14
5.5.60.0050.00914.33
5.5.50.0050.01014.25
5.5.40.0050.01014.43
5.5.30.0030.01114.51
5.5.20.0040.00814.28
5.5.10.0050.00814.01
5.5.00.0100.00514.24
5.4.450.0260.02614.06
5.4.440.0290.02113.89
5.4.430.0260.02414.10
5.4.420.0300.02114.00
5.4.410.0350.01913.90
5.4.400.0280.02013.77
5.4.390.0220.02613.57
5.4.380.0300.02713.77
5.4.370.0240.02413.69
5.4.360.0320.01513.64
5.4.350.0250.02313.68
5.4.340.0290.02113.70
5.4.330.0000.00911.11
5.4.320.0280.02013.63
5.4.310.0270.02413.89
5.4.300.0300.02013.83
5.4.290.0300.01813.71
5.4.280.0220.02613.59
5.4.270.0320.01913.70
5.4.260.0280.01913.64
5.4.250.0290.02013.79
5.4.240.0290.02713.69
5.4.230.0310.02813.72
5.4.220.0280.02213.78
5.4.210.0270.02213.84
5.4.200.0270.02413.75
5.4.190.0290.02413.70
5.4.180.0270.02013.76
5.4.170.0360.01413.80
5.4.160.0330.02413.79
5.4.150.0300.02013.59
5.4.140.0250.02112.89
5.4.130.0310.01912.86
5.4.120.0230.02413.04
5.4.110.0270.02113.01
5.4.100.0300.02312.99
5.4.90.0260.01912.88
5.4.80.0330.01912.95
5.4.70.0120.01212.99
5.4.60.0020.02712.79
5.4.50.0060.02712.97
5.4.40.0100.01712.95
5.4.30.0100.02413.01
5.4.20.0070.01712.94
5.4.10.0060.00311.06
5.4.00.0020.00911.17

preferences:
47.35 ms | 401 KiB | 5 Q