3v4l.org

run code in 300+ PHP versions simultaneously
<?php mb_internal_encoding('windows-1252'); $string = '“'; $normalized = [ "\xC2\x80" => "\xE2\x82\xAC", // U+20AC Euro sign "\xC2\x82" => "\xE2\x80\x9A", // U+201A single low-9 quotation mark "\xC2\x83" => "\xC6\x92", // U+0192 latin small letter f with hook "\xC2\x84" => "\xE2\x80\x9E", // U+201E double low-9 quotation mark "\xC2\x85" => "\xE2\x80\xA6", // U+2026 horizontal ellipsis "\xC2\x86" => "\xE2\x80\xA0", // U+2020 dagger "\xC2\x87" => "\xE2\x80\xA1", // U+2021 double dagger "\xC2\x88" => "\xCB\x86", // U+02C6 modifier letter circumflex accent "\xC2\x89" => "\xE2\x80\xB0", // U+2030 per mille sign "\xC2\x8A" => "\xC5\xA0", // U+0160 latin capital letter s with caron "\xC2\x8B" => "\xE2\x80\xB9", // U+2039 single left-pointing angle quotation mark "\xC2\x8C" => "\xC5\x92", // U+0152 latin capital ligature oe "\xC2\x8E" => "\xC5\xBD", // U+017D latin capital letter z with caron "\xC2\x91" => "\xE2\x80\x98", // U+2018 left single quotation mark "\xC2\x92" => "\xE2\x80\x99", // U+2019 right single quotation mark "\xC2\x93" => "\xE2\x80\x9C", // U+201C left double quotation mark "\xC2\x94" => "\xE2\x80\x9D", // U+201D right double quotation mark "\xC2\x95" => "\xE2\x80\xA2", // U+2022 bullet "\xC2\x96" => "\xE2\x80\x93", // U+2013 en dash "\xC2\x97" => "\xE2\x80\x94", // U+2014 em dash "\xC2\x98" => "\xCB\x9C", // U+02DC small tilde "\xC2\x99" => "\xE2\x84\xA2", // U+2122 trade mark sign "\xC2\x9A" => "\xC5\xA1", // U+0161 latin small letter s with caron "\xC2\x9B" => "\xE2\x80\xBA", // U+203A single right-pointing angle quotation mark "\xC2\x9C" => "\xC5\x93", // U+0153 latin small ligature oe "\xC2\x9E" => "\xC5\xBE", // U+017E latin small letter z with caron "\xC2\x9F" => "\xC5\xB8", // U+0178 latin capital letter y with diaeresis ]; $string = str_replace(array_keys($normalized), array_values($normalized), $string); echo iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OITTs
function name:  (null)
number of ops:  24
compiled vars:  !0 = $string, !1 = $normalized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'mb_internal_encoding'
          1        SEND_VAL                                                 'windows-1252'
          2        DO_ICALL                                                 
    4     3        ASSIGN                                                   !0, '%E2%80%9C'
    6     4        ASSIGN                                                   !1, <array>
   35     5        INIT_FCALL                                               'str_replace'
          6        INIT_FCALL                                               'array_keys'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        INIT_FCALL                                               'array_values'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $6      
         13        SEND_VAR                                                 $6
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $7      
         16        ASSIGN                                                   !0, $7
   37    17        INIT_FCALL_BY_NAME                                       'iconv'
         18        SEND_VAL_EX                                              'UTF-8'
         19        SEND_VAL_EX                                              'ISO-8859-1%2F%2FTRANSLIT'
         20        SEND_VAR_EX                                              !0
         21        DO_FCALL                                      0  $9      
         22        ECHO                                                     $9
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.03 ms | 1395 KiB | 21 Q