3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo "<?php\n\n"; foreach (['e', 'f', 'n', 'r', 't', 'v'] as $c) { echo "const {$c} = \"\\{$c}\";\n"; } for ($i = 0; $i < 256; $i++) { $str = str_pad(strtoupper(dechex($i)), 2, '0', STR_PAD_LEFT); $p1 = [$str[0]]; if ($str[0] >= 'A' && $str[0] <= 'F') { $p1[] = strtolower($str[0]); } $p2 = [$str[1]]; if ($str[1] >= 'A' && $str[1] <= 'F') { $p2[] = strtolower($str[1]); } foreach ($p1 as $c1) foreach ($p2 as $c2) echo "const x{$c1}{$c2} = \"\\x{$str}\";\n"; }
based on jv844
Output for 5.4.0 - 7.2.0
<?php const e = "\e"; const f = "\f"; const n = "\n"; const r = "\r"; const t = "\t"; const v = "\v"; const x00 = "\x00"; const x01 = "\x01"; const x02 = "\x02"; const x03 = "\x03"; const x04 = "\x04"; const x05 = "\x05"; const x06 = "\x06"; const x07 = "\x07"; const x08 = "\x08"; const x09 = "\x09"; const x0A = "\x0A"; const x0a = "\x0A"; const x0B = "\x0B"; const x0b = "\x0B"; const x0C = "\x0C"; const x0c = "\x0C"; const x0D = "\x0D"; const x0d = "\x0D"; const x0E = "\x0E"; const x0e = "\x0E"; const x0F = "\x0F"; const x0f = "\x0F"; const x10 = "\x10"; const x11 = "\x11"; const x12 = "\x12"; const x13 = "\x13"; const x14 = "\x14"; const x15 = "\x15"; const x16 = "\x16"; const x17 = "\x17"; const x18 = "\x18"; const x19 = "\x19"; const x1A = "\x1A"; const x1a = "\x1A"; const x1B = "\x1B"; const x1b = "\x1B"; const x1C = "\x1C"; const x1c = "\x1C"; const x1D = "\x1D"; const x1d = "\x1D"; const x1E = "\x1E"; const x1e = "\x1E"; const x1F = "\x1F"; const x1f = "\x1F"; const x20 = "\x20"; const x21 = "\x21"; const x22 = "\x22"; const x23 = "\x23"; const x24 = "\x24"; const x25 = "\x25"; const x26 = "\x26"; const x27 = "\x27"; const x28 = "\x28"; const x29 = "\x29"; const x2A = "\x2A"; const x2a = "\x2A"; const x2B = "\x2B"; const x2b = "\x2B"; const x2C = "\x2C"; const x2c = "\x2C"; const x2D = "\x2D"; const x2d = "\x2D"; const x2E = "\x2E"; const x2e = "\x2E"; const x2F = "\x2F"; const x2f = "\x2F"; const x30 = "\x30"; const x31 = "\x31"; const x32 = "\x32"; const x33 = "\x33"; const x34 = "\x34"; const x35 = "\x35"; const x36 = "\x36"; const x37 = "\x37"; const x38 = "\x38"; const x39 = "\x39"; const x3A = "\x3A"; const x3a = "\x3A"; const x3B = "\x3B"; const x3b = "\x3B"; const x3C = "\x3C"; const x3c = "\x3C"; const x3D = "\x3D"; const x3d = "\x3D"; const x3E = "\x3E"; const x3e = "\x3E"; const x3F = "\x3F"; const x3f = "\x3F"; const x40 = "\x40"; const x41 = "\x41"; const x42 = "\x42"; const x43 = "\x43"; const x44 = "\x44"; const x45 = "\x45"; const x46 = "\x46"; const x47 = "\x47"; const x48 = "\x48"; const x49 = "\x49"; const x4A = "\x4A"; const x4a = "\x4A"; const x4B = "\x4B"; const x4b = "\x4B"; const x4C = "\x4C"; const x4c = "\x4C"; const x4D = "\x4D"; const x4d = "\x4D"; const x4E = "\x4E"; const x4e = "\x4E"; const x4F = "\x4F"; const x4f = "\x4F"; const x50 = "\x50"; const x51 = "\x51"; const x52 = "\x52"; const x53 = "\x53"; const x54 = "\x54"; const x55 = "\x55"; const x56 = "\x56"; const x57 = "\x57"; const x58 = "\x58"; const x59 = "\x59"; const x5A = "\x5A"; const x5a = "\x5A"; const x5B = "\x5B"; const x5b = "\x5B"; const x5C = "\x5C"; const x5c = "\x5C"; const x5D = "\x5D"; const x5d = "\x5D"; const x5E = "\x5E"; const x5e = "\x5E"; const x5F = "\x5F"; const x5f = "\x5F"; const x60 = "\x60"; const x61 = "\x61"; const x62 = "\x62"; const x63 = "\x63"; const x64 = "\x64"; const x65 = "\x65"; const x66 = "\x66"; const x67 = "\x67"; const x68 = "\x68"; const x69 = "\x69"; const x6A = "\x6A"; const x6a = "\x6A"; const x6B = "\x6B"; const x6b = "\x6B"; const x6C = "\x6C"; const x6c = "\x6C"; const x6D = "\x6D"; const x6d = "\x6D"; const x6E = "\x6E"; const x6e = "\x6E"; const x6F = "\x6F"; const x6f = "\x6F"; const x70 = "\x70"; const x71 = "\x71"; const x72 = "\x72"; const x73 = "\x73"; const x74 = "\x74"; const x75 = "\x75"; const x76 = "\x76"; const x77 = "\x77"; const x78 = "\x78"; const x79 = "\x79"; const x7A = "\x7A"; const x7a = "\x7A"; const x7B = "\x7B"; const x7b = "\x7B"; const x7C = "\x7C"; const x7c = "\x7C"; const x7D = "\x7D"; const x7d = "\x7D"; const x7E = "\x7E"; const x7e = "\x7E"; const x7F = "\x7F"; const x7f = "\x7F"; const x80 = "\x80"; const x81 = "\x81"; const x82 = "\x82"; const x83 = "\x83"; const x84 = "\x84"; const x85 = "\x85"; const x86 = "\x86"; const x87 = "\x87"; const x88 = "\x88"; const x89 = "\x89"; const x8A = "\x8A"; const x8a = "\x8A"; const x8B = "\x8B"; const x8b = "\x8B"; const x8C = "\x8C"; const x8c = "\x8C"; const x8D = "\x8D"; const x8d = "\x8D"; const x8E = "\x8E"; const x8e = "\x8E"; const x8F = "\x8F"; const x8f = "\x8F"; const x90 = "\x90"; const x91 = "\x91"; const x92 = "\x92"; const x93 = "\x93"; const x94 = "\x94"; const x95 = "\x95"; const x96 = "\x96"; const x97 = "\x97"; const x98 = "\x98"; const x99 = "\x99"; const x9A = "\x9A"; const x9a = "\x9A"; const x9B = "\x9B"; const x9b = "\x9B"; const x9C = "\x9C"; const x9c = "\x9C"; const x9D = "\x9D"; const x9d = "\x9D"; const x9E = "\x9E"; const x9e = "\x9E"; const x9F = "\x9F"; const x9f = "\x9F"; const xA0 = "\xA0"; const xa0 = "\xA0"; const xA1 = "\xA1"; const xa1 = "\xA1"; const xA2 = "\xA2"; const xa2 = "\xA2"; const xA3 = "\xA3"; const xa3 = "\xA3"; const xA4 = "\xA4"; const xa4 = "\xA4"; const xA5 = "\xA5"; const xa5 = "\xA5"; const xA6 = "\xA6"; const xa6 = "\xA6"; const xA7 = "\xA7"; const xa7 = "\xA7"; const xA8 = "\xA8"; const xa8 = "\xA8"; const xA9 = "\xA9"; const xa9 = "\xA9"; const xAA = "\xAA"; const xAa = "\xAA"; const xaA = "\xAA"; const xaa = "\xAA"; const xAB = "\xAB"; const xAb = "\xAB"; const xaB = "\xAB"; const xab = "\xAB"; const xAC = "\xAC"; const xAc = "\xAC"; const xaC = "\xAC"; const xac = "\xAC"; const xAD = "\xAD"; const xAd = "\xAD"; const xaD = "\xAD"; const xad = "\xAD"; const xAE = "\xAE"; const xAe = "\xAE"; const xaE = "\xAE"; const xae = "\xAE"; const xAF = "\xAF"; const xAf = "\xAF"; const xaF = "\xAF"; const xaf = "\xAF"; const xB0 = "\xB0"; const xb0 = "\xB0"; const xB1 = "\xB1"; const xb1 = "\xB1"; const xB2 = "\xB2"; const xb2 = "\xB2"; const xB3 = "\xB3"; const xb3 = "\xB3"; const xB4 = "\xB4"; const xb4 = "\xB4"; const xB5 = "\xB5"; const xb5 = "\xB5"; const xB6 = "\xB6"; const xb6 = "\xB6"; const xB7 = "\xB7"; const xb7 = "\xB7"; const xB8 = "\xB8"; const xb8 = "\xB8"; const xB9 = "\xB9"; const xb9 = "\xB9"; const xBA = "\xBA"; const xBa = "\xBA"; const xbA = "\xBA"; const xba = "\xBA"; const xBB = "\xBB"; const xBb = "\xBB"; const xbB = "\xBB"; const xbb = "\xBB"; const xBC = "\xBC"; const xBc = "\xBC"; const xbC = "\xBC"; const xbc = "\xBC"; const xBD = "\xBD"; const xBd = "\xBD"; const xbD = "\xBD"; const xbd = "\xBD"; const xBE = "\xBE"; const xBe = "\xBE"; const xbE = "\xBE"; const xbe = "\xBE"; const xBF = "\xBF"; const xBf = "\xBF"; const xbF = "\xBF"; const xbf = "\xBF"; const xC0 = "\xC0"; const xc0 = "\xC0"; const xC1 = "\xC1"; const xc1 = "\xC1"; const xC2 = "\xC2"; const xc2 = "\xC2"; const xC3 = "\xC3"; const xc3 = "\xC3"; const xC4 = "\xC4"; const xc4 = "\xC4"; const xC5 = "\xC5"; const xc5 = "\xC5"; const xC6 = "\xC6"; const xc6 = "\xC6"; const xC7 = "\xC7"; const xc7 = "\xC7"; const xC8 = "\xC8"; const xc8 = "\xC8"; const xC9 = "\xC9"; const xc9 = "\xC9"; const xCA = "\xCA"; const xCa = "\xCA"; const xcA = "\xCA"; const xca = "\xCA"; const xCB = "\xCB"; const xCb = "\xCB"; const xcB = "\xCB"; const xcb = "\xCB"; const xCC = "\xCC"; const xCc = "\xCC"; const xcC = "\xCC"; const xcc = "\xCC"; const xCD = "\xCD"; const xCd = "\xCD"; const xcD = "\xCD"; const xcd = "\xCD"; const xCE = "\xCE"; const xCe = "\xCE"; const xcE = "\xCE"; const xce = "\xCE"; const xCF = "\xCF"; const xCf = "\xCF"; const xcF = "\xCF"; const xcf = "\xCF"; const xD0 = "\xD0"; const xd0 = "\xD0"; const xD1 = "\xD1"; const xd1 = "\xD1"; const xD2 = "\xD2"; const xd2 = "\xD2"; const xD3 = "\xD3"; const xd3 = "\xD3"; const xD4 = "\xD4"; const xd4 = "\xD4"; const xD5 = "\xD5"; const xd5 = "\xD5"; const xD6 = "\xD6"; const xd6 = "\xD6"; const xD7 = "\xD7"; const xd7 = "\xD7"; const xD8 = "\xD8"; const xd8 = "\xD8"; const xD9 = "\xD9"; const xd9 = "\xD9"; const xDA = "\xDA"; const xDa = "\xDA"; const xdA = "\xDA"; const xda = "\xDA"; const xDB = "\xDB"; const xDb = "\xDB"; const xdB = "\xDB"; const xdb = "\xDB"; const xDC = "\xDC"; const xDc = "\xDC"; const xdC = "\xDC"; const xdc = "\xDC"; const xDD = "\xDD"; const xDd = "\xDD"; const xdD = "\xDD"; const xdd = "\xDD"; const xDE = "\xDE"; const xDe = "\xDE"; const xdE = "\xDE"; const xde = "\xDE"; const xDF = "\xDF"; const xDf = "\xDF"; const xdF = "\xDF"; const xdf = "\xDF"; const xE0 = "\xE0"; const xe0 = "\xE0"; const xE1 = "\xE1"; const xe1 = "\xE1"; const xE2 = "\xE2"; const xe2 = "\xE2"; const xE3 = "\xE3"; const xe3 = "\xE3"; const xE4 = "\xE4"; const xe4 = "\xE4"; const xE5 = "\xE5"; const xe5 = "\xE5"; const xE6 = "\xE6"; const xe6 = "\xE6"; const xE7 = "\xE7"; const xe7 = "\xE7"; const xE8 = "\xE8"; const xe8 = "\xE8"; const xE9 = "\xE9"; const xe9 = "\xE9"; const xEA = "\xEA"; const xEa = "\xEA"; const xeA = "\xEA"; const xea = "\xEA"; const xEB = "\xEB"; const xEb = "\xEB"; const xeB = "\xEB"; const xeb = "\xEB"; const xEC = "\xEC"; const xEc = "\xEC"; const xeC = "\xEC"; const xec = "\xEC"; const xED = "\xED"; const xEd = "\xED"; const xeD = "\xED"; const xed = "\xED"; const xEE = "\xEE"; const xEe = "\xEE"; const xeE = "\xEE"; const xee = "\xEE"; const xEF = "\xEF"; const xEf = "\xEF"; const xeF = "\xEF"; const xef = "\xEF"; const xF0 = "\xF0"; const xf0 = "\xF0"; const xF1 = "\xF1"; const xf1 = "\xF1"; const xF2 = "\xF2"; const xf2 = "\xF2"; const xF3 = "\xF3"; const xf3 = "\xF3"; const xF4 = "\xF4"; const xf4 = "\xF4"; const xF5 = "\xF5"; const xf5 = "\xF5"; const xF6 = "\xF6"; const xf6 = "\xF6"; const xF7 = "\xF7"; const xf7 = "\xF7"; const xF8 = "\xF8"; const xf8 = "\xF8"; const xF9 = "\xF9"; const xf9 = "\xF9"; const xFA = "\xFA"; const xFa = "\xFA"; const xfA = "\xFA"; const xfa = "\xFA"; const xFB = "\xFB"; const xFb = "\xFB"; const xfB = "\xFB"; const xfb = "\xFB"; const xFC = "\xFC"; const xFc = "\xFC"; const xfC = "\xFC"; const xfc = "\xFC"; const xFD = "\xFD"; const xFd = "\xFD"; const xfD = "\xFD"; const xfd = "\xFD"; const xFE = "\xFE"; const xFe = "\xFE"; const xfE = "\xFE"; const xfe = "\xFE"; const xFF = "\xFF"; const xFf = "\xFF"; const xfF = "\xFF"; const xff = "\xFF";
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/tlbTF on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/tlbTF on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/tlbTF on line 5
Process exited with code 255.