3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hydratePath(array $result, ?string $path): array { if (sscanf($path ?? '', '%[^/]/%s', $first, $rest) < 2) { $result[] = $first ?? $path; } else { $result[$first] ??= []; $result[$first] = (__FUNCTION__)($result[$first], $rest); } return $result; } $array = [ 'invoice/products/data/item1', '', null, 'invoice/products/data/item2', 'invoice/products/filename', 'invoice/products/data/item2', 'foo/bar/baz', '', 'aaa/bbb' ]; var_export(array_reduce($array, "hydratePath", []));

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.00.0120.01019.99
8.4.150.0020.00014.05
8.4.140.0140.00817.59
8.4.130.0060.00719.47
8.4.120.0140.00620.59
8.4.110.0090.01122.45
8.4.100.0170.00418.48
8.4.90.0060.00518.73
8.4.80.0130.00718.77
8.4.70.0110.00917.70
8.4.60.0060.00918.64
8.4.50.0110.00518.63
8.4.40.0100.01017.54
8.4.30.0030.00618.76
8.4.20.0130.00618.04
8.4.10.0060.00319.57
8.3.280.0090.00118.31
8.3.270.0110.00816.43
8.3.260.0100.00916.50
8.3.250.0070.00118.99
8.3.240.0080.00717.19
8.3.230.0070.00516.73
8.3.220.0060.01219.01
8.3.210.0050.00218.37
8.3.200.0050.00416.56
8.3.190.0100.00916.86
8.3.180.0120.00616.84
8.3.170.0070.01120.82
8.3.160.0040.00418.63
8.3.150.0040.01417.18
8.3.140.0040.00416.79
8.3.130.0040.00418.50
8.3.120.0060.00318.82
8.3.110.0060.00320.94
8.3.100.0090.00324.06
8.3.90.0000.01526.77
8.3.80.0000.01118.30
8.3.70.0140.00018.06
8.3.60.0070.00718.10
8.3.50.0220.00016.75
8.3.40.0190.00021.83
8.3.30.0030.01321.93
8.3.20.0180.00325.66
8.3.10.0100.01025.66
8.3.00.0090.00925.66
8.2.290.0090.01020.54
8.2.280.0100.00918.33
8.2.270.0070.00716.81
8.2.260.0090.00918.39
8.2.250.0100.01016.50
8.2.240.0000.00916.95
8.2.230.0070.01022.58
8.2.220.0000.00837.54
8.2.210.0050.00326.77
8.2.200.0000.00918.54
8.2.190.0100.00716.58
8.2.180.0110.00716.50
8.2.170.0120.00619.13
8.2.160.0100.00522.96
8.2.150.0100.00725.66
8.2.140.0140.00725.66
8.2.130.0140.00325.66
8.2.120.0070.01125.66
8.2.110.0070.01025.66
8.2.100.0190.00325.66
8.2.90.0100.01025.66
8.2.80.0070.01425.66
8.2.70.0120.00325.66
8.2.60.0110.00425.66
8.2.50.0060.00925.66
8.2.40.0120.00325.66
8.2.30.0120.00425.66
8.2.20.0150.00025.66
8.2.10.0000.01525.66
8.2.00.0110.00425.66
8.1.330.0120.00621.69
8.1.320.0110.00916.13
8.1.310.0040.00417.86
8.1.300.0000.01518.60
8.1.290.0070.00718.88
8.1.280.0070.00725.92
8.1.270.0140.00025.66
8.1.260.0110.00425.66
8.1.250.0100.00325.66
8.1.240.0000.01525.66
8.1.230.0130.00925.66
8.1.220.0100.00725.66
8.1.210.0150.00325.66
8.1.200.0150.00425.66
8.1.190.0070.00725.66
8.1.180.0080.00825.66
8.1.170.0120.00325.66
8.1.160.0150.00025.66
8.1.150.0090.00625.66
8.1.140.0110.00425.66
8.1.130.0120.00325.66
8.1.120.0100.00625.66
8.1.110.0150.00025.66
8.1.100.0120.00425.66
8.1.90.0090.00925.66
8.1.80.0130.00625.66
8.1.70.0030.01425.66
8.1.60.0120.00325.66
8.1.50.0080.00825.66
8.1.40.0060.01225.66
8.1.30.0070.01025.66
8.1.20.0130.00725.66
8.1.10.0040.01525.66
8.1.00.0120.00325.66

preferences:
395.09 ms | 403 KiB | 5 Q