3v4l.org

run code in 300+ PHP versions simultaneously
<?php // https://github.com/bootgly/bootgly/blob/c54e0d585869dca734d301000cee79401640e749/Bootgly/CLI/Terminal/Output/Text.php#L329-L336 // https://github.com/bootgly/bootgly/blob/c54e0d585869dca734d301000cee79401640e749/Bootgly/ABI/Configs/Set.php#L14-L26 enum Colors : int { public function __call(string $name, array $arguments) { static $value; return match ($name) { 'get' => $value ?? $this, // $this->value; 'set' => $value = $this, // $this->value = $this; // @ PHP team: Why readonly here??? default => $this }; } case Default = 1; case Bright = 2; } function printSomething(Colors $colors, string $message): void { echo sprintf("I will print %s in %s colors\n", $message, $colors->get()->name); } Colors::Default->set(); printSomething(Colors::Bright, 'Hello World'); Colors::Bright->set(); printSomething(Colors::Default, 'Hello World');

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.120.0110.01218.90
8.4.110.0080.00118.81
8.4.100.0120.00917.59
8.4.90.0160.00620.73
8.4.80.0060.00320.56
8.4.70.0080.00918.70
8.4.60.0080.01220.93
8.4.50.0100.00822.22
8.4.40.0180.00417.86
8.4.30.0040.00420.68
8.4.20.0130.00717.63
8.4.10.0080.00019.39
8.3.250.0100.01016.56
8.3.240.0130.00616.54
8.3.230.0080.00216.62
8.3.220.0120.00618.85
8.3.210.0100.00816.76
8.3.200.0060.00316.52
8.3.190.0120.00717.04
8.3.180.0110.00918.80
8.3.170.0140.00417.00
8.3.160.0070.01116.56
8.3.150.0080.01117.40
8.3.140.0040.00416.56
8.3.130.0060.00318.41
8.3.120.0090.00019.00
8.3.110.0030.00516.45
8.3.100.0210.00018.12
8.3.50.0080.00016.63
8.2.290.0050.00617.44
8.2.280.0030.00519.98
8.2.270.0090.00916.42
8.2.260.0040.00417.16
8.2.250.0000.00816.57
8.2.240.0030.00517.17
8.2.230.0050.00316.63
8.2.220.0070.00716.31
8.2.110.0130.00622.26
8.2.100.0180.00420.52
8.2.90.0110.01120.51
8.2.80.0120.00920.45
8.2.70.0170.00720.27
8.2.60.0070.01120.34
8.2.50.0000.01220.50
8.2.40.0030.00720.61
8.2.30.0080.00320.57
8.2.20.0030.00620.51
8.2.10.0110.00020.66
8.2.00.0030.00720.76
8.1.330.0090.01015.85
8.1.320.0130.00516.06
8.1.310.0040.00416.54
8.1.300.0000.00818.50
8.1.240.0070.00320.26
8.1.230.0030.00720.35
8.1.220.0040.00720.35
8.1.210.0000.01021.69
8.1.200.0050.00520.35
8.1.190.0060.00320.16
8.1.180.0050.00520.16
8.1.170.0030.00720.18
8.1.160.0090.00020.70
8.1.150.0090.00020.41
8.1.140.0070.00320.15
8.1.130.0080.00320.30
8.1.120.0100.00020.43
8.1.110.0030.00718.66
8.1.100.0030.00618.61
8.1.90.0030.00618.54
8.1.80.0070.00318.59
8.1.70.0120.00018.91
8.1.60.0060.00318.75
8.1.50.0060.00320.41
8.1.40.0110.00020.63
8.1.30.0000.01020.84
8.1.20.0190.00320.47
8.1.10.0090.00620.56
8.1.00.0070.00320.48
8.0.300.0140.00719.75
8.0.290.0060.00319.72
8.0.280.0080.00419.72
8.0.270.0160.00319.60
8.0.260.0090.00019.69
8.0.250.0030.00619.82
8.0.240.0060.00319.73
8.0.230.0030.00620.13
8.0.220.0030.00619.64
8.0.210.0030.00619.73
8.0.200.0030.00619.73
8.0.190.0060.00319.72
8.0.180.0000.00919.87
8.0.170.0090.00019.74
8.0.160.0030.00619.82
8.0.150.0070.00319.37
8.0.140.0090.00019.55
8.0.130.0090.00017.81
8.0.120.0060.00317.88
8.0.110.0040.00418.06
8.0.100.0040.00417.88
8.0.90.0090.00017.75
8.0.80.0060.00317.83
8.0.70.0110.00317.75
8.0.60.0100.01017.51
8.0.50.0070.00317.88
8.0.30.0060.00317.92
8.0.20.0070.01417.91
8.0.10.0060.00317.92

preferences:
27.2 ms | 403 KiB | 5 Q