3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Simplify { public static function URL($input) { // Alleen 5.4.0 en hoger!! return rtrim(preg_replace('/([^a-z0-9]+)/', '-', strtolower(preg_replace("/&([a-z])[a-z]+;/i", "$1", htmlentities($input)))), '-'); } public static function SSL() { // Reminder; controle op poort bijbouwen. return (isset( $_SERVER['HTTPS'] ) && !empty( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] !== 'off' ? TRUE : FALSE); } public static function NoVarnish() { if (!headers_sent()) { header("Expires: Mon, 26 Jul 1990 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); return TRUE; } else { return FALSE; } } public static function CheckEmail($email) { // Reminder; even uitzoeken of filter_var wel beste oplossing is, misschien toch een preg_match? return (bool) filter_var($email, FILTER_VALIDATE_EMAIL); } public static function CreateLinks($text) { // Zoeken naar url's en deze klikbaar maken met preg replace. return preg_replace('@(https?://([-\w.]+[-\w])+(:\d+)?(/([\w-.~:/?#\[\]\@!$&\'()*+,;=%]*)?)?)@', '<a href="$1" target="_blank">$1</a>', $text); } public static function ThisURL() { $url = ''; // Is ssl? Gebruik https ipv http if (self::SSL()) { $url .= 'https://'; } else { $url .= 'http://'; } $url .= $_SERVER['HTTP_HOST']; // Wanneer niet poort 80, de poort meenemen in url if ( $_SERVER['SERVER_PORT'] != 80 ) { $url .= ':' . $_SERVER['SERVER_PORT']; } // Is er een pad? if (!isset( $_SERVER['REQUEST_URI'])) { $url .= substr( $_SERVER['PHP_SELF'], 1 ); if (isset($_SERVER['QUERY_STRING'])) { $url .= '?' . $_SERVER['QUERY_STRING']; } } else { $url .= $_SERVER['REQUEST_URI']; } return $url; } public static function Random($max = 5) { // Random string van X karakters lang return substr(md5(microtime()),rand(0,26),$max); } public static function DownloadImage($url, $location) { try { $download = file_get_contents($url); file_put_contents($location, $download); return TRUE; } catch(Exception $ex){ return FALSE; } } public static function PostToVar($post) { try { foreach($post as $name => $content) { global ${$name}; ${$name} = $content; } } catch(Exception $e){ return FALSE; } } public static function Database($host, $user, $pass, $db) { $db = new mysqli($host, $user, $pass, $db); if ($db->connect_errno) { return FALSE; } else { return $db; } } public static function Country() { $api = "http://api.hostip.info/country.php?ip="; try { return (!isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? file_get_contents($api . $_SERVER['REMOTE_ADDR']) : FALSE); } catch(Exception $e){ return FALSE; } } public static function FBLikes($name) { $data = json_decode(file_get_contents("https://graph.facebook.com/".$name)); return $data->likes; } public static function FBCover($name) { $data = json_decode(file_get_contents("https://graph.facebook.com/".$name)); return $data->cover->source; } }

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.110.0070.01015.89
7.2.100.0080.00616.11
7.2.90.0060.00916.63
7.2.80.0080.00516.03
7.2.70.0060.00616.66
7.2.60.0100.00616.47
7.2.50.0030.00616.16
7.2.40.0060.00616.68
7.2.30.0090.00316.23
7.2.20.0160.00016.09
7.2.10.0120.00316.57
7.2.00.0130.00316.58
7.1.230.0090.00415.31
7.1.220.0060.00615.43
7.1.210.0110.00315.52
7.1.200.0080.00415.25
7.1.190.0030.01015.20
7.1.180.0090.00615.50
7.1.170.0090.00315.23
7.1.160.0130.00315.39
7.1.150.0110.00315.39
7.1.140.0030.00915.51
7.1.130.0100.00615.06
7.1.120.0060.00615.46
7.1.110.0110.00315.42
7.1.100.0170.00015.11
7.1.90.0090.00915.32
7.1.80.0080.00315.38
7.1.70.0080.01016.07
7.1.60.0150.01417.45
7.1.50.0170.01016.29
7.1.40.0150.00615.64
7.1.30.0290.00815.96
7.1.20.0250.01415.79
7.1.10.0220.00915.50
7.1.00.0180.01919.04
7.0.310.0060.00514.83
7.0.300.0070.00314.98
7.0.290.0060.00315.12
7.0.280.0090.00614.95
7.0.270.0060.00615.02
7.0.260.0120.00314.77
7.0.250.0110.00014.96
7.0.240.0040.01214.90
7.0.230.0090.00614.91
7.0.220.0120.00614.88
7.0.210.0240.00715.20
7.0.200.0270.00614.99
7.0.190.0240.00515.39
7.0.180.0280.00615.25
7.0.170.0170.01315.38
7.0.160.0240.00615.37
7.0.150.0220.00915.36
7.0.140.0160.03718.58
7.0.130.0330.00015.02
7.0.120.0290.00415.18
7.0.110.0210.01115.37
7.0.100.0250.02617.62
7.0.90.0140.04617.67
7.0.80.0200.04517.64
7.0.70.0190.04017.50
7.0.60.0210.03017.38
7.0.50.0100.03017.78
7.0.40.0130.03816.57
7.0.30.0070.02916.65
7.0.20.0080.04616.66
7.0.10.0130.04316.59
7.0.00.0130.04016.68
5.6.380.0060.00614.07
5.6.370.0100.00313.97
5.6.360.0090.00313.95
5.6.350.0030.00914.01
5.6.340.0060.00313.98
5.6.330.0060.00314.05
5.6.320.0090.00013.94
5.6.310.0110.01114.24
5.6.300.0190.00613.71
5.6.290.0120.01214.44
5.6.280.0060.04417.77
5.6.270.0120.01214.43
5.6.260.0170.00914.32
5.6.250.0140.02517.43
5.6.240.0070.04717.38
5.6.230.0130.04517.33
5.6.220.0080.03817.39
5.6.210.0110.04417.32
5.6.200.0100.04617.54
5.6.190.0110.03817.63
5.6.180.0120.03617.45
5.6.170.0160.02117.54
5.6.160.0060.04517.68
5.6.150.0140.04417.77
5.6.140.0090.04817.71
5.6.130.0140.02817.57
5.6.120.0080.04017.62
5.6.110.0160.03517.58
5.6.100.0060.04917.64
5.6.90.0070.04717.45
5.6.80.0030.04317.05
5.6.70.0060.04817.05
5.6.60.0120.03317.20
5.6.50.0030.03717.08
5.6.40.0060.04517.12
5.6.30.0050.04317.08
5.6.20.0050.04317.05
5.6.10.0100.02817.01
5.6.00.0060.04617.06
5.5.380.0100.03515.69
5.5.370.0090.04115.55
5.5.360.0070.04415.71
5.5.350.0040.04615.68
5.5.340.0060.04715.79
5.5.330.0030.02915.79
5.5.320.0080.04515.87
5.5.310.0070.04715.63
5.5.300.0120.04315.89
5.5.290.0120.04415.95
5.5.280.0130.02215.86
5.5.270.0040.03615.90
5.5.260.0140.03015.93
5.5.250.0100.03915.67
5.5.240.0100.03315.32
5.5.230.0110.03615.36
5.5.220.0080.03715.41
5.5.210.0040.04115.44
5.5.200.0040.02515.44
5.5.190.0100.04015.47
5.5.180.0060.04215.33
5.5.170.0100.00313.96
5.5.160.0090.04015.33
5.5.150.0090.03815.37
5.5.140.0060.03515.48
5.5.130.0080.03815.45
5.5.120.0080.03615.51
5.5.110.0080.03615.46
5.5.100.0010.04815.50
5.5.90.0130.03515.38
5.5.80.0090.03015.35
5.5.70.0060.04315.41
5.5.60.0090.03515.25
5.5.50.0090.01815.33
5.5.40.0080.04515.46
5.5.30.0050.02715.27
5.5.20.0110.03115.26
5.5.10.0070.04315.36
5.5.00.0050.04115.27
5.4.450.0080.04615.19
5.4.440.0070.04215.12
5.4.430.0070.02315.05
5.4.420.0060.03515.12
5.4.410.0070.04014.79
5.4.400.0050.04514.88
5.4.390.0050.03114.70
5.4.380.0060.03014.84
5.4.370.0060.03514.79
5.4.360.0060.02615.01
5.4.350.0050.02814.70
5.4.340.0050.03614.85
5.4.330.0090.00310.66
5.4.320.0050.02814.89
5.4.310.0100.03814.84
5.4.300.0050.04314.83
5.4.290.0030.02414.79
5.4.280.0050.04414.62
5.4.270.0090.02214.95
5.4.260.0070.02514.61
5.4.250.0050.02114.71
5.4.240.0130.02514.91
5.4.230.0050.04114.79
5.4.220.0070.02314.67
5.4.210.0070.03814.79
5.4.200.0060.04114.65
5.4.190.0060.03514.93
5.4.180.0060.04114.86
5.4.170.0060.03114.80
5.4.160.0060.02414.87
5.4.150.0050.02514.68
5.4.140.0080.02513.46
5.4.130.0060.03613.50
5.4.120.0050.03613.58
5.4.110.0080.03313.42
5.4.100.0070.02213.69
5.4.90.0060.03613.49
5.4.80.0070.03813.34
5.4.70.0080.03813.46
5.4.60.0080.03913.70
5.4.50.0050.03813.49
5.4.40.0060.03813.46
5.4.30.0050.03613.56
5.4.20.0080.03113.61
5.4.10.0030.04413.48
5.4.00.0030.04013.33
5.3.290.0050.02512.63
5.3.280.0030.02612.40
5.3.270.0050.02712.43
5.3.260.0080.03912.41
5.3.250.0040.04012.55
5.3.240.0030.03912.35
5.3.230.0090.04012.52
5.3.220.0020.03812.51
5.3.210.0080.02312.31
5.3.200.0060.03812.47
5.3.190.0030.02612.38
5.3.180.0050.02912.60
5.3.170.0050.02212.58
5.3.160.0060.03012.43
5.3.150.0040.02612.60
5.3.140.0080.04112.53
5.3.130.0080.04112.59
5.3.120.0050.03212.52
5.3.110.0030.02612.51
5.3.100.0060.03112.21
5.3.90.0030.02812.25
5.3.80.0050.03912.10
5.3.70.0060.03612.14
5.3.60.0030.02812.17
5.3.50.0050.04212.11
5.3.40.0040.03112.06
5.3.30.0070.03412.09
5.3.20.0030.04212.03
5.3.10.0090.03111.87
5.3.00.0110.03311.92
5.2.170.0050.02310.58
5.2.160.0050.03310.44
5.2.150.0060.03610.47
5.2.140.0070.03310.55
5.2.130.0060.03110.46
5.2.120.0110.03010.40
5.2.110.0050.03210.46
5.2.100.0050.02010.39
5.2.90.0010.02410.50
5.2.80.0070.03310.46
5.2.70.0060.03210.43
5.2.60.0040.03510.42
5.2.50.0010.03410.47
5.2.40.0050.02710.53
5.2.30.0090.02610.45
5.2.20.0030.01710.46
5.2.10.0050.01810.41
5.2.00.0000.01910.36
5.1.60.0080.01810.09
5.1.50.0030.01510.09
5.1.40.0060.01210.15
5.1.30.0010.01610.14
5.1.20.0050.01410.09
5.1.10.0030.01510.09
5.1.00.0040.01310.09
5.0.50.0060.01310.09
5.0.40.0040.01510.09
5.0.30.0030.01710.09
5.0.20.0010.01210.09
5.0.10.0040.01010.09
5.0.00.0020.01710.09
4.4.90.0000.01510.09
4.4.80.0020.02010.09
4.4.70.0010.01310.09
4.4.60.0010.01210.09
4.4.50.0020.01110.09
4.4.40.0020.01510.09
4.4.30.0030.00810.09
4.4.20.0010.01010.09
4.4.10.0050.00710.09
4.4.00.0000.01610.09
4.3.110.0020.01010.09
4.3.100.0020.00810.09
4.3.90.0050.00710.09
4.3.80.0020.01310.09
4.3.70.0020.01010.09
4.3.60.0020.01010.09
4.3.50.0020.01210.09
4.3.40.0020.01210.09
4.3.30.0020.01010.09
4.3.20.0020.01210.09
4.3.10.0030.00810.09
4.3.00.0020.00810.09

preferences:
36.24 ms | 400 KiB | 5 Q