3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class App_Messages{ protected static $ANSI_CODES = array( "Reset" => 0, "Bold" => 1, "Italic" => 3, "Underline" => 4, "Blink" => 5, "Inverse" => 7, "Hidden" => 8, "BLK" => 30, "RED" => 31, "GRN" => 32, "YEL" => 33, "BLU" => 34, "PUR" => 35, "CYN" => 36, "WHT" => 37, "BLK_bg" => 40, "RED_bg" => 41, "GRN_bg" => 42, "YEL_bg" => 43, "BLU_bg" => 44, "PUR_bg" => 45, "CYN_bg" => 46, "WHT_bg" => 47 ); public static function printToScreen($message,$format = NULL) { echo EOL.self::set($message,$format).EOL; } public static function set($str, $color = NULL) { if (!isset($color)) { return $str; } $color_attrs = explode("+", $color); $ansi_str = ""; foreach ($color_attrs as $attr) { $ansi_str .= "\033[" . self::$ANSI_CODES[$attr] . "m"; } $ansi_str .= $str . "\033[" . self::$ANSI_CODES["Reset"] . "m"; return $ansi_str; } public static function replace($full_text, $search_regexp, $color) { $new_text = preg_replace_callback( "/($search_regexp)/", function ($matches) use ($color) { return App_Messages::set($matches[1], $color); }, $full_text ); return is_null($new_text) ? $full_text : $new_text; } App_Messages::printToScreen("HELLO","BLU+Bold");

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)
5.6.120.0000.05021.08
5.6.110.0230.07021.00
5.6.100.0070.06021.15
5.6.90.0170.06021.01
5.6.80.0070.07720.44
5.5.280.0030.05020.91
5.5.270.0030.04320.77
5.5.260.0030.08020.74
5.5.250.0130.08020.71
5.5.240.0000.08020.38
5.4.440.0170.05019.54
5.4.430.0130.05019.37
5.4.420.0700.04319.59
5.4.410.0670.04719.41
5.4.400.0570.05719.22
5.4.390.0770.05319.13
5.4.380.0670.05319.00
5.4.370.0100.05019.27
5.4.360.0100.07719.00
5.4.350.0330.05019.20
5.4.340.0900.05319.11
5.4.320.1070.05019.29
5.4.310.0700.05319.22
5.4.300.0830.04318.96
5.4.290.0630.04719.04
5.4.280.0930.05019.30
5.4.270.0700.05718.82
5.4.260.0870.05318.84
5.4.250.0870.04718.99
5.4.240.0770.05719.11
5.4.230.0770.05719.04
5.4.220.0570.06019.29
5.4.210.0570.05718.93
5.4.200.0600.05716.64
5.4.190.0770.05719.03
5.4.180.0570.06718.88
5.4.170.0600.06719.24
5.4.160.0800.05319.03
5.4.150.0800.06019.19
5.4.140.0770.05316.50
5.4.130.0670.05016.53
5.4.120.0670.04716.69
5.4.110.0700.03716.69
5.4.100.0900.04316.39
5.4.90.0770.05316.37
5.4.80.0670.05716.29
5.4.70.0700.06016.29
5.4.60.0630.06016.40
5.4.50.0800.05316.30
5.4.40.0830.05316.31
5.4.30.0870.04316.23
5.4.20.0930.04316.33
5.4.10.0800.05716.44
5.4.00.0730.05015.89
5.3.290.0730.05314.68
5.3.280.0770.05014.70
5.3.270.0730.05014.63
5.3.260.0770.05014.61
5.3.250.0700.05314.53
5.3.240.0630.05314.85
5.3.230.0630.04714.54
5.3.220.0600.05314.49
5.3.210.0600.05314.60
5.3.200.0600.05314.60
5.3.190.0670.05714.63
5.3.180.0900.05714.73
5.3.170.0770.04714.45
5.3.160.0770.06314.60
5.3.150.0770.04714.64
5.3.140.0830.04314.63
5.3.130.0630.06314.71
5.3.120.0700.06314.50
5.3.110.0730.05314.57
5.3.100.0730.06714.08
5.3.90.0730.05714.06
5.3.80.0770.06014.26
5.3.70.0830.05013.95
5.3.60.0670.05713.93
5.3.50.0800.04313.88
5.3.40.0800.04713.88
5.3.30.0630.04313.98
5.3.20.0570.05013.61
5.3.10.0630.05013.90
5.3.00.0630.04713.67
5.2.170.0570.03711.39
5.2.160.0530.04011.07
5.2.150.0730.04011.07
5.2.140.0670.03711.17
5.2.130.0630.03711.05
5.2.120.0600.04011.07
5.2.110.0600.03711.20
5.2.100.0500.04711.04
5.2.90.0500.04311.07
5.2.80.0530.04011.02
5.2.70.0500.04311.33
5.2.60.0700.04010.97
5.2.50.0500.04711.12
5.2.40.0500.03711.02
5.2.30.0470.04711.00
5.2.20.0430.03711.03
5.2.10.0400.04010.79
5.2.00.0500.03710.75
5.1.60.0470.0339.90
5.1.50.0470.03010.09
5.1.40.0330.04010.07
5.1.30.0370.04010.36
5.1.20.0370.04010.28
5.1.10.0470.03710.09
5.1.00.0470.04710.07
5.0.50.0300.0339.09
5.0.40.0330.0309.09
5.0.30.0300.0479.09
5.0.20.0270.0279.09
5.0.10.0270.0279.09
5.0.00.0230.0409.09
4.4.90.0200.0239.09
4.4.80.0230.0209.09
4.4.70.0200.0279.09
4.4.60.0100.0209.09
4.4.50.0000.0239.09
4.4.40.0000.0379.09
4.4.30.0030.0309.09
4.4.20.0070.0279.09
4.4.10.0000.0309.09
4.4.00.0030.0379.09
4.3.110.0030.0279.09
4.3.100.0270.0209.09
4.3.90.0270.0209.09
4.3.80.0270.0339.09
4.3.70.0230.0239.09
4.3.60.0230.0239.09
4.3.50.0370.0179.09
4.3.40.0330.0339.09
4.3.30.0170.0209.09
4.3.20.0130.0209.09
4.3.10.0170.0279.09
4.3.00.0030.0207.06

preferences:
147.55 ms | 1398 KiB | 8 Q