3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class CanBeStrung { public function __toString(): string { return 'I\'m highly strung'; } } function isItStringy(string|Stringable $possibleStringType): bool { return true; } assert(isItStringy('a string') === true); assert(isItStringy(new CanBeStrung()) === true); try { assert(isItStringy(42) === false); } catch (TypeError $e) { echo '42 isnt a string' . PHP_EOL; } try { assert(isItStringy(new stdClass()) === false); } catch (TypeError $e) { echo 'stdClass cant be strung' . PHP_EOL; }

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.4.20.0100.00718.08
8.4.10.0130.00619.59
8.3.150.0120.00617.16
8.3.140.0150.00416.73
8.3.130.0080.00016.65
8.3.120.0040.00420.64
8.3.110.0030.00718.43
8.3.100.0040.00416.41
8.3.90.0090.00926.77
8.3.80.0060.00316.75
8.3.70.0000.01918.55
8.3.60.0040.01818.43
8.3.50.0080.01024.55
8.3.40.0070.01118.98
8.3.30.0140.00018.84
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0080.00026.16
8.2.260.0080.00017.26
8.2.250.0030.00518.38
8.2.240.0080.00018.89
8.2.230.0080.00022.58
8.2.220.0100.00624.06
8.2.210.0000.00826.77
8.2.200.0060.00616.48
8.2.190.0140.00716.88
8.2.180.0090.00625.92
8.2.170.0120.00918.90
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00526.35
8.2.110.0030.00622.15
8.2.100.0040.00817.91
8.2.90.0040.00419.26
8.2.80.0090.00017.97
8.2.70.0040.00417.63
8.2.60.0040.00417.63
8.2.50.0050.00318.10
8.2.40.0080.00019.32
8.2.30.0040.00418.00
8.2.20.0040.00418.04
8.2.10.0000.00719.15
8.2.00.0000.00819.21
8.1.310.0060.00318.57
8.1.300.0080.00416.41
8.1.290.0090.00030.84
8.1.280.0140.00725.92
8.1.270.0080.00023.99
8.1.260.0070.00028.09
8.1.250.0070.00028.09
8.1.240.0060.00320.64
8.1.230.0060.00617.82
8.1.220.0050.00317.74
8.1.210.0030.00618.77
8.1.200.0100.00017.23
8.1.190.0000.00817.22
8.1.180.0000.00818.10
8.1.170.0040.00418.72
8.1.160.0000.00718.89
8.1.150.0110.00018.76
8.1.140.0040.00418.76
8.1.130.0070.00020.18
8.1.120.0000.00717.47
8.1.110.0030.00517.45
8.1.100.0040.00417.37
8.1.90.0050.00317.52
8.1.80.0030.00617.42
8.1.70.0030.00317.41
8.1.60.0030.00617.48
8.1.50.0070.00017.52
8.1.40.0000.00817.41
8.1.30.0000.00717.61
8.1.20.0030.00517.62
8.1.10.0030.00617.51
8.1.00.0000.00817.50
8.0.300.0000.00818.77
8.0.290.0070.00016.75
8.0.280.0040.00418.44
8.0.270.0030.00318.14
8.0.260.0030.00318.49
8.0.250.0000.00716.99
8.0.240.0040.00416.98
8.0.230.0030.00317.05
8.0.220.0000.00716.91
8.0.210.0000.00716.95
8.0.200.0050.00216.98
8.0.190.0070.00017.03
8.0.180.0040.00416.90
8.0.170.0060.00316.99
8.0.160.0040.00416.95
8.0.150.0070.00016.84
8.0.140.0000.00716.87
8.0.130.0000.00513.42
8.0.120.0040.00416.93
8.0.110.0040.00416.87
8.0.100.0000.00716.95
8.0.90.0040.00416.73
8.0.80.0040.00416.91
8.0.70.0000.00816.75
8.0.60.0000.00816.93
8.0.50.0050.00316.73
8.0.30.0030.00316.95
8.0.20.0030.00317.05
8.0.10.0030.00316.92
8.0.00.0040.00417.16
7.4.330.0000.00415.55
7.4.320.0000.00716.37
7.4.300.0040.00416.43
7.4.290.0000.00716.48
7.4.280.0000.00716.39
7.4.270.0000.00716.35
7.4.260.0030.00313.09
7.4.250.0000.00716.41
7.4.240.0000.00816.45
7.4.230.0000.00716.34
7.4.220.0070.00016.46
7.4.210.0000.00716.45
7.4.200.0040.00416.16
7.4.190.0030.00316.21
7.4.180.0060.00016.16
7.4.160.0000.00716.42
7.4.150.0050.00216.48
7.4.140.0040.00416.17
7.4.130.0000.00616.23
7.4.120.0000.00716.23
7.4.110.0070.00016.35
7.4.100.0040.00416.56
7.4.90.0070.00016.07
7.4.80.0000.00716.28
7.4.70.0060.00816.32
7.4.60.0070.00716.29
7.4.50.0050.00916.16
7.4.40.0060.00816.41
7.4.30.0080.00816.41
7.4.20.0100.00516.26
7.4.10.0060.00816.23
7.4.00.0090.00616.34
7.3.330.0000.00816.18
7.3.320.0060.00012.98
7.3.310.0000.00616.23
7.3.300.0060.00016.08
7.3.290.0070.00016.03
7.3.280.0050.00216.16
7.3.270.0000.00816.12
7.3.260.0040.00416.15
7.3.250.0040.00416.19
7.3.240.0000.00716.21
7.3.230.0040.00416.14
7.3.220.0040.00416.09
7.3.210.0000.00716.02
7.3.200.0000.00616.06
7.3.190.0080.00516.16
7.3.180.0030.01116.16
7.3.170.0070.00716.13
7.3.160.0080.00716.02
7.3.150.0070.00716.19
7.3.140.0090.00516.17
7.3.130.0060.00916.13
7.3.120.0060.00716.28
7.3.110.0070.00516.08
7.3.100.0110.00316.16
7.3.90.0090.00316.25
7.3.80.0050.01016.19
7.3.70.0050.00916.14
7.3.60.0080.00616.16
7.3.50.0050.01016.12
7.3.40.0070.00616.15
7.3.30.0040.00916.18
7.3.20.0060.00716.18
7.3.10.0060.00716.14
7.3.00.0060.00716.24
7.2.340.0030.00316.15
7.2.330.0030.00316.15
7.2.320.0030.00315.89
7.2.310.0080.00716.16
7.2.300.0100.00516.10
7.2.290.0040.01016.13
7.2.280.0070.00816.17
7.2.270.0100.00516.24
7.2.260.0100.00616.19
7.2.250.0070.00616.11
7.2.240.0050.00916.20
7.2.230.0040.01016.25
7.2.220.0050.00916.19
7.2.210.0070.00916.15
7.2.200.0090.00516.27
7.2.190.0070.00916.23
7.2.180.0030.01216.27
7.2.170.0070.00916.27
7.2.160.0080.00616.23
7.2.150.0040.00916.39
7.2.140.0080.00616.34
7.2.130.0050.01116.38
7.2.120.0070.01016.39
7.2.110.0100.00716.36
7.2.100.0120.00716.36
7.2.90.0110.00816.34
7.2.80.0100.00616.29
7.2.70.0060.00916.34
7.2.60.0280.01216.17
7.2.50.0080.00716.23
7.2.40.0060.00916.24
7.2.30.0060.00816.27
7.2.20.0120.00816.23
7.2.10.0110.00316.40
7.2.00.0030.01016.32

preferences:
48.02 ms | 403 KiB | 5 Q