3v4l.org

run code in 300+ PHP versions simultaneously
<?php // your code goes here $ip = "40.83.109.202"; $start = microtime(true); $ipchk = !!preg_match("/^(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/", $ip); $end = microtime(true); $start2 = microtime(true); $ipchk2 = !!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4); $end2 = microtime(true); echo "preg_match:\n"; echo var_export($ipchk, true) . "\n"; echo ($end - $start) * 1000; echo "\n"; echo "filter_var:\n"; echo var_export($ipchk2, true) . "\n"; echo ($end2 - $start2) * 1000;

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.0.00.0130.00717.07
7.4.130.0090.00916.63
7.4.120.0220.00316.64
7.4.110.0110.00716.78
7.4.100.0060.01216.71
7.4.90.0140.00416.48
7.4.80.0090.00916.44
7.4.70.0100.01316.67
7.4.60.0200.00516.55
7.4.50.0120.00616.75
7.4.40.0140.01116.65
7.4.30.0120.00616.59
7.4.20.0110.00716.48
7.4.10.0140.00516.55
7.4.00.0150.00716.67
7.3.250.0090.00916.39
7.3.240.0110.00816.78
7.3.230.0030.02016.39
7.3.220.0070.01716.64
7.3.210.0090.00916.68
7.3.200.0080.00916.68
7.3.190.0040.01516.88
7.3.180.0070.01116.68
7.3.170.0180.00316.30
7.3.160.0160.00316.57
7.3.150.0030.01416.56
7.3.140.0120.00916.59
7.3.130.0140.01116.49
7.3.120.0110.00716.73
7.3.110.0140.01116.42
7.3.100.0080.01216.63
7.3.90.0150.00416.73
7.3.80.0100.00816.32
7.3.70.0150.00616.48
7.3.60.0070.01016.48
7.3.50.0090.00816.39
7.3.40.0030.01316.54
7.3.30.0150.00316.43
7.3.20.0200.00616.56
7.3.10.0400.01416.73
7.3.00.0110.00716.40

preferences:
45.97 ms | 400 KiB | 5 Q