3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRange($ip) { $split = explode('.',$ip); $final = array(); foreach ($split as $block) { $pos = strpos($block, '*'); if ($pos !== false) { $num = substr($block, 0, $pos) $l = strlen($block); $min = (int) str_pad($num,3,'0'); $max = (int) min(255,str_pad($num,3,'9')); $minip = $final; $minip[] = $min; $minip = array_pad($minip, 4, 0); $maxip = $final; $maxip[] = $max; $maxip = array_pad($maxip, 4, 255); return array(implode('.',$minip),implode('.',$maxip)); } $final[] = $block; } return array(implode('.',$final),implode('.',$final)); // No range found. } print_R(getRange("255.55.0.1"));

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)
5.4.110.0140.04312.00
5.4.100.0210.05712.00
5.4.90.0120.04412.00
5.4.80.0220.06812.00
5.4.70.0120.04412.00
5.4.60.0170.03912.00
5.4.50.0140.04312.00
5.4.40.0120.04411.98
5.4.30.0210.05211.98
5.4.20.0130.04311.98
5.4.10.0110.04511.98
5.4.00.0140.04311.47
5.3.210.0140.06112.68
5.3.200.0180.04212.68
5.3.190.0120.04912.68
5.3.180.0240.06512.67
5.3.170.0130.04512.66
5.3.160.0130.04612.67
5.3.150.0170.04512.67
5.3.140.0180.04512.66
5.3.130.0270.06412.66
5.3.120.0150.04612.66
5.3.110.0180.04512.66
5.3.100.0230.07012.12
5.3.90.0230.06812.09
5.3.80.0140.04612.07
5.3.70.0160.04612.08
5.3.60.0250.08212.06
5.3.50.0220.06712.01
5.3.40.0180.04012.01
5.3.30.0140.04211.98
5.3.20.0190.04011.76
5.3.10.0130.04311.71
5.3.00.0180.03911.70

preferences:
139.32 ms | 1394 KiB | 7 Q