3v4l.org

run code in 300+ PHP versions simultaneously
<?php function _uniord($c) { if (ord($c{0}) >=0 && ord($c{0}) <= 127) return ord($c{0}); if (ord($c{0}) >= 192 && ord($c{0}) <= 223) return (ord($c{0})-192)*64 + (ord($c{1})-128); if (ord($c{0}) >= 224 && ord($c{0}) <= 239) return (ord($c{0})-224)*4096 + (ord($c{1})-128)*64 + (ord($c{2})-128); if (ord($c{0}) >= 240 && ord($c{0}) <= 247) return (ord($c{0})-240)*262144 + (ord($c{1})-128)*4096 + (ord($c{2})-128)*64 + (ord($c{3})-128); if (ord($c{0}) >= 248 && ord($c{0}) <= 251) return (ord($c{0})-248)*16777216 + (ord($c{1})-128)*262144 + (ord($c{2})-128)*4096 + (ord($c{3})-128)*64 + (ord($c{4})-128); if (ord($c{0}) >= 252 && ord($c{0}) <= 253) return (ord($c{0})-252)*1073741824 + (ord($c{1})-128)*16777216 + (ord($c{2})-128)*262144 + (ord($c{3})-128)*4096 + (ord($c{4})-128)*64 + (ord($c{5})-128); if (ord($c{0}) >= 254 && ord($c{0}) <= 255) // error return FALSE; return 0; } echo _uniord('ยง');
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /in/jDvVc on line 3
Process exited with code 255.
Output for 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 3 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 3 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 4 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 5 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 5 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 6 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 6 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 7 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 7 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 8 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 8 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 8 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 9 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 9 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 10 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 10 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 10 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 10 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 11 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 11 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 12 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 12 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 12 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 12 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 12 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 13 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 13 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 14 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 14 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 14 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 14 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 14 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 14 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 15 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/jDvVc on line 15 167
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.26
167

preferences:
271.92 ms | 404 KiB | 343 Q