3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replace_old_chrs_utf8($str) { $vd = strtoupper('ð'); $old = array('æ', 'Æ', 'è', 'È', 'ð', $vd); $new = array('ć', 'Ć', 'č', 'Č', 'đ', 'Đ'); $fin = str_replace($old, $new, $str); return $fin; } $testString = 'æ-Æ bananna è moose Èð'; var_dump(replace_old_chrs_utf8($testString));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/08jmH
function name:  (null)
number of ops:  8
compiled vars:  !0 = $testString
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, '%C3%A6-%C3%86+bananna+%C3%A8+moose+%C3%88%C3%B0'
   14     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'replace_old_chrs_utf8'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function replace_old_chrs_utf8:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/08jmH
function name:  replace_old_chrs_utf8
number of ops:  21
compiled vars:  !0 = $str, !1 = $vd, !2 = $old, !3 = $new, !4 = $fin
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'strtoupper'
          2        SEND_VAL                                                 '%C3%B0'
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    5     5        INIT_ARRAY                                       ~7      '%C3%A6'
          6        ADD_ARRAY_ELEMENT                                ~7      '%C3%86'
          7        ADD_ARRAY_ELEMENT                                ~7      '%C3%A8'
          8        ADD_ARRAY_ELEMENT                                ~7      '%C3%88'
          9        ADD_ARRAY_ELEMENT                                ~7      '%C3%B0'
         10        ADD_ARRAY_ELEMENT                                ~7      !1
         11        ASSIGN                                                   !2, ~7
    6    12        ASSIGN                                                   !3, <array>
    8    13        INIT_FCALL                                               'str_replace'
         14        SEND_VAR                                                 !2
         15        SEND_VAR                                                 !3
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $10     
         18        ASSIGN                                                   !4, $10
    9    19      > RETURN                                                   !4
   10    20*     > RETURN                                                   null

End of function replace_old_chrs_utf8

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.75 ms | 1399 KiB | 20 Q