3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); final class Custom extends \RuntimeException { public static int $counter = 0; private function __construct(string $reason) { parent::__construct($reason); ++self::$counter; } public static function reason(string $reason): self { return new self($reason); } } printf("%d\n", Custom::$counter); assert(true === true, Custom::reason("Should never fail")); printf("%d (if increased, pointless throwable instantiation)\n", Custom::$counter); try { assert(true === false, Custom::reason("Should always fail")); } catch (\Throwable $t) { printf("%d (if increased, expected throwable instantiation) <%s>\n", Custom::$counter, $t->getMessage()); } printf("%d\n", Custom::$counter);

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.0040.01116.84
8.3.50.0070.01416.60
8.3.40.0100.01020.08
8.3.30.0070.00718.88
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0050.00326.16
8.2.180.0150.00616.75
8.2.170.0090.00918.94
8.2.160.0080.00822.96
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0070.00326.16
8.2.120.0040.00421.07
8.2.110.0070.00319.37
8.2.100.0100.00617.97
8.2.90.0040.00421.11
8.2.80.0000.00819.25
8.2.70.0030.00617.93
8.2.60.0000.00818.22
8.2.50.0070.00617.86
8.2.40.0090.00817.78
8.2.30.0110.00617.78
8.2.20.0110.00517.78
8.2.10.0110.00717.78
8.2.00.0130.00317.78
8.1.280.0140.00325.92
8.1.270.0030.00623.77
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0080.00423.50
8.1.230.0040.00920.95
8.1.220.0040.00417.76
8.1.210.0050.00318.90
8.1.200.0030.00617.23
8.1.190.0040.00417.22
8.1.180.0110.00118.10
8.1.170.0100.00717.78
8.1.160.0110.00517.78
8.1.150.0140.00417.78
8.1.140.0120.00417.78
8.1.130.0120.00517.78
8.1.120.0120.00517.78
8.1.110.0120.00417.78
8.1.100.0110.00517.78
8.1.90.0120.00517.78
8.1.80.0090.00817.78
8.1.70.0120.00417.78
8.1.60.0160.00217.78
8.1.50.0140.00417.78
8.1.40.0130.00517.78
8.1.30.0140.00317.78
8.1.20.0150.00317.78
8.1.10.0130.00517.78
8.1.00.0150.00417.78
8.0.300.0080.00020.16
8.0.290.0000.00816.75
8.0.280.0120.00817.78
8.0.270.0150.00217.78
8.0.260.0110.00517.78
8.0.250.0110.00517.78
8.0.240.0140.00317.78
8.0.230.0140.00217.78
8.0.220.0130.00317.78
8.0.210.0130.00317.78
8.0.200.0130.00417.78
8.0.190.0150.00217.78
8.0.180.0140.00317.78
8.0.170.0120.00417.78
8.0.160.0130.00317.78
8.0.150.0110.00517.78
8.0.140.0130.00417.78
8.0.130.0100.00717.78
8.0.120.0120.00517.78
8.0.110.0090.00617.78
8.0.100.0120.00517.78
8.0.90.0100.00617.78
8.0.80.0100.00617.78
8.0.70.0110.00517.78
8.0.60.0090.00717.78
8.0.50.0130.00317.78
8.0.30.0120.00417.78
8.0.20.0120.00417.78
8.0.10.0140.00317.78

preferences:
49.22 ms | 401 KiB | 5 Q