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.4.120.0040.00422.23
8.4.110.0090.01218.83
8.4.100.0140.00617.90
8.4.90.0050.00420.35
8.4.80.0110.00920.67
8.4.70.0100.01120.42
8.4.60.0110.01020.31
8.4.50.0070.00218.68
8.4.40.0140.00717.92
8.4.30.0070.01320.55
8.4.20.0120.00919.56
8.4.10.0190.00319.42
8.3.250.0120.00718.74
8.3.240.0130.00616.32
8.3.230.0050.00416.64
8.3.220.0130.00518.97
8.3.210.0050.00216.39
8.3.200.0050.00416.44
8.3.190.0020.00619.12
8.3.180.0120.00718.92
8.3.170.0030.01217.22
8.3.160.0120.00618.89
8.3.150.0130.00616.71
8.3.140.0000.00816.67
8.3.130.0080.00518.20
8.3.120.0090.00020.56
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.290.0140.00619.10
8.2.280.0100.01019.84
8.2.270.0050.00318.23
8.2.260.0110.00316.61
8.2.250.0100.01016.56
8.2.240.0040.00417.23
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.330.0130.00616.32
8.1.320.0120.00615.95
8.1.310.0120.00617.92
8.1.300.0090.00015.96
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:
27.48 ms | 403 KiB | 5 Q