3v4l.org

run code in 500+ PHP versions simultaneously
<?php // continuing with complex anagrams // if we have "babc" and we want a signature for this to get // --> [1, 2, 1, 0, 0, 0, ... , 0] function buildingSignature($input) { $signature = array_fill(0, 26, 0); $input = strtolower($input); for ($i = 0; $i < strlen($input); $i++) { $char = $input[$i]; $signature[ord($char) - ord('a')] += 1; } return $signature; } var_dump(buildingSignature("babc"));die;

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.0290.01016.66
8.5.60.0250.01016.70
8.5.50.0250.00816.62
8.5.40.0210.00616.63
8.5.30.0170.00216.57
8.5.20.0170.00516.41
8.5.10.0200.00316.82
8.5.00.0040.00316.82
8.4.220.0050.00419.80
8.4.210.0120.00619.51
8.4.200.0140.00519.47
8.4.190.0140.00419.48
8.4.180.0130.00619.55
8.4.170.0140.00419.57
8.4.160.0170.00419.80
8.4.150.0140.00419.86
8.4.140.0170.00517.30
8.4.130.0150.00417.26
8.4.120.0190.00617.67
8.4.110.0130.00617.84
8.4.100.0140.00617.64
8.4.90.0140.00417.72
8.4.80.0230.00217.81
8.4.70.0150.00617.61
8.4.60.0130.00817.72
8.4.50.0160.00417.57
8.4.40.0180.00217.75
8.4.30.0150.00617.56
8.4.20.0150.00618.01
8.4.10.0160.00417.69
8.3.310.0160.00418.39
8.3.300.0150.00518.18
8.3.290.0180.00118.20
8.3.280.0180.00518.25
8.3.270.0250.00616.52
8.3.260.0180.00216.51
8.3.250.0240.00816.61
8.3.240.0210.00416.49
8.3.230.0210.00616.52
8.3.220.0200.00616.55
8.3.210.0140.00616.36
8.3.200.0150.00316.80
8.3.190.0150.00516.59
8.3.180.0140.00316.35
8.3.170.0150.00316.71
8.3.160.0180.00316.57
8.3.150.0170.00316.81
8.3.140.0160.00516.46
8.3.130.0150.00216.52
8.3.120.0140.00316.51
8.3.110.0140.00416.60
8.3.100.0170.00416.66
8.3.90.0190.00016.56
8.3.80.0190.00116.67
8.3.70.0140.00416.35
8.3.60.0170.00416.61
8.3.50.0150.00416.64
8.3.40.0180.00217.82
8.3.30.0110.00417.87
8.3.20.0140.00317.76
8.3.10.0130.00517.88
8.3.00.0140.00317.60
8.2.310.0130.00617.73

preferences:
43.55 ms | 776 KiB | 5 Q