3v4l.org

run code in 300+ PHP versions simultaneously
<?php class LuckyNumbers { public function sumUp(array $digitsOfNumber1, array $digitsOfNumber2): int { $convNum1 = (int) implode($digitsOfNumber1); $convNum2 = (int) implode($digitsOfNumber2); return $convNum1+ $convNum2; throw new \BadFunctionCallException("Implement the function"); } public function isPalindrome(int $number): bool { // Reversing steps:- $numberString = (string) $number; $reverseNumberString = strrev($numberString); $reverseNumber = (int) $reverseNumberString; return $number == $reverseNumber; throw new \BadFunctionCallException("Implement the function"); } public function validate(string $input): string { if ($input <= 0) { echo "Must be a whole number larger than 0"; } if ($input == '') { echo "Required field"; } } } $lucky_numbers = new LuckyNumbers(); $lucky_numbers->validate('123');

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.130.0330.00916.49
8.3.120.0380.00316.52
8.3.110.0350.00616.18
8.3.100.0430.00716.73
8.3.90.0360.00016.23
8.3.80.0360.00416.57
8.3.70.0270.01016.48
8.3.60.0210.00516.60
8.3.50.0210.00416.61
8.3.40.0160.00417.44
8.3.30.0180.00017.40
8.3.20.0150.00417.56
8.3.10.0160.00317.26
8.3.00.0100.00017.66
8.2.250.0170.00016.61
8.2.240.0150.00416.47
8.2.230.0130.00516.57
8.2.220.0150.00916.50
8.2.210.0160.00916.62
8.2.200.0160.01316.27
8.2.190.0210.00316.63
8.2.180.0140.01116.41
8.2.170.0270.00017.66
8.2.160.0210.01217.72
8.2.150.0310.00817.48
8.2.140.0310.00717.59
8.2.130.0320.01117.34
8.2.120.0300.01117.73
8.2.110.0290.01017.50
8.2.100.0370.00317.73
8.2.90.0360.00317.56
8.2.80.0300.01017.68
8.2.70.0490.00717.26
8.2.60.0370.00417.48
8.2.50.0290.00617.77
8.2.40.0100.01017.69
8.2.30.0140.00417.38
8.2.20.0090.00917.21
8.2.10.0130.00417.40
8.2.00.0080.00817.62
8.1.300.0170.01116.27
8.1.290.0310.00616.29
8.1.280.0400.00016.18
8.1.270.0290.00617.27
8.1.260.0370.00717.31
8.1.250.0400.00417.34
8.1.240.0400.00717.09
8.1.230.0380.00417.19
8.1.220.0300.01017.18
8.1.210.0320.00717.04
8.1.200.0330.00717.26
8.1.190.0320.00616.96
8.1.180.0290.00717.24
8.1.170.0290.00617.06
8.1.160.0330.00317.17
8.1.150.0340.00417.33
8.1.140.0320.00617.29
8.1.130.0320.00917.17
8.1.120.0310.00617.36
8.1.110.0190.01317.26
8.1.100.0260.00317.27
8.1.90.0280.00417.38
8.1.80.0370.00516.86
8.1.70.0310.01017.14
8.1.60.0360.00317.32
8.1.50.0370.00317.45
8.1.40.0320.00717.36
8.1.30.0270.01217.57
8.1.20.0390.00017.51
8.1.10.0190.00917.44
8.1.00.0070.01117.30

preferences:
27.6 ms | 403 KiB | 5 Q