3v4l.org

run code in 500+ PHP versions simultaneously
<?php enum MethodConstraint :string { case A = "a"; case B = "b"; case C = "c"; public function getMethod(): string { return $this->value; } public function getMethodSentence($value): string { return match ($value) { MethodConstraint::A => "This is an A char", MethodConstraint::B => "This is a B char", MethodConstraint::C => "This is a C char" }; } public function getCharAndSentence(): string { return $this->getMethod()." ".$this->getMethodSentence($this); } } $aChar = MethodConstraint::A; echo $aChar->getMethod().PHP_EOL; echo $aChar->getMethodSentence(MethodConstraint::B).PHP_EOL; echo $aChar->getCharAndSentence();

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.70.0110.00616.84
8.5.60.0080.00816.83
8.5.50.0090.00816.64
8.5.30.0060.01219.32
8.5.20.0120.00620.10
8.5.10.0100.00716.46
8.5.00.0150.00621.66
8.4.210.0110.00719.53
8.4.180.0120.01119.76
8.4.170.0110.01123.89
8.4.160.0130.00823.89
8.4.150.0070.00716.94
8.4.140.0130.00917.48
8.4.130.0120.00918.97
8.4.120.0120.00824.24
8.4.110.0060.00320.70
8.4.100.0100.01018.96
8.4.90.0140.00520.58
8.4.80.0060.00718.77
8.4.70.0110.01117.89
8.4.60.0120.00918.92
8.4.50.0100.00718.59
8.4.40.0070.00717.80
8.4.30.0050.00318.93
8.4.20.0030.00619.70
8.4.10.0030.01219.33
8.3.300.0100.01020.69
8.3.290.0090.01220.66
8.3.280.0140.00718.36
8.3.270.0150.00416.49
8.3.260.0070.00216.69
8.3.250.0090.01018.86
8.3.240.0060.00317.23
8.3.230.0060.00416.41
8.3.220.0070.00218.79
8.3.210.0080.00818.46
8.3.200.0090.00616.69
8.3.190.0090.00917.07
8.3.180.0120.00717.19
8.3.170.0040.00419.04
8.3.160.0090.00916.61
8.3.150.0030.01117.01
8.3.140.0080.00016.77
8.3.130.0060.00318.27
8.3.120.0070.00319.02
8.3.110.0110.00816.34
8.3.100.0030.00616.55
8.3.80.0150.01130.84
8.3.70.0120.01530.84
8.3.60.0070.01430.84
8.3.50.0110.00630.84
8.3.40.0120.00630.84
8.3.30.0120.00630.84
8.3.20.0030.00730.84
8.3.10.0030.01030.84
8.3.00.0140.00030.84
8.2.300.0120.00818.11
8.2.290.0130.00520.30
8.2.280.0050.00318.28
8.2.270.0170.00017.20
8.2.260.0110.00718.37
8.2.250.0060.00616.80
8.2.240.0040.00418.70
8.2.230.0120.00316.49
8.2.220.0110.00316.69
8.2.200.0040.01130.84
8.2.190.0270.00630.84
8.2.180.0190.01430.84
8.2.170.0260.00330.84
8.2.160.0230.00030.84
8.2.150.0240.00030.84
8.2.140.0120.01230.84
8.2.130.0120.01230.84
8.2.120.0190.01030.84
8.2.110.0190.00530.84
8.2.100.0210.00530.84
8.2.90.0240.00030.84
8.2.80.0260.00330.84
8.2.70.0270.00030.84
8.2.60.0190.00330.84
8.2.50.0180.00430.84
8.2.40.0220.00030.84
8.2.30.0150.00630.84
8.2.20.0120.00830.84
8.2.10.0260.00030.84
8.2.00.0320.00030.84
8.1.340.0070.00217.73
8.1.330.0080.01121.91
8.1.320.0140.00520.37
8.1.310.0030.00618.47
8.1.300.0030.00618.30
8.1.290.0360.00430.84
8.1.280.0350.00730.84
8.1.270.0310.01030.84
8.1.260.0220.00730.84
8.1.250.0310.00430.84
8.1.240.0230.00030.84
8.1.230.0210.00830.84
8.1.220.0290.00930.84
8.1.210.0300.01030.84
8.1.200.0300.00830.84
8.1.190.0300.01030.84
8.1.180.0300.01030.84
8.1.170.0390.00030.84
8.1.160.0310.00630.84
8.1.150.0320.00430.84
8.1.140.0250.00430.84
8.1.130.0200.00730.84
8.1.120.0210.00930.84
8.1.110.0250.00630.84
8.1.100.0340.00330.84
8.1.90.0440.00330.84
8.1.80.0300.01030.84
8.1.70.0340.00730.84
8.1.60.0370.00730.84
8.1.50.0300.01230.84
8.1.40.0290.01330.84
8.1.30.0270.00730.84
8.1.20.0380.00330.84
8.1.10.0170.00930.84
8.1.00.0280.00730.84

preferences:
55.55 ms | 984 KiB | 5 Q