3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ping($host, $port, $timeout) { $tB = microtime(true); $fP = fSockOpen($host, $port, $errno, $errstr, $timeout); if (!$fP) { return "down"; } $tA = microtime(true); return round((($tA - $tB) * 1000), 0)." ms"; } //Echoing it will display the ping if the host is up, if not it'll say "down". echo ping("www.google.com", 80, 10);

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)
7.2.00.0000.01519.68
7.1.70.0070.00317.50
7.1.60.0030.02319.40
7.1.50.0060.00617.41
7.1.00.0030.03322.95
7.0.200.0050.00517.00
7.0.140.0130.06322.64
7.0.120.0030.06722.45
7.0.60.0100.07020.46
7.0.50.0000.05018.17
7.0.40.0070.04020.51
7.0.30.0270.08320.58
7.0.20.0200.07720.46
7.0.10.0200.05020.47
7.0.00.0070.05020.50
5.6.280.0070.07321.33
5.6.210.0100.06021.14
5.6.200.0030.08718.46
5.6.190.0130.08021.11
5.6.180.0330.05021.07
5.6.170.0170.05320.81
5.6.160.0030.09020.81
5.6.150.0070.08018.57
5.6.140.0130.08018.51
5.6.130.0000.04318.44
5.6.120.0170.06721.33
5.6.110.0130.07021.34
5.6.100.0100.06021.51
5.6.90.0070.07021.42
5.6.80.0100.05720.72
5.6.70.0230.04020.75
5.5.350.0370.07720.86
5.5.340.0100.07318.26
5.5.330.0070.04320.83
5.5.320.0230.07020.93
5.5.310.0230.03720.65
5.5.300.0100.03318.18
5.5.290.0070.04018.40
5.5.280.0030.07321.15
5.5.270.0070.09021.00
5.5.260.0200.07021.14
5.5.250.0030.04021.07
5.5.240.0100.08020.42
5.4.450.0070.06320.05
5.4.440.0200.06020.11
5.4.430.0100.06019.83
5.4.420.0070.06320.01
5.4.410.0070.06019.81
5.4.400.0030.05319.70
5.4.390.0070.06319.84
5.4.380.0030.07319.54
5.4.370.0000.08719.62
5.4.360.0030.04719.70
5.4.350.0030.07019.68
5.4.340.0130.07019.54
5.4.320.0070.08019.61
5.4.310.0100.04319.84
5.4.300.0030.08319.46
5.4.290.0230.06019.75
5.4.280.0000.08719.71
5.4.270.0130.04019.59
5.4.260.0170.04319.52
5.4.250.0070.07719.53
5.4.240.0070.07019.64
5.4.230.0070.07719.61
5.4.220.0000.07319.59
5.4.210.0130.07019.83
5.4.200.0130.06719.54
5.4.190.0030.04019.61
5.4.180.0070.06319.61
5.4.170.0100.04719.55
5.4.160.0100.07719.45
5.4.150.0100.07719.43
5.4.140.0030.05016.98
5.4.130.0000.06016.95
5.4.120.0030.05716.84
5.4.110.0070.07316.96
5.4.100.0070.05317.00
5.4.90.0130.06316.97
5.4.80.0100.06017.18
5.4.70.0070.04317.02
5.4.60.0030.05016.90
5.4.50.0030.03717.03
5.4.40.0030.05016.93
5.4.30.0070.03316.95
5.4.20.0070.03317.08
5.4.10.0100.07316.93
5.4.00.0070.06716.36
5.3.290.0000.09014.99
5.3.280.0070.07314.97
5.3.270.0070.07314.89
5.3.260.0030.04715.02
5.3.250.0000.08314.96
5.3.240.0030.08014.88
5.3.230.0130.06714.91
5.3.220.0070.07714.98
5.3.210.0030.04314.88
5.3.200.0030.07714.86
5.3.190.0030.04315.04
5.3.180.0000.04015.00
5.3.170.0030.04014.88
5.3.160.0070.03715.00
5.3.150.0070.03714.97
5.3.140.0170.06314.99
5.3.130.0170.06314.98
5.3.120.0070.05014.91
5.3.110.0100.03314.87
5.3.100.0070.05714.48
5.3.90.0000.05314.43
5.3.80.0070.05714.41
5.3.70.0130.06714.32
5.3.60.0070.07714.48
5.3.50.0070.03714.36
5.3.40.0130.06714.40
5.3.30.0030.08014.36
5.3.20.0030.04714.01
5.3.10.0030.03714.07
5.3.00.0100.05314.11
5.2.170.0070.05711.59
5.2.160.0000.06711.45
5.2.150.0100.05711.51
5.2.140.0130.04311.57
5.2.130.0130.05711.54
5.2.120.0070.03011.54
5.2.110.0030.06311.46
5.2.100.0170.05311.54
5.2.90.0030.03011.41
5.2.80.0030.03711.53
5.2.70.0070.02711.48
5.2.60.0070.03711.43
5.2.50.0000.03311.37
5.2.40.0100.05711.34
5.2.30.0030.03711.37
5.2.20.0070.05711.38
5.2.10.0100.04311.23
5.2.00.0070.04011.14
5.1.60.0000.05310.43
5.1.50.0070.05310.45
5.1.40.0100.05010.35
5.1.30.0070.03310.75
5.1.20.0100.05310.69
5.1.10.0070.05710.50
5.1.00.0070.03010.39
5.0.50.0000.0278.81
5.0.40.0030.0208.77
5.0.30.0100.0408.46
5.0.20.0000.0308.66
5.0.10.0030.0278.49
5.0.00.0030.0438.47
4.4.90.0030.0138.29
4.4.80.0000.0378.29
4.4.70.0000.0378.29
4.4.60.0070.0338.29
4.4.50.0000.0438.29
4.4.40.0070.0408.29
4.4.30.0000.0308.29
4.4.20.0070.0178.29
4.4.10.0070.0178.29
4.4.00.0000.0278.29
4.3.110.0000.0178.29
4.3.100.0000.0208.29
4.3.90.0030.0238.29
4.3.80.0100.0238.29
4.3.70.0070.0208.29
4.3.60.0100.0138.29
4.3.50.0030.0338.29
4.3.40.0000.0308.29
4.3.30.0000.0178.29
4.3.20.0000.0278.29
4.3.10.0030.0278.29
4.3.00.0000.0238.29

preferences:
32.42 ms | 400 KiB | 5 Q