3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class R { function isError(): bool { return true; } } class S { function doSomething($input): R { return new R; } } function needBool(bool $b) { var_dump($b); } $input = "str"; $service = new S; $shouldStop = ($result = $service->doSomething($input)) && $result->isError(); needBool($shouldStop);

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.140.0120.01417.56
8.4.130.0090.01017.73
8.4.120.0100.00124.07
8.4.110.0040.00623.34
8.4.100.0250.00718.54
8.4.90.0100.00620.37
8.4.80.0110.00517.75
8.4.70.0210.00717.54
8.4.60.0260.00717.75
8.4.50.0250.00517.79
8.4.40.0320.00617.65
8.4.30.0320.00717.39
8.4.20.0300.00818.44
8.4.10.0260.00817.38
8.3.270.0130.00816.66
8.3.260.0110.00917.20
8.3.250.0120.00718.76
8.3.240.0080.00817.22
8.3.230.0210.00616.73
8.3.220.0210.00716.42
8.3.210.0280.00616.48
8.3.200.0270.00616.61
8.3.190.0210.00516.30
8.3.180.0260.00516.54
8.3.170.0180.00516.44
8.3.160.0300.00616.47
8.3.150.0250.00916.42
8.3.140.0210.00616.46
8.3.130.0160.00416.68
8.3.120.0180.00616.50
8.3.110.0170.00316.60
8.3.100.0190.00416.43
8.3.90.0180.00416.55
8.3.80.0270.00516.32
8.3.70.0230.00416.58
8.3.60.0320.00516.35
8.3.50.0270.00916.33
8.3.40.0270.00717.56
8.3.30.0230.00717.45
8.3.20.0250.00617.44
8.3.10.0220.00917.46
8.3.00.0090.00717.55
8.2.290.0090.00416.66
8.2.280.0180.00316.77
8.2.270.0250.00816.40
8.2.260.0220.00716.62
8.2.250.0250.00616.46
8.2.240.0250.00616.36
8.2.230.0250.00516.23
8.2.220.0250.00616.61
8.2.210.0250.00616.37
8.2.200.0240.00716.49
8.2.190.0250.00616.31
8.2.180.0230.00716.52
8.2.170.0250.00817.70
8.2.160.0270.00517.66
8.2.150.0220.00817.60
8.2.140.0250.00617.38
8.2.130.0180.00717.72
8.2.120.0270.00817.56
8.2.110.0260.00617.32
8.2.100.0280.00317.48
8.2.90.0270.00417.51
8.2.80.0280.00617.34
8.2.70.0230.00517.40
8.2.60.0240.00617.49
8.2.50.0170.00517.52
8.2.40.0190.00517.47
8.2.30.0230.00617.29
8.2.20.0230.00617.40
8.2.10.0230.00417.31
8.2.00.0150.00317.57

preferences:
26.79 ms | 403 KiB | 5 Q