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.0070.00716.50
8.3.50.0130.00522.04
8.3.40.0070.01018.84
8.3.30.0170.00318.78
8.3.20.0040.00420.32
8.3.10.0070.00023.73
8.3.00.0000.00720.64
8.2.180.0090.01216.63
8.2.170.0040.01122.96
8.2.160.0100.00320.52
8.2.150.0030.00524.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0030.00520.78
8.2.110.0040.00422.24
8.2.100.0040.00817.72
8.2.90.0030.00619.11
8.2.80.0040.00417.97
8.2.70.0030.00617.25
8.2.60.0000.00817.68
8.2.50.0080.00018.07
8.2.40.0050.00321.02
8.2.30.0040.00418.05
8.2.20.0080.00017.55
8.2.10.0050.00217.98
8.2.00.0000.00717.53
8.1.280.0180.00025.92
8.1.270.0080.00323.96
8.1.260.0030.00626.35
8.1.250.0050.00328.09
8.1.240.0040.00423.97
8.1.230.0070.00419.08
8.1.220.0070.00017.74
8.1.210.0040.00418.77
8.1.200.0060.00317.10
8.1.190.0000.00817.10
8.1.180.0050.00318.10
8.1.170.0030.00618.57
8.1.160.0040.00421.93
8.1.150.0050.00218.49
8.1.140.0070.00017.32
8.1.130.0030.00317.23
8.1.120.0070.00017.41
8.1.110.0040.00417.23
8.1.100.0040.00417.21
8.1.90.0070.00017.16
8.1.80.0070.00017.39
8.1.70.0000.00817.34
8.1.60.0000.00817.45
8.1.50.0000.00817.44
8.1.40.0040.00417.37
8.1.30.0040.00417.48
8.1.20.0000.00817.58
8.1.10.0000.01117.27
8.1.00.0050.00317.29
8.0.300.0070.00018.77
8.0.290.0070.00016.91
8.0.280.0000.00718.31
8.0.270.0030.00517.14
8.0.260.0030.00316.62
8.0.250.0000.00716.73
8.0.240.0000.00716.80
8.0.230.0000.00716.89
8.0.220.0040.00416.71
8.0.210.0030.00316.69
8.0.200.0040.00416.84
8.0.190.0000.00716.86
8.0.180.0000.00716.84
8.0.170.0030.00516.75
8.0.160.0030.00316.87
8.0.150.0000.00716.69
8.0.140.0000.00716.67
8.0.130.0000.00613.25
8.0.120.0040.00416.68
8.0.110.0000.00716.65
8.0.100.0000.00716.88
8.0.90.0000.00816.80
8.0.80.0130.00316.77
8.0.70.0040.00416.62
8.0.60.0070.00016.63
8.0.50.0040.00416.71
8.0.30.0090.00916.84
8.0.20.0060.01317.40
8.0.10.0070.00016.99
8.0.00.0070.01416.73
7.4.330.0030.00315.13
7.4.320.0030.00316.75
7.4.300.0000.00816.75
7.4.290.0070.00316.76
7.4.280.0030.00616.86
7.4.270.0030.00616.72
7.4.260.0000.00716.83
7.4.250.0000.00916.73
7.4.240.0020.00516.74
7.4.230.0030.00316.90
7.4.220.0150.00316.84
7.4.210.0030.01016.78
7.4.200.0040.00416.63
7.4.190.0000.00716.60
7.4.160.0060.01116.75
7.4.150.0080.01117.40
7.4.140.0110.00817.86
7.4.130.0110.00716.78
7.4.120.0120.00616.89
7.4.110.0070.01016.91
7.4.100.0100.01316.56
7.4.90.0100.00716.55
7.4.80.0150.00619.39
7.4.70.0120.00416.75
7.4.60.0060.01216.80
7.4.50.0000.00416.83
7.4.40.0100.00716.64
7.4.30.0100.00716.68
7.4.10.0070.01115.20
7.4.00.0060.01015.16
7.3.330.0060.00013.51
7.3.320.0060.00013.47
7.3.310.0080.00016.36
7.3.300.0050.00316.55
7.3.290.0000.01716.59
7.3.280.0070.01116.53
7.3.270.0030.01517.40
7.3.260.0120.01216.53
7.3.250.0100.00816.58
7.3.240.0100.00716.57
7.3.230.0080.00816.80
7.3.210.0120.00916.62
7.3.200.0140.00519.39
7.3.190.0090.00916.79
7.3.180.0090.00616.76
7.3.170.0020.01516.68
7.3.160.0060.00916.55
7.3.130.0090.00615.25
7.3.120.0050.01115.06
7.3.110.0080.01115.06
7.3.100.0080.00615.12
7.3.90.0040.00915.03
7.3.80.0040.00815.20
7.3.70.0070.00715.13
7.3.60.0050.00815.19
7.3.50.0050.00914.93
7.3.40.0070.01015.10
7.3.30.0080.00715.17
7.3.20.0110.00316.83
7.3.10.0090.00616.95
7.3.00.0040.00916.91
7.2.330.0130.00616.89
7.2.320.0120.00616.91
7.2.310.0170.00716.88
7.2.300.0130.00517.05
7.2.290.0090.00916.90
7.2.260.0070.01015.28
7.2.250.0080.01115.40
7.2.240.0110.00615.20
7.2.230.0040.01215.30
7.2.220.0050.00815.34
7.2.210.0100.00415.35
7.2.200.0030.01115.22
7.2.190.0060.00515.35
7.2.180.0060.00815.39
7.2.170.0070.00515.25
7.2.160.0090.00315.18
7.2.150.0040.00717.09
7.2.140.0090.00617.11
7.2.130.0070.00617.07
7.2.120.0030.00917.04
7.2.110.0100.00617.04
7.2.100.0090.00517.21
7.2.90.0060.00517.03
7.2.80.0040.00817.13
7.2.70.0080.00517.32
7.2.60.0070.00417.14
7.2.50.0060.00617.10
7.2.40.0020.01217.28
7.2.30.0060.00817.30
7.2.20.0040.00817.10
7.2.10.0050.00817.19
7.2.00.0040.00917.95
7.1.330.0020.01315.96
7.1.320.0030.00916.13
7.1.310.0080.00216.04
7.1.300.0080.00516.04
7.1.290.0060.00616.02
7.1.280.0030.00815.79
7.1.270.0150.00216.00
7.1.260.0080.00616.01
7.1.250.0040.00615.88
7.1.240.0070.00715.66
7.1.230.0080.00015.99
7.1.220.0040.01116.02
7.1.210.0000.00916.01
7.1.200.0050.01016.01
7.1.190.0030.01315.89
7.1.180.0030.00615.86
7.1.170.0060.00916.02
7.1.160.0070.01116.03
7.1.150.0090.00916.00
7.1.140.0040.00816.13
7.1.130.0060.00615.96
7.1.120.0040.01115.98
7.1.110.0060.00816.16
7.1.100.0070.00917.09
7.1.90.0000.01516.13
7.1.80.0040.00815.85
7.1.70.0060.00616.77
7.1.60.0150.00317.77
7.1.50.0060.00716.72
7.1.40.0030.00615.99
7.1.30.0040.01015.95
7.1.20.0000.01016.06
7.1.10.0060.00916.09
7.1.00.0080.03819.20
7.0.330.0080.00415.79
7.0.320.0030.00615.63
7.0.310.0080.00815.52
7.0.300.0070.00715.34
7.0.290.0090.00615.65
7.0.280.0060.00615.40
7.0.270.0000.01515.51
7.0.260.0000.01015.48
7.0.250.0060.00315.22
7.0.240.0060.00915.39
7.0.230.0030.01115.66
7.0.220.0000.01215.41
7.0.210.0070.00415.76
7.0.200.0020.00816.11
7.0.190.0030.00915.46
7.0.180.0000.01215.71
7.0.170.0000.01215.50
7.0.160.0070.00415.60
7.0.150.0080.00415.73
7.0.140.0050.04018.83
7.0.130.0060.00615.68
7.0.120.0070.00715.72
7.0.110.0000.01315.60
7.0.100.0060.00615.44
7.0.90.0070.00315.77
7.0.80.0060.00615.68
7.0.70.0060.01015.72
7.0.60.0030.04518.69
7.0.50.0030.03516.88
7.0.40.0080.03516.89
7.0.30.0200.04216.92
7.0.20.0150.03917.00
7.0.10.0070.04816.88
7.0.00.0070.03317.01
5.6.400.0030.01014.74
5.6.390.0030.01014.46
5.6.380.0060.00914.73
5.6.370.0090.00914.64
5.6.360.0100.00314.53
5.6.350.0060.01314.45
5.6.340.0060.00614.11
5.6.330.0050.00514.71
5.6.320.0060.00614.14
5.6.310.0060.00614.34
5.6.300.0060.00614.35
5.6.290.0040.01114.57
5.6.280.0050.04017.82
5.6.270.0000.01314.58
5.6.260.0040.00414.71
5.6.250.0060.00614.16
5.6.240.0040.00714.64
5.6.230.0040.01114.44
5.6.220.0060.00814.52
5.6.210.0040.02217.60
5.6.200.0080.04216.24
5.6.190.0080.03817.55
5.6.180.0070.04517.56
5.6.170.0120.02717.54
5.6.160.0130.03816.24
5.6.150.0030.02616.26
5.6.140.0030.04416.32
5.6.130.0100.03916.28
5.6.120.0050.02417.76
5.6.110.0080.04317.71
5.6.100.0140.03617.69
5.6.90.0070.03017.93
5.6.80.0060.02517.37
5.6.70.0060.00614.33
5.6.60.0040.00814.58
5.6.50.0030.01014.32
5.6.40.0070.00714.56
5.6.30.0030.01014.32
5.6.20.0060.00614.37
5.6.10.0030.00614.39
5.6.00.0060.00914.39
5.5.380.0030.00814.66
5.5.370.0040.00814.55
5.5.360.0000.01414.39
5.5.350.0140.02017.42
5.5.340.0030.03116.14
5.5.330.0080.03417.44
5.5.320.0180.04217.49
5.5.310.0170.04217.62
5.5.300.0080.03616.28
5.5.290.0060.03516.11
5.5.280.0030.02417.57
5.5.270.0090.04517.61
5.5.260.0060.02217.54
5.5.250.0150.03317.53
5.5.240.0230.03317.33
5.5.230.0030.01014.43
5.5.220.0080.00314.19
5.5.210.0030.00714.28
5.5.200.0000.01014.32
5.5.190.0000.01414.10
5.5.180.0040.00714.50
5.5.170.0040.01114.54
5.5.160.0000.01014.52
5.5.150.0120.00314.57
5.5.140.0000.01414.37
5.5.130.0000.01014.26
5.5.120.0070.00714.33
5.5.110.0100.00314.46
5.5.100.0070.00314.30
5.5.90.0000.00914.40
5.5.80.0060.00614.50
5.5.70.0030.01014.50
5.5.60.0040.00714.20
5.5.50.0030.01013.95
5.5.40.0070.00414.07
5.5.30.0120.00314.70
5.5.20.0000.01214.48
5.5.10.0030.01014.22
5.5.00.0070.01014.04
5.4.450.0100.03015.20
5.4.440.0390.03315.47
5.4.430.0430.03215.13
5.4.420.0400.03215.54
5.4.410.0600.03015.26
5.4.400.0450.03515.18
5.4.390.0560.03415.08
5.4.380.0150.03614.85
5.4.370.0230.03314.94
5.4.360.0210.03115.11
5.4.350.0250.03014.92
5.4.340.0170.03214.91
5.4.330.0070.00711.20
5.4.320.0060.01811.69
5.4.310.0050.02411.79
5.4.300.0050.02211.75
5.4.290.0040.02311.87
5.4.280.0070.02111.73
5.4.270.0040.02711.90
5.4.260.0060.03111.69
5.4.250.0060.02311.92
5.4.240.0080.02111.77
5.4.230.0060.02411.70
5.4.220.0050.02411.84
5.4.210.0040.02311.76
5.4.200.0080.02711.80
5.4.190.0050.02511.76
5.4.180.0070.02811.79
5.4.170.0040.03111.80
5.4.160.0090.02311.82
5.4.150.0110.02311.64
5.4.140.0040.03011.73
5.4.130.0070.02411.60
5.4.120.0080.02711.54
5.4.110.0070.02511.51
5.4.100.0050.02311.59
5.4.90.0020.02311.66
5.4.80.0060.02011.73
5.4.70.0050.02311.63
5.4.60.0030.02411.63
5.4.50.0080.01811.56
5.4.40.0060.02211.54
5.4.30.0100.01811.55
5.4.20.0070.02111.54
5.4.10.0070.02011.73
5.4.00.0070.02011.33
5.3.290.0090.01811.87
5.3.280.0060.02211.61
5.3.270.0080.03311.80
5.3.260.0040.03411.79
5.3.250.0050.02911.77
5.3.240.0050.03511.72
5.3.230.0060.03111.75
5.3.220.0070.03811.51
5.3.210.0040.03911.63
5.3.200.0100.02911.54
5.3.190.0120.04211.67
5.3.180.0060.02911.72
5.3.170.0040.03211.74
5.3.160.0060.02811.72
5.3.150.0060.02911.75
5.3.140.0080.03011.60
5.3.130.0060.03111.69
5.3.120.0060.02611.59
5.3.110.0040.03211.68
5.3.100.0030.02511.30
5.3.90.0050.01911.45
5.3.80.0050.02111.43
5.3.70.0050.02211.26
5.3.60.0050.02111.33
5.3.50.0050.02311.33
5.3.40.0040.02011.33
5.3.30.0020.03011.22
5.3.20.0050.02211.28
5.3.10.0050.01911.04
5.3.00.0040.02111.02
5.2.170.0040.0359.24
5.2.160.0060.0289.24
5.2.150.0040.0329.24
5.2.140.0060.0379.23
5.2.130.0050.0299.20
5.2.120.0050.0289.19
5.2.110.0080.0269.20
5.2.100.0030.0389.20
5.2.90.0060.0439.19
5.2.80.0070.0399.19
5.2.70.0060.0319.19
5.2.60.0050.0359.15
5.2.50.0050.0329.12
5.2.40.0050.0389.11
5.2.30.0050.0369.06
5.2.20.0060.0359.06
5.2.10.0020.0328.96
5.2.00.0050.0338.82
5.1.60.0060.0258.11
5.1.50.0030.0278.11
5.1.40.0030.0268.08
5.1.30.0040.0278.43
5.1.20.0030.0288.46
5.1.10.0040.0298.19
5.1.00.0040.0278.19
5.0.50.0050.0226.66
5.0.40.0050.0186.53
5.0.30.0030.0326.33
5.0.20.0050.0186.30
5.0.10.0020.0226.29
5.0.00.0020.0326.28
4.4.90.0030.0154.78
4.4.80.0010.0174.75
4.4.70.0030.0154.75
4.4.60.0020.0164.76
4.4.50.0020.0164.77
4.4.40.0020.0284.71
4.4.30.0020.0164.76
4.4.20.0010.0184.84
4.4.10.0040.0164.84
4.4.00.0030.0264.76
4.3.110.0040.0184.67
4.3.100.0020.0184.67
4.3.90.0020.0204.63
4.3.80.0030.0324.58
4.3.70.0020.0224.63
4.3.60.0020.0234.63
4.3.50.0050.0214.63
4.3.40.0020.0344.54
4.3.30.0050.0203.32
4.3.20.0020.0163.30
4.3.10.0040.0143.26
4.3.00.0030.0237.07

preferences:
48.6 ms | 401 KiB | 5 Q