3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = [ 'ip' => '127.0.0.1', 'hostname' => 'localhost', 'ipport' => '127.0.0.1:3307', 'hostname' => 'localhost:3308', 'ipv6' => '[2001:0DB8::1234]', 'ipv6port' => '[2001:0DB8::1234]:3309', ]; foreach($values as $k=>$hostport) { $host = 'not found'; $port = 'not found'; // has port or ipv6 if (strpos($hostport, ':')) { // ipv6 if (str_starts_with($hostport, '[')) { $portposition = strpos($hostport,']:'); if ($portposition) { $port = substr($hostport, $portposition+2); $host = substr($hostport, 0, $portposition+1); } else { $host = $hostport; } } else { [$host, $port] = explode(':', $hostport); } } else { $host = $hostport; // ipv4/domainname without port } echo $k .': Hostname: ' . $host . ' Port: ' . $port ."\n"; }

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.110.0310.01022.58
8.3.100.0360.01122.58
8.3.90.0430.00622.58
8.3.80.0400.00922.58
8.3.70.0300.01922.58
8.3.60.0420.00622.58
8.3.50.0460.00322.58
8.3.40.0420.00022.58
8.3.30.0320.00922.58
8.3.20.0270.01322.58
8.3.10.0290.01122.58
8.3.00.0150.00822.58
8.2.230.0270.01022.58
8.2.220.0310.00622.58
8.2.210.0280.01122.58
8.2.200.0330.00722.58
8.2.190.0310.01022.58
8.2.180.0340.00722.58
8.2.170.0340.01022.58
8.2.160.0360.01022.58
8.2.150.0440.00022.58
8.2.140.0330.00922.58
8.2.130.0380.00722.58
8.2.120.0380.00322.58
8.2.110.0400.00922.58
8.2.100.0390.00022.58
8.2.90.0260.00022.58
8.2.80.0250.01022.58
8.2.70.0330.01022.58
8.2.60.0340.00722.58
8.2.50.0370.00722.58
8.2.40.0370.00422.58
8.2.30.0330.00422.58
8.2.20.0250.00322.58
8.2.10.0290.00022.58
8.2.00.0360.00822.58
8.1.290.0340.00722.58
8.1.280.0360.00722.58
8.1.270.0310.00822.58
8.1.260.0390.00422.58
8.1.250.0330.01322.58
8.1.240.0360.00822.58
8.1.230.0350.01222.58
8.1.220.0400.00322.58
8.1.210.0380.00422.58
8.1.200.0290.00722.58
8.1.190.0280.00322.58
8.1.180.0280.00422.58
8.1.170.0360.00722.58
8.1.160.0210.01422.58
8.1.150.0250.00922.58
8.1.140.0220.00422.58
8.1.130.0280.00322.58
8.1.120.0220.00322.58
8.1.110.0430.00422.58
8.1.100.0390.00722.58
8.1.90.0290.01022.58
8.1.80.0340.00422.58
8.1.70.0270.01222.58
8.1.60.0300.01322.58
8.1.50.0350.00822.58
8.1.40.0320.01222.58
8.1.30.0380.00422.58
8.1.20.0440.00422.58
8.1.10.0310.01122.58
8.1.00.0300.00822.58

preferences:
30.3 ms | 403 KiB | 5 Q