3v4l.org

run code in 300+ PHP versions simultaneously
function convertLHS( $lhs ) { global $x400Delimiter; $retval = ""; $eles = explode('.',$lhs ); $num = count($eles); if ( $num == 1) $retval = "S=" . strtoupper($eles[0]) . $x400Delimiter; if ( $num == 2) $retval = "S=" . strtoupper($eles[1]) . $x400Delimiter . "G=" . strtoupper($eles[0]) . $x400Delimiter; if ( $num > 2) $retval = "S=" . strtoupper($eles[$num-1]) . $x400Delimiter . getInitials($lhs) . "G=" . strtoupper($eles[0]) . $x400Delimiter; return $retval ; } // domain element // --------------------------------------- // Function Declaration // ---------------------------------------- // name: // does: // accepts: // returns: function convertSubDomain( $domain ) { global $x400Delimiter; $retval = ""; $eles = explode('.',$domain ); $num = count($eles); if ( $num == 1) return "OU=" . strtoupper($eles[0]) . $x400Delimiter; } // sort initials if they exist // --------------------------------------- // Function Declaration // ---------------------------------------- // name: // does: // accepts: // returns: function getInitials($lhs) { global $x400Delimiter; $retval = "I="; $eles = explode('.',$lhs ); $num = count($eles); for ($i=1;$i<$num-1;$i++) { $subStr = $eles[$i]; // test if multiple if (strlen($subStr) > 1) { $arr = str_split($subStr); $subStr = implode('.',$arr); } $retval .= strtoupper($subStr) . '.'; } return rtrim($retval,'.' ). $x400Delimiter; } // --------------------------------------- // Function Declaration // ---------------------------------------- // name: // does: // accepts: // returns: function normaliseX400($x400) { return $x400; } // get the posted search string $searchString = $_GET['searchStr']; $x400 = ""; try { global $x400Prefix; global $x400Postfix; $lhsrhs = explode("@",$searchString); $emailComps['domain'] = $lhsrhs[1]; $emailComps['name'] = $lhsrhs[0]; $emailComps['subdomain'] = explode(".x.gsi.gov.uk",$emailComps['domain'] )[0]; $x400 = normaliseX400 ( convertSubdomain($emailComps['subdomain'] ) . convertLHS($emailComps['name']) ); $x400 = $x400Prefix . $x400 . $x400Postfix; } catch (Exception $e) { throw new Exception( 'Failed to analyse email ['.$searchString.'] ', $e); } //print_r($emailComps); // output the basic html ?> <p>Found a [ <?php echo strtoupper($emailComps['subdomain']); ?> ] confidential other government department address in ( <?php echo $searchString ; ?> ).</p> <p>Click here to email: <a href= "mailto:%3C?php%20echo%20urlencode($x400);%20?%3E"> X.400 address for <?php echo $emailComps['name'] ?> </a><br></p> <address> <?php echo $x400 ?> </address>

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.60.0040.01116.63
8.3.50.0140.00417.17
8.3.40.0030.01418.82
8.3.30.0090.00618.80
8.3.20.0000.00818.90
8.3.10.0080.00018.73
8.3.00.0080.00019.25
8.2.180.0040.01416.75
8.2.170.0060.00922.96
8.2.160.0100.00718.80
8.2.150.0080.00824.18
8.2.140.0100.00324.66
8.2.130.0040.00426.16
8.2.120.0070.00020.86
8.2.110.0000.00922.11
8.2.100.0090.00317.64
8.2.90.0050.00317.75
8.2.80.0040.00418.91
8.2.70.0000.00817.63
8.2.60.0000.00817.75
8.2.50.0030.00617.75
8.2.40.0030.00517.75
8.2.30.0050.00517.76
8.2.20.0050.00617.75
8.2.10.0000.00817.64
8.2.00.0030.00717.86
8.1.280.0110.00725.92
8.1.270.0090.00023.99
8.1.260.0070.01026.35
8.1.250.0000.00728.09
8.1.240.0040.00723.70
8.1.230.0090.00321.04
8.1.220.0040.00418.52
8.1.210.0000.00818.77
8.1.200.0040.00417.10
8.1.190.0040.00417.28
8.1.180.0030.00618.10
8.1.170.0090.00018.48
8.1.160.0030.00618.52
8.1.150.0040.00418.51
8.1.140.0040.00417.38
8.1.130.0000.00717.33
8.1.120.0000.00817.30
8.1.110.0090.00017.36
8.1.100.0030.00317.17
8.1.90.0040.00417.35
8.1.80.0070.00017.36
8.1.70.0030.00317.22
8.1.60.0030.00617.45
8.1.50.0040.00417.21
8.1.40.0030.00517.29
8.1.30.0050.00317.40
8.1.20.0040.00417.54
8.1.10.0060.00317.55
8.1.00.0000.00817.46
8.0.300.0030.00518.77
8.0.290.0000.00816.63
8.0.280.0040.00417.93
8.0.270.0040.00417.19
8.0.260.0000.00816.77
8.0.250.0030.00716.91
8.0.240.0000.00817.00
8.0.230.0020.00516.91
8.0.220.0050.00316.80
8.0.210.0040.00416.73
8.0.200.0060.00316.92
8.0.190.0080.00016.78
8.0.180.0020.00516.86
8.0.170.0030.00616.89
8.0.160.0050.00216.87
8.0.150.0000.01016.88
8.0.140.0070.00316.66
8.0.130.0000.00513.27
8.0.120.0000.00816.68
8.0.110.0050.00316.71
8.0.100.0000.00816.73
8.0.90.0000.00816.86
8.0.80.0090.00616.73
8.0.70.0050.00216.83
8.0.60.0040.00416.69
8.0.50.0030.00516.79
8.0.30.0090.00916.83
8.0.20.0150.01017.14
8.0.10.0080.00016.88
8.0.00.0110.01016.73
7.4.330.0050.00012.84
7.4.320.0000.00616.38
7.4.300.0060.00016.41
7.4.290.0070.00016.33
7.4.280.0030.00516.49
7.4.270.0030.00316.41
7.4.260.0030.00313.27
7.4.250.0080.00016.48
7.4.240.0040.00416.51
7.4.230.0030.00516.48
7.4.220.0110.00716.27
7.4.210.0130.00316.57
7.4.200.0030.00316.55
7.4.190.0040.00416.55
7.4.160.0090.00916.53
7.4.150.0130.01016.54
7.4.140.0040.02117.86
7.4.130.0130.00616.58
7.4.120.0040.01316.35
7.4.110.0030.01916.46
7.4.100.0060.01216.41
7.4.90.0060.01416.47
7.4.80.0030.01419.39
7.4.70.0140.00316.39
7.4.60.0110.00416.41
7.4.50.0030.00315.95
7.4.40.0030.01416.44
7.4.30.0070.01416.66
7.4.00.0060.00914.89
7.3.330.0000.00613.23
7.3.320.0030.00313.05
7.3.310.0050.00216.42
7.3.300.0050.00216.35
7.3.290.0050.01016.36
7.3.280.0090.00616.38
7.3.270.0110.00616.70
7.3.260.0070.01516.39
7.3.240.0090.00616.71
7.3.230.0100.00616.56
7.3.210.0090.00916.46
7.3.200.0100.00716.66
7.3.190.0080.01316.45
7.3.180.0100.01016.57
7.3.170.0080.00816.55
7.3.160.0060.00916.22
7.3.120.0090.00614.72
7.2.330.0070.01116.61
7.2.320.0030.01316.61
7.2.310.0040.01316.69
7.2.300.0100.00616.66
7.2.290.0140.00316.70
7.2.110.0100.00316.32
7.2.60.0000.01516.79
7.2.00.0030.00919.32
7.1.200.0070.00715.79
7.1.100.0000.00818.13
7.1.70.0070.01017.02
7.1.60.0090.01619.25
7.1.50.0070.01416.92
7.1.00.0000.07722.57
7.0.200.0050.00316.77
7.0.140.0100.06721.99
7.0.120.0070.07022.02
7.0.60.0170.06319.96
7.0.50.0100.08017.89
7.0.40.0070.04717.79
7.0.30.0030.05317.75
7.0.20.0030.08317.65
7.0.10.0030.08317.70
7.0.00.0030.09017.72
5.6.280.0030.07020.92
5.6.210.0070.08320.50
5.6.200.0070.08318.21
5.6.190.0030.05318.13
5.6.180.0100.03318.18
5.6.170.0030.05018.17
5.6.160.0070.04018.09
5.6.150.0030.04318.21
5.6.140.0070.04718.07
5.6.130.0070.04318.11
5.6.120.0070.04318.14
5.6.110.0030.08318.18
5.6.100.0030.05718.17
5.6.90.0070.08718.20
5.6.80.0030.07717.50
5.6.70.0070.07017.60
5.6.60.0030.06717.49
5.6.50.0070.03717.50
5.6.40.0100.07317.52
5.6.30.0070.08017.44
5.6.20.0130.07017.57
5.6.10.0070.08017.46
5.6.00.0100.07717.50
5.5.350.0030.08320.38
5.5.340.0030.08317.96
5.5.330.0130.03017.92
5.5.320.0070.04017.98
5.5.310.0030.09017.96
5.5.300.0000.05717.98
5.5.290.0130.05717.95
5.5.280.0070.07317.98
5.5.270.0000.07717.91
5.5.260.0030.08317.95
5.5.250.0170.07017.68
5.5.240.0030.08317.34
5.5.230.0200.05717.36
5.5.220.0030.04717.23
5.5.210.0030.05017.34
5.5.200.0000.05017.36
5.5.190.0030.08017.37
5.5.180.0070.08017.27
5.5.160.0030.07717.34
5.5.150.0130.07017.36
5.5.140.0070.07717.27
5.5.130.0100.07317.29
5.5.120.0100.05317.28
5.5.110.0070.08017.36
5.5.100.0030.08317.28
5.5.90.0030.04017.26
5.5.80.0030.04017.14
5.5.70.0100.05717.13
5.5.60.0030.05317.16
5.5.50.0000.05717.16
5.5.40.0000.05317.25
5.5.30.0100.04017.20
5.5.20.0130.06717.16
5.5.10.0170.06317.22
5.5.00.0100.07717.18
5.4.450.0030.08319.15
5.4.440.0100.06319.35
5.4.430.0130.07319.48
5.4.420.0170.03019.30
5.4.410.0100.06719.10
5.4.400.0100.03319.09
5.4.390.0100.07719.11
5.4.380.0070.07718.82
5.4.370.0100.03318.98
5.4.360.0070.03719.14
5.4.350.0130.03719.01
5.4.340.0070.07318.97
5.4.320.0170.06019.01
5.4.310.0130.03318.97
5.4.300.0070.06018.96
5.4.290.0070.08319.09
5.4.280.0030.05319.09
5.4.270.0070.05019.11
5.4.260.0030.08018.97
5.4.250.0030.06718.96
5.4.240.0030.03719.06
5.4.230.0030.03719.13
5.4.220.0070.04018.97
5.4.210.0070.05318.97
5.4.200.0030.08018.97
5.4.190.0100.07018.95
5.4.180.0070.06318.96
5.4.170.0070.07719.10
5.4.160.0130.05319.18
5.4.150.0100.05318.98
5.4.140.0030.05716.32
5.4.130.0000.04016.44
5.4.120.0130.05716.30
5.4.110.0100.03016.36
5.4.100.0030.03716.27
5.4.90.0100.02716.37
5.4.80.0000.03716.31
5.4.70.0030.03316.26
5.4.60.0030.03316.50
5.4.50.0000.03716.39
5.4.40.0070.03016.54
5.4.30.0030.03716.30
5.4.20.0070.03016.39
5.4.10.0000.05016.27
5.4.00.0100.05715.73
5.3.290.0100.07314.49
5.3.280.0100.07314.55
5.3.270.0070.07014.54
5.3.260.0070.08014.68
5.3.250.0030.08014.44
5.3.240.0030.05714.55
5.3.230.0030.07714.59
5.3.220.0070.03314.52
5.3.210.0030.04014.48
5.3.200.0030.03714.53
5.3.190.0000.04014.54
5.3.180.0030.03314.39
5.3.170.0030.03714.49
5.3.160.0100.03314.55
5.3.150.0000.03714.55
5.3.140.0030.05014.54
5.3.130.0030.04014.37
5.3.120.0030.03714.50
5.3.110.0000.04014.32
5.3.100.0000.05714.01
5.3.90.0000.04313.98
5.3.80.0100.03013.95
5.3.70.0070.03313.95
5.3.60.0030.07313.75
5.3.50.0000.03713.88
5.3.40.0130.03013.91
5.3.30.0070.04313.84
5.3.20.0030.03313.67
5.3.10.0030.03313.73
5.3.00.0030.04013.62
5.2.170.0000.03011.10
5.2.160.0070.02711.05
5.2.150.0030.03311.12
5.2.140.0030.03011.04
5.2.130.0000.04311.07
5.2.120.0030.03011.25
5.2.110.0000.03011.13
5.2.100.0000.03310.93
5.2.90.0030.02711.13
5.2.80.0000.03310.95
5.2.70.0000.03011.04
5.2.60.0030.03010.88
5.2.50.0030.02711.05
5.2.40.0030.02310.96
5.2.30.0030.02710.93
5.2.20.0000.03010.91
5.2.10.0070.02310.75
5.2.00.0000.03310.61
5.1.60.0000.0279.97
5.1.50.0000.0279.93
5.1.40.0000.02310.00
5.1.30.0000.02710.36
5.1.20.0070.02010.38
5.1.10.0030.0239.98
5.1.00.0000.0279.89
5.0.50.0000.0208.50
5.0.40.0000.0208.42
5.0.30.0030.0308.29
5.0.20.0030.0178.22
5.0.10.0000.0208.19
5.0.00.0000.0308.18
4.4.90.0000.0178.10
4.4.80.0000.0138.10
4.4.70.0030.0138.10
4.4.60.0000.0178.10
4.4.50.0000.0138.10
4.4.40.0000.0308.10
4.4.30.0000.0138.10
4.4.20.0030.0138.10
4.4.10.0000.0178.10
4.4.00.0000.0238.10
4.3.110.0000.0138.10
4.3.100.0000.0138.10
4.3.90.0000.0138.10
4.3.80.0000.0238.10
4.3.70.0000.0138.10
4.3.60.0000.0178.10
4.3.50.0000.0138.10
4.3.40.0030.0208.10
4.3.30.0000.0378.10
4.3.20.0000.0338.10
4.3.10.0030.0308.10
4.3.00.0030.0208.10

preferences:
52.36 ms | 401 KiB | 5 Q