3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo { class App { const SOME_CONST = 5; public function __construct($a) { echo __METHOD__ . " $a\n"; } } } namespace Foo\Api { class Api { private $var = 2; public function __construct($a) { echo __METHOD__ . " " . get_class($a) . "\n"; } public function run() { echo __METHOD__; } } } namespace Whatever { use Foo\Api\Api; use Foo\App as Foo; // require __DIR__ . '/path/to/vendor/autoload.php'; var_dump( Api::class, // "Foo\Api\Api" class_exists(Api::class), // bool(true) Foo::class, // "Foo\App" class_exists(Foo::class) // bool(true) ); $api = new Api( new Foo(Foo::SOME_CONST) // Fatal Error: Class "Foo\Api\Foo" not found ... ); $api->run(); }

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.01118.43
8.3.50.0040.01118.29
8.3.40.0140.00718.84
8.3.30.0070.00718.59
8.3.20.0080.00021.95
8.3.10.0040.00423.50
8.3.00.0040.00423.46
8.2.180.0200.00016.50
8.2.170.0100.01022.96
8.2.160.0070.00720.57
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0060.00318.21
8.2.120.0040.00426.35
8.2.110.0060.00322.26
8.2.100.0040.00817.72
8.2.90.0040.00417.75
8.2.80.0040.00417.97
8.2.70.0030.00517.80
8.2.60.0040.00418.09
8.2.50.0040.00418.10
8.2.40.0000.00719.23
8.2.30.0070.00019.33
8.2.20.0050.00519.84
8.2.10.0070.00019.36
8.2.00.0050.00319.29
8.1.280.0110.00425.92
8.1.270.0000.00818.88
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.45
8.1.230.0070.00417.70
8.1.220.0040.00417.74
8.1.210.0050.00518.77
8.1.200.0060.00317.38
8.1.190.0030.00517.28
8.1.180.0000.00818.10
8.1.170.0030.00618.62
8.1.160.0040.00418.89
8.1.150.0000.00718.86
8.1.140.0050.00222.21
8.1.130.0040.00417.50
8.1.120.0000.00717.49
8.1.110.0030.00517.38
8.1.100.0040.00717.48
8.1.90.0050.00317.47
8.1.80.0070.00017.36
8.1.70.0000.00717.49
8.1.60.0040.00417.52
8.1.50.0080.00017.52
8.1.40.0000.00917.53
8.1.30.0000.00817.56
8.1.20.0030.00617.68
8.1.10.0000.00917.52
8.1.00.0040.00417.40
8.0.300.0000.00721.52
8.0.290.0090.00316.58
8.0.280.0000.00818.46
8.0.270.0000.00717.12
8.0.260.0000.00616.84
8.0.250.0030.00316.98
8.0.240.0080.00016.99
8.0.230.0030.00516.94
8.0.220.0030.00316.91
8.0.210.0000.00716.86
8.0.200.0040.00416.91
8.0.190.0000.00816.83
8.0.180.0000.00916.89
8.0.170.0030.00616.89
8.0.160.0080.00016.93
8.0.150.0000.00716.89
8.0.140.0070.00016.82
8.0.130.0030.00313.37
8.0.120.0030.00516.88
8.0.110.0050.00316.89
8.0.100.0040.00416.95
8.0.90.0030.00516.79
8.0.80.0080.01116.91
8.0.70.0070.00016.79
8.0.60.0040.00416.86
8.0.50.0080.00016.92
8.0.30.0100.00817.19
8.0.20.0080.01117.40
8.0.10.0070.00016.83
8.0.00.0090.00916.71
7.4.330.0050.00016.83
7.4.320.0000.00616.45
7.4.300.0040.00416.62
7.4.290.0030.00316.43
7.4.280.0040.00416.52
7.4.270.0070.00016.61
7.4.260.0040.00416.59
7.4.250.0070.00016.49
7.4.240.0030.00516.45
7.4.230.0070.00016.69
7.4.220.0000.00816.50
7.4.210.0110.00316.57
7.4.200.0030.00316.32
7.4.160.0130.00716.59
7.4.140.0100.01017.86
7.4.130.0090.00916.44
7.4.120.0110.01116.43
7.4.110.0060.01216.55
7.4.100.0070.01216.39
7.4.90.0090.00916.60
7.4.80.0060.01019.39
7.4.70.0120.00916.63
7.4.60.0030.01316.54
7.4.50.0100.00316.35
7.4.40.0120.00316.38
7.4.00.0030.01015.10
7.3.330.0000.00613.24
7.3.320.0030.00313.20
7.3.310.0030.00616.36
7.3.300.0030.00316.25
7.3.290.0030.00316.38
7.3.280.0040.01116.34
7.3.260.0100.00916.41
7.3.240.0070.01116.34
7.3.230.0030.01416.14
7.3.210.0040.01816.33
7.3.200.0060.01016.71
7.3.190.0100.01316.68
7.3.180.0100.00716.37
7.3.170.0040.01516.18
7.3.160.0090.00616.56
7.3.10.0100.00416.36
7.3.00.0320.00715.55
7.2.330.0100.00916.88
7.2.320.0110.00916.82
7.2.310.0060.01116.44
7.2.300.0140.00916.54
7.2.290.0110.00716.54
7.2.130.0350.00815.71
7.2.120.0300.01015.74
7.2.110.0310.00715.84
7.2.100.0300.00815.78
7.2.90.0410.00715.74
7.2.80.0360.00915.80
7.2.70.0350.00715.85
7.2.60.0300.00715.85
7.2.50.0300.00915.69
7.2.40.0480.00615.73
7.2.30.0400.01015.78
7.2.20.0260.00715.78
7.2.10.0410.00615.71
7.2.00.0600.00815.83
7.1.250.0260.00614.61
7.0.330.0520.00713.56
5.6.380.0050.00814.14

preferences:
41.42 ms | 400 KiB | 5 Q