3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private const string PREFIX = "Hello. "; private static string $prefix = "Hello, "; private static function prefix(): string { return "Hello, "; } public function greetFunc(string $to): string { return static::prefix() . $to . "!"; // passes, but insecure } public function greetVar(string $to): string { return statics::$prefix . $to . "!"; // passes, but insecure } public function greetConst(string $to): string { return static::PREFIX . $to . "!"; // crashes immediately } } class Bar extends Foo { } echo (new Bar())->greetFunc("World") . PHP_EOL; echo (new Bar())->greetVar("World") . PHP_EOL; // echo (new Bar())->greetConst("World") . PHP_EOL; // Error! Referencing undefined Bar::PREFIX... class Buz extends Foo { protected static string $prefix = "Hi, "; protected static function prefix(): string { return "Hi, "; } } echo (new Buz())->greetFunc("World") . PHP_EOL; // No! private function was actually overridden!! echo (new Buz())->greetVar("World") . PHP_EOL; // No! private property was actually overridden!!

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.5.30.0050.00319.57
8.5.20.0100.00818.20
8.5.10.0140.00418.50
8.5.00.0230.00717.18
8.4.180.0120.01022.01
8.4.170.0110.00923.82
8.4.160.0120.01123.31
8.4.150.0300.01219.74
8.4.140.0330.01117.83
8.4.130.0330.00917.91
8.4.120.0360.00817.76
8.4.110.0360.00717.94
8.4.100.0370.00817.71
8.4.90.0380.00817.86
8.4.80.0410.00517.98
8.4.70.0370.00917.79
8.4.60.0320.01418.06
8.4.50.0450.00817.74
8.4.40.0400.01017.73
8.4.30.0400.00717.66
8.4.20.0400.00717.79
8.4.10.0410.01017.58
8.3.300.0110.01020.92
8.3.290.0130.01020.82
8.3.280.0310.00918.34
8.3.270.0350.01017.18
8.3.260.0380.00917.18
8.3.250.0370.01017.18
8.3.240.0380.00617.18
8.3.230.0350.00917.18
8.3.220.0340.00817.18
8.3.210.0370.00617.18
8.3.200.0390.00717.18
8.3.190.0330.00917.18
8.3.180.0340.00917.18
8.3.170.0380.00817.18
8.3.160.0390.00717.18
8.3.150.0380.00717.18
8.3.140.0400.00617.18
8.3.130.0320.00817.18
8.3.120.0320.00917.18
8.3.110.0360.00417.18
8.3.100.0340.01317.18
8.3.90.0390.00817.18
8.3.80.0370.01017.18
8.3.70.0400.00817.18
8.3.60.0360.01017.18
8.3.50.0330.01217.18
8.3.40.0350.01118.02
8.3.30.0290.00617.89
8.3.20.0270.00817.83
8.3.10.0290.00817.95
8.3.00.0240.00717.71
8.2.300.0110.01118.09
8.2.290.0260.01017.18
8.2.280.0280.00817.18
8.2.270.0300.00817.18
8.2.260.0290.00917.18
8.2.250.0330.00417.18
8.2.240.0300.00817.18
8.2.230.0300.00817.18
8.2.220.0310.00717.18
8.2.210.0310.00917.18
8.2.200.0290.00817.18
8.2.190.0290.00917.18
8.2.180.0290.00917.18
8.2.170.0320.00517.87
8.2.160.0330.01018.00
8.2.150.0330.00917.61
8.2.140.0320.01117.52
8.2.130.0330.00717.60
8.2.120.0280.01217.83
8.2.110.0280.01317.48
8.2.100.0290.00617.77
8.2.90.0260.01117.84
8.2.80.0290.00617.97
8.2.70.0290.00717.83
8.2.60.0290.00817.59
8.2.50.0280.00817.72
8.2.40.0340.00717.70
8.2.30.0290.00717.73
8.2.20.0260.00917.39
8.2.10.0260.01017.51
8.2.00.0330.01017.72
8.1.340.0120.00817.55

preferences:
55.55 ms | 403 KiB | 5 Q