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;}*{display:none;}/*", array("#"));

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.0080.01116.75
8.3.50.0100.00522.04
8.3.40.0140.00018.68
8.3.30.0090.00918.79
8.3.20.0070.00020.34
8.3.10.0000.00723.48
8.3.00.0070.00020.88
8.2.180.0170.00316.32
8.2.170.0120.00322.96
8.2.160.0030.01020.37
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0020.00526.16
8.2.120.0040.00420.91
8.2.110.0040.00422.05
8.2.100.0070.00417.59
8.2.90.0030.00619.15
8.2.80.0040.00417.97
8.2.70.0060.00317.50
8.2.60.0050.00317.91
8.2.50.0030.00718.07
8.2.40.0040.00421.06
8.2.30.0000.00818.22
8.2.20.0040.00417.50
8.2.10.0040.00417.80
8.2.00.0040.00417.45
8.1.280.0100.01025.92
8.1.270.0050.00323.71
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0060.00322.05
8.1.230.0090.00319.09
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0030.00517.00
8.1.180.0000.00818.10
8.1.170.0030.00518.59
8.1.160.0040.00421.86
8.1.150.0000.00818.50
8.1.140.0030.00617.31
8.1.130.0000.00717.75
8.1.120.0000.00717.23
8.1.110.0040.00417.22
8.1.100.0040.00417.23
8.1.90.0040.00417.35
8.1.80.0040.00417.32
8.1.70.0000.00717.34
8.1.60.0030.00617.46
8.1.50.0050.00317.30
8.1.40.0060.00317.43
8.1.30.0080.00017.53
8.1.20.0000.00717.49
8.1.10.0060.00317.37
8.1.00.0000.00717.22
8.0.300.0080.00018.77
8.0.290.0070.00016.77
8.0.280.0030.00318.26
8.0.270.0030.00317.12
8.0.260.0070.00017.18
8.0.250.0030.00316.89
8.0.240.0030.00316.84
8.0.230.0040.00316.75
8.0.220.0040.00416.79
8.0.210.0070.00016.75
8.0.200.0000.00616.88
8.0.190.0000.00716.77
8.0.180.0040.00416.87
8.0.170.0000.00716.87
8.0.160.0030.00316.73
8.0.150.0000.00716.76
8.0.140.0000.00716.71
8.0.130.0030.00313.21
8.0.120.0040.00416.68
8.0.110.0000.00716.82
8.0.100.0000.00816.71
8.0.90.0000.00716.64
8.0.80.0070.00716.88
8.0.70.0000.00716.63
8.0.60.0040.00416.60
8.0.50.0000.00716.77
8.0.30.0150.00516.92
8.0.20.0130.00717.40
8.0.10.0070.00016.83
8.0.00.0080.01016.62
7.4.330.0030.00315.00
7.4.320.0030.00316.79
7.4.300.0000.00716.74
7.4.290.0030.00616.75
7.4.280.0000.00816.82
7.4.270.0000.01016.82
7.4.260.0070.00016.82
7.4.250.0040.00416.71
7.4.240.0030.00416.83
7.4.230.0000.00716.63
7.4.220.0060.01216.82
7.4.210.0080.01016.80
7.4.200.0030.00316.58
7.4.190.0040.00416.60
7.4.160.0110.00716.84
7.4.150.0070.01317.40
7.4.140.0120.01017.86
7.4.130.0190.00316.85
7.4.120.0050.01416.64
7.4.110.0100.00716.79
7.4.100.0050.01516.67
7.4.90.0090.01316.68
7.4.80.0060.01219.39
7.4.70.0050.01116.57
7.4.60.0180.00616.88
7.4.50.0030.00616.63
7.4.40.0100.00816.63
7.4.30.0100.00616.77
7.4.00.0050.01015.07
7.3.330.0060.00013.33
7.3.320.0030.00313.54
7.3.310.0050.00216.58
7.3.300.0050.00216.44
7.3.290.0110.00316.57
7.3.280.0080.00816.53
7.3.270.0120.00617.40
7.3.260.0120.01216.86
7.3.250.0100.01316.70
7.3.240.0060.01616.56
7.3.230.0090.00916.57
7.3.210.0080.01116.75
7.3.200.0080.01519.39
7.3.190.0040.01816.64
7.3.180.0120.00616.54
7.3.170.0060.01816.73
7.3.160.0070.01016.52
7.3.120.0050.01014.96
7.3.110.0110.00715.21
7.3.100.0090.00614.80
7.3.90.0090.00314.85
7.3.80.0000.01314.73
7.3.70.0040.01115.16
7.3.60.0030.00615.21
7.3.50.0000.01214.86
7.3.40.0130.00315.12
7.3.30.0100.00315.05
7.3.20.0030.01016.99
7.3.10.0080.01116.76
7.3.00.0100.01016.83
7.2.330.0160.00416.84
7.2.320.0090.01216.94
7.2.310.0060.01316.93
7.2.300.0080.01217.03
7.2.290.0090.00916.90
7.2.250.0060.00915.19
7.2.240.0070.01015.36
7.2.230.0060.00315.54
7.2.220.0080.00515.05
7.2.210.0120.00315.12
7.2.200.0030.00915.28
7.2.190.0060.00614.99
7.2.180.0090.00615.45
7.2.170.0040.00815.10
7.2.00.0030.00919.63
7.1.330.0040.01116.07
7.1.320.0040.00715.95
7.1.310.0030.01016.08
7.1.300.0090.00615.64
7.1.290.0040.00416.10
7.1.280.0080.00415.86
7.1.270.0040.01115.66
7.1.260.0080.00416.11
7.1.100.0060.00618.61
7.1.70.0040.00417.57
7.1.60.0150.00919.46
7.1.50.0070.01017.21
7.1.00.0070.07322.34
7.0.200.0110.00416.62
7.0.140.0030.07721.97
7.0.60.0030.07320.02
7.0.50.0170.07317.92
7.0.40.0130.08320.13
7.0.30.0270.06020.29
7.0.20.0130.04320.26
7.0.10.0100.05020.11
7.0.00.0070.08320.33
5.6.280.0070.06720.94
5.6.210.0070.08020.73
5.6.200.0070.05718.29
5.6.190.0130.06320.47
5.6.180.0070.06320.48
5.6.170.0270.07720.62
5.6.160.0130.08020.50
5.6.150.0030.07718.18
5.6.140.0100.06018.12
5.6.130.0170.07018.14
5.6.120.0030.04321.05
5.6.110.0130.06021.11
5.6.100.0200.06721.15
5.6.90.0030.08721.02
5.6.80.0100.07020.49
5.5.350.0070.06720.54
5.5.340.0070.08317.98
5.5.330.0170.07020.19
5.5.320.0370.08020.34
5.5.310.0370.07320.30
5.5.300.0070.05017.93
5.5.290.0100.03317.94
5.5.280.0130.07721.00
5.5.270.0070.08720.81
5.5.260.0100.04320.66
5.5.250.0070.04320.60
5.5.240.0000.04320.25
5.4.450.0570.06019.59
5.4.440.0230.07019.57
5.4.430.0800.06719.63
5.4.420.0830.06019.61
5.4.410.1070.06019.28
5.4.400.0700.06319.32
5.4.390.1100.05719.12
5.4.380.0470.05318.52
5.4.370.0230.06318.57
5.4.360.0430.06018.44
5.4.350.0270.05718.58
5.4.340.0370.04718.79
5.4.320.0060.03912.52
5.4.310.0100.04812.51
5.4.300.0060.04212.52
5.4.290.0090.03912.52
5.4.280.0070.03712.41
5.4.270.0050.04012.41
5.4.260.0090.03612.41
5.4.250.0060.04012.41
5.4.240.0070.03912.41
5.4.230.0040.04112.40
5.4.220.0080.03512.40
5.4.210.0100.03612.40
5.4.200.0100.03912.40
5.4.190.0060.03812.40
5.4.180.0050.03812.39
5.4.170.0040.03912.41
5.4.160.0080.03812.40
5.4.150.0060.03812.40
5.4.140.0070.04112.08
5.4.130.0110.03612.07
5.4.120.0050.04612.03
5.4.110.0100.04312.02
5.4.100.0090.04312.03
5.4.90.0070.04312.03
5.4.80.0120.07212.03
5.4.70.0080.04812.02
5.4.60.0230.07412.02
5.4.50.0170.05212.02
5.4.40.0120.04812.01
5.4.30.0070.05212.01
5.4.20.0110.04912.00
5.4.10.0160.07012.00
5.4.00.0220.09911.49
5.3.290.0090.03612.80
5.3.280.0200.09312.71
5.3.270.0080.07312.72
5.3.260.0110.07012.72
5.3.250.0080.06812.72
5.3.240.0170.06612.72
5.3.230.0170.09012.71
5.3.220.0250.07312.68
5.3.210.0140.04912.68
5.3.200.0110.05612.68
5.3.190.0060.05412.67
5.3.180.0090.05612.68
5.3.170.0130.07912.67
5.3.160.0080.05412.67
5.3.150.0190.05712.68
5.3.140.0080.04812.66
5.3.130.0090.04512.66
5.3.120.0090.04512.66
5.3.110.0090.04212.66
5.3.100.0080.04112.14
5.3.90.0080.04812.12
5.3.80.0090.03912.11
5.3.70.0070.05212.11
5.3.60.0100.05512.10
5.3.50.0120.05312.04
5.3.40.0070.05312.04
5.3.30.0100.03812.00
5.3.20.0080.04311.78
5.3.10.0120.03911.75
5.3.00.0080.06611.74
5.2.170.0070.0439.24
5.2.160.0050.0459.24
5.2.150.0060.0459.24
5.2.140.0120.0559.24
5.2.130.0070.0449.20
5.2.120.0080.0419.20
5.2.110.0070.0369.20
5.2.100.0080.0379.20
5.2.90.0050.0449.19
5.2.80.0090.0319.19
5.2.70.0080.0379.19
5.2.60.0070.0299.15
5.2.50.0080.0299.12
5.2.40.0060.0409.10
5.2.30.0070.0339.07
5.2.20.0100.0279.06
5.2.10.0040.0328.96
5.2.00.0060.0318.82
5.1.60.0030.0278.11
5.1.50.0060.0268.11
5.1.40.0080.0268.09
5.1.30.0050.0398.44
5.1.20.0060.0398.46
5.1.10.0070.0378.19
5.1.00.0080.0368.19
5.0.50.0040.0256.66
5.0.40.0020.0236.53
5.0.30.0030.0366.34
5.0.20.0050.0196.30
5.0.10.0010.0256.29
5.0.00.0040.0386.28
4.4.90.0070.0204.77
4.4.80.0030.0214.76
4.4.70.0050.0194.75
4.4.60.0040.0204.75
4.4.50.0040.0184.77
4.4.40.0050.0274.71
4.4.30.0050.0174.76
4.4.20.0050.0204.84
4.4.10.0000.0264.85
4.4.00.0010.0324.76
4.3.110.0030.0244.67
4.3.100.0060.0174.67
4.3.90.0040.0214.63
4.3.80.0060.0284.59
4.3.70.0050.0204.63
4.3.60.0040.0164.63
4.3.50.0060.0234.63
4.3.40.0040.0314.54
4.3.30.0040.0253.32
4.3.20.0050.0213.30
4.3.10.0040.0203.27
4.3.00.0070.0237.06

preferences:
38.52 ms | 401 KiB | 5 Q