3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getUTF8CharCode($c) { $h = ord($c{0}); if ($h <= 0x7F) { return $h; } else if ($h < 0xC2) { return false; } else if ($h <= 0xDF) { return ($h & 0x1F) << 6 | (ord($c{1}) & 0x3F); } else if ($h <= 0xEF) { return ($h & 0x0F) << 12 | (ord($c{1}) & 0x3F) << 6 | (ord($c{2}) & 0x3F); } else if ($h <= 0xF4) { return ($h & 0x0F) << 18 | (ord($c{1}) & 0x3F) << 12 | (ord($c{2}) & 0x3F) << 6 | (ord($c{3}) & 0x3F); } else { return false; } } function escapeCSSCharacter($c) { return "\\" . base_convert(getUTF8CharCode($c), 10, 16) . " "; } function escapeCSSRule($data, array $immuneChars = array()) { $result = ""; for ($i = 0; $i < mb_strlen($data); $i++) { $currChar = mb_substr($data, $i, 1); var_dump(getUTF8CharCode($currChar), preg_match("/^\w$/", $currChar)); if (getUTF8CharCode($currChar) < 256 && !preg_match("/^\w$/", $currChar) && !in_array($currChar, $immuneChars)) { $result .= escapeCSSCharacter($currChar); } else { $result .= $currChar; } } return $result; } echo escapeCSSRule("#BADA55");

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.0150.00616.61
8.3.50.0110.01121.89
8.3.40.0070.00718.63
8.3.30.0040.01219.10
8.3.20.0060.00320.39
8.3.10.0020.00523.61
8.3.00.0080.00020.84
8.2.180.0120.00616.50
8.2.170.0090.00622.96
8.2.160.0100.00320.30
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0080.00026.16
8.2.120.0080.00020.73
8.2.110.0000.00919.33
8.2.100.0040.00717.78
8.2.90.0050.00319.05
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0040.00417.80
8.2.50.0040.00418.07
8.2.40.0030.00621.13
8.2.30.0040.00418.18
8.2.20.0080.00017.48
8.2.10.0040.00417.96
8.2.00.0040.00417.56
8.1.280.0090.01225.92
8.1.270.0000.00824.01
8.1.260.0090.00026.35
8.1.250.0050.00328.09
8.1.240.0060.00322.14
8.1.230.0040.00718.95
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0060.00317.10
8.1.190.0040.00417.00
8.1.180.0000.00818.10
8.1.170.0050.00318.59
8.1.160.0000.00721.99
8.1.150.0020.00518.50
8.1.140.0000.00717.35
8.1.130.0000.00717.75
8.1.120.0000.00717.17
8.1.110.0040.00417.24
8.1.100.0000.00817.21
8.1.90.0050.00217.29
8.1.80.0020.00517.34
8.1.70.0070.00017.21
8.1.60.0040.00417.40
8.1.50.0030.00617.40
8.1.40.0040.00417.29
8.1.30.0040.00417.57
8.1.20.0080.00017.53
8.1.10.0030.00617.30
8.1.00.0050.00317.29
8.0.300.0070.00018.77
8.0.290.0040.00416.63
8.0.280.0030.00318.36
8.0.270.0000.00817.18
8.0.260.0040.00417.04
8.0.250.0030.00316.91
8.0.240.0000.00716.86
8.0.230.0070.00016.73
8.0.220.0000.00716.79
8.0.210.0000.00716.81
8.0.200.0000.00616.75
8.0.190.0000.00716.91
8.0.180.0000.00716.88
8.0.170.0030.00616.84
8.0.160.0000.00716.81
8.0.150.0000.00816.72
8.0.140.0070.00016.77
8.0.130.0000.00513.18
8.0.120.0040.00416.82
8.0.110.0000.00716.65
8.0.100.0000.00716.66
8.0.90.0000.00816.86
8.0.80.0040.01016.80
8.0.70.0000.00816.70
8.0.60.0030.00316.71
8.0.50.0050.00316.82
8.0.30.0140.00916.88
8.0.20.0130.00617.40
8.0.10.0040.00416.78
8.0.00.0110.00816.65
7.4.330.0000.00515.00
7.4.320.0000.00716.73
7.4.300.0000.00716.77
7.4.290.0030.00616.75
7.4.280.0040.00416.66
7.4.270.0090.00016.84
7.4.260.0030.00316.77
7.4.250.0000.00716.70
7.4.240.0030.00416.84
7.4.230.0040.00416.73
7.4.220.0070.01116.95
7.4.210.0070.00816.75
7.4.200.0030.00516.74
7.4.190.0040.00416.79
7.4.160.0160.00016.89
7.4.150.0220.00317.40
7.4.140.0090.00917.86
7.4.130.0100.01016.71
7.4.120.0090.00916.80
7.4.110.0100.00716.90
7.4.100.0180.00016.73
7.4.90.0140.00316.82
7.4.80.0130.01019.39
7.4.70.0100.00716.87
7.4.60.0030.01416.86
7.4.50.0000.00816.50
7.4.40.0110.00516.71
7.4.30.0040.01316.64
7.4.10.0000.01615.16
7.4.00.0080.00915.19
7.3.330.0030.00313.61
7.3.320.0030.00313.51
7.3.310.0000.00816.65
7.3.300.0000.00716.56
7.3.290.0050.00916.55
7.3.280.0060.01116.53
7.3.270.0130.01017.40
7.3.260.0150.00616.85
7.3.250.0120.01016.54
7.3.240.0110.00716.91
7.3.230.0090.00916.50
7.3.210.0150.00916.77
7.3.200.0090.00919.39
7.3.190.0120.00916.91
7.3.180.0040.01216.57
7.3.170.0070.01416.83
7.3.160.0090.00616.64
7.3.130.0070.01015.17
7.3.120.0090.00715.14
7.3.110.0070.01314.90
7.3.100.0080.00514.88
7.3.90.0100.00715.02
7.3.80.0080.00814.89
7.3.70.0050.00814.95
7.3.60.0070.00914.99
7.3.50.0080.00615.05
7.3.40.0120.00815.13
7.3.30.0070.01115.04
7.3.20.0030.00916.88
7.3.10.0030.01016.85
7.3.00.0050.00916.62
7.2.330.0110.00716.94
7.2.320.0130.00316.89
7.2.310.0050.01317.04
7.2.300.0040.01416.72
7.2.290.0030.01616.95
7.2.260.0040.01615.21
7.2.250.0080.01015.44
7.2.240.0050.01115.02
7.2.230.0070.00715.09
7.2.220.0070.01115.36
7.2.210.0080.00815.48
7.2.200.0050.01215.30
7.2.190.0030.01215.28
7.2.180.0060.00915.26
7.2.170.0090.00915.17
7.2.160.0040.01115.14
7.2.150.0080.00817.18
7.2.140.0040.00917.15
7.2.130.0080.01216.88
7.2.120.0030.00917.12
7.2.110.0070.00717.18
7.2.100.0120.00616.89
7.2.90.0030.01317.31
7.2.80.0000.01217.17
7.2.70.0070.00717.09
7.2.60.0030.00817.23
7.2.50.0110.00717.35
7.2.40.0030.01016.92
7.2.30.0040.01117.07
7.2.20.0070.00717.23
7.2.10.0080.00517.09
7.2.00.0060.00817.26
7.1.330.0090.00515.98
7.1.320.0030.00915.89
7.1.310.0130.00316.08
7.1.300.0070.01015.99
7.1.290.0100.00615.90
7.1.280.0090.00715.99
7.1.270.0110.00115.86
7.1.260.0110.00216.00
7.1.250.0130.00316.00
7.1.240.0030.00915.75
7.1.230.0000.01315.84
7.1.220.0070.00715.78
7.1.210.0100.00315.82
7.1.200.0030.01015.98
7.1.190.0090.00615.96
7.1.180.0110.00416.11
7.1.170.0030.01016.00
7.1.160.0000.01416.05
7.1.150.0000.01415.85
7.1.140.0040.00816.19
7.1.130.0070.00715.98
7.1.120.0040.01216.14
7.1.110.0060.00615.97
7.1.100.0050.00817.29
7.1.90.0070.00316.07
7.1.80.0000.01615.97
7.1.70.0020.00916.67
7.1.60.0090.01117.70
7.1.50.0020.00916.54
7.1.40.0030.01415.94
7.1.30.0030.00915.90
7.1.20.0000.01616.04
7.1.10.0080.00815.89
7.1.00.0070.04119.19
7.0.330.0110.00415.57
7.0.320.0030.01015.41
7.0.310.0040.00415.56
7.0.300.0000.00915.43
7.0.290.0000.01115.25
7.0.280.0070.01015.29
7.0.270.0000.01615.67
7.0.260.0110.00715.45
7.0.250.0100.00315.80
7.0.240.0060.00915.54
7.0.230.0040.00715.80
7.0.220.0090.00615.27
7.0.210.0000.01615.73
7.0.200.0080.00216.25
7.0.190.0000.01515.61
7.0.180.0110.00415.46
7.0.170.0070.00715.80
7.0.160.0090.00615.49
7.0.150.0130.00015.45
7.0.140.0060.04018.86
7.0.130.0100.00315.65
7.0.120.0100.00715.62
7.0.110.0030.01215.39
7.0.100.0060.00615.55
7.0.90.0000.01215.46
7.0.80.0000.01415.48
7.0.70.0080.00815.23
7.0.60.0060.03817.67
7.0.50.0070.02016.81
7.0.40.0030.04916.92
7.0.30.0200.03216.99
7.0.20.0090.02616.90
7.0.10.0040.03316.82
7.0.00.0100.02416.92
5.6.400.0060.00614.68
5.6.390.0030.01314.69
5.6.380.0100.00714.50
5.6.370.0030.01014.36
5.6.360.0070.00714.80
5.6.350.0060.00814.52
5.6.340.0040.00714.38
5.6.330.0000.01314.67
5.6.320.0120.00314.59
5.6.310.0070.00714.71
5.6.300.0060.00914.57
5.6.290.0070.00714.76
5.6.280.0130.03317.62
5.6.270.0150.00014.62
5.6.260.0080.00414.38
5.6.250.0000.01514.55
5.6.240.0040.00714.44
5.6.230.0090.00614.46
5.6.220.0060.01314.55
5.6.210.0080.04317.50
5.6.200.0050.03616.20
5.6.190.0100.03317.45
5.6.180.0100.04317.31
5.6.170.0170.02817.42
5.6.160.0070.04417.64
5.6.150.0110.03516.50
5.6.140.0070.04416.40
5.6.130.0080.04316.21
5.6.120.0070.04617.57
5.6.110.0070.04617.87
5.6.100.0100.04017.56
5.6.90.0030.04417.61
5.6.80.0100.03817.48
5.6.70.0000.01314.40
5.6.60.0030.01014.52
5.6.50.0060.00914.41
5.6.40.0060.00914.68
5.6.30.0030.00614.17
5.6.20.0030.01014.04
5.6.10.0000.01314.34
5.6.00.0060.00614.26
5.5.380.0070.00414.23
5.5.370.0000.01614.39
5.5.360.0040.01414.17
5.5.350.0050.02317.29
5.5.340.0030.04816.18
5.5.330.0070.04317.29
5.5.320.0180.02117.22
5.5.310.0210.03817.40
5.5.300.0050.03216.24
5.5.290.0050.02716.16
5.5.280.0100.04517.62
5.5.270.0060.03817.40
5.5.260.0080.04017.54
5.5.250.0050.02817.40
5.5.240.0070.01517.37
5.5.230.0030.00913.96
5.5.220.0040.00714.08
5.5.210.0030.01014.04
5.5.200.0070.00714.50
5.5.190.0030.00614.21
5.5.180.0110.00414.58
5.5.170.0090.00014.38
5.5.160.0090.00614.28
5.5.150.0120.00314.44
5.5.140.0050.00514.10
5.5.130.0000.01314.37
5.5.120.0060.00914.47
5.5.110.0080.00414.27
5.5.100.0100.00314.31
5.5.90.0070.00714.29
5.5.80.0050.00514.46
5.5.70.0070.00314.30
5.5.60.0030.01014.40
5.5.50.0040.01214.28
5.5.40.0040.01114.36
5.5.30.0000.01614.45
5.5.20.0040.00813.91
5.5.10.0030.01014.27
5.5.00.0070.01014.23
5.4.450.0100.03015.29
5.4.440.0400.03715.32
5.4.430.0410.03515.48
5.4.420.0530.02715.45
5.4.410.0100.03415.09
5.4.400.0480.03715.27
5.4.390.0550.02815.32
5.4.380.0220.02514.90
5.4.370.0200.04314.97
5.4.360.0250.02314.77
5.4.350.0160.03514.78
5.4.340.0240.03114.84
5.4.330.0040.00411.15
5.4.320.0050.02111.74
5.4.310.0060.02111.76
5.4.300.0040.02411.72
5.4.290.0040.02711.90
5.4.280.0050.02211.77
5.4.270.0050.02111.79
5.4.260.0050.02211.67
5.4.250.0040.02511.75
5.4.240.0030.02211.84
5.4.230.0020.02611.86
5.4.220.0020.02111.78
5.4.210.0060.02511.60
5.4.200.0040.02411.53
5.4.190.0020.02311.66
5.4.180.0020.02311.61
5.4.170.0050.02711.62
5.4.160.0020.02411.78
5.4.150.0060.02911.79
5.4.140.0070.02811.61
5.4.130.0080.02611.70
5.4.120.0040.02911.43
5.4.110.0050.01911.47
5.4.100.0090.01811.50
5.4.90.0080.01911.49
5.4.80.0070.02011.62
5.4.70.0080.02511.59
5.4.60.0070.02911.49
5.4.50.0060.02911.64
5.4.40.0060.02211.54
5.4.30.0080.02611.53
5.4.20.0060.02811.55
5.4.10.0080.02011.55
5.4.00.0040.02411.37
5.3.290.0070.02411.70
5.3.280.0070.02111.59
5.3.270.0080.02611.65
5.3.260.0020.02511.65
5.3.250.0040.02511.65
5.3.240.0080.01911.68
5.3.230.0070.02311.70
5.3.220.0080.01911.64
5.3.210.0070.02211.63
5.3.200.0060.02311.63
5.3.190.0050.02211.66
5.3.180.0040.02411.65
5.3.170.0030.02411.56
5.3.160.0050.02211.72
5.3.150.0040.02511.74
5.3.140.0050.02211.56
5.3.130.0060.02311.70
5.3.120.0060.02111.59
5.3.110.0050.02411.56
5.3.100.0060.02211.42
5.3.90.0060.01911.32
5.3.80.0040.02211.36
5.3.70.0060.01811.44
5.3.60.0050.02011.47
5.3.50.0080.01911.20
5.3.40.0040.02311.35
5.3.30.0050.02211.31
5.3.20.0040.02111.21
5.3.10.0060.02211.10
5.3.00.0070.02011.13
5.2.170.0010.0369.24
5.2.160.0020.0339.24
5.2.150.0030.0329.24
5.2.140.0080.0279.23
5.2.130.0060.0309.20
5.2.120.0050.0319.20
5.2.110.0030.0319.20
5.2.100.0020.0349.20
5.2.90.0020.0339.19
5.2.80.0040.0329.19
5.2.70.0080.0299.19
5.2.60.0050.0339.16
5.2.50.0030.0369.12
5.2.40.0090.0279.11
5.2.30.0050.0329.07
5.2.20.0060.0329.05
5.2.10.0050.0328.96
5.2.00.0050.0328.82
5.1.60.0070.0258.11
5.1.50.0060.0448.11
5.1.40.0040.0338.09
5.1.30.0030.0298.43
5.1.20.0060.0308.46
5.1.10.0050.0328.19
5.1.00.0060.0308.19
5.0.50.0010.0316.66
5.0.40.0060.0216.53
5.0.30.0030.0436.34
5.0.20.0060.0256.30
5.0.10.0060.0286.29
5.0.00.0010.0446.28
4.4.90.0050.0214.78
4.4.80.0040.0224.75
4.4.70.0040.0224.76
4.4.60.0070.0204.75
4.4.50.0070.0204.77
4.4.40.0100.0284.71
4.4.30.0030.0224.76
4.4.20.0030.0234.84
4.4.10.0050.0214.85
4.4.00.0050.0324.76
4.3.110.0050.0214.67
4.3.100.0060.0194.67
4.3.90.0040.0214.63
4.3.80.0040.0324.58
4.3.70.0040.0214.63
4.3.60.0030.0144.62
4.3.50.0020.0164.63
4.3.40.0010.0264.54
4.3.30.0030.0153.32
4.3.20.0030.0153.30
4.3.10.0020.0173.27
4.3.00.0030.0277.07

preferences:
44.82 ms | 401 KiB | 5 Q