3v4l.org

run code in 300+ PHP versions simultaneously
<?php $item = mb_convert_encoding( '¨l', 'ISO-8859-1', 'UTF-8' ); $encoding = 'UTF-8'; $ret = ''; $max = mb_strlen($item ?? '', $encoding); for ($i = 0; $i < $max; $i++) { $char = mb_substr($item, $i, 1, $encoding); $up = mb_strtoupper($char, $encoding); $low = mb_strtolower($char, $encoding); $ret .= ($up != $low) ? '[' . $up . $low . ']' : $char; } var_dump(utf8_decode($ret));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 17
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 41
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 17
Branch analysis from position: 46
Branch analysis from position: 17
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 17
Branch analysis from position: 46
Branch analysis from position: 17
filename:       /in/YijoA
function name:  (null)
number of ops:  53
compiled vars:  !0 = $item, !1 = $encoding, !2 = $ret, !3 = $max, !4 = $i, !5 = $char, !6 = $up, !7 = $low
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'mb_convert_encoding'
    4     1        SEND_VAL                                                 '%C2%A8l'
    5     2        SEND_VAL                                                 'ISO-8859-1'
    6     3        SEND_VAL                                                 'UTF-8'
    3     4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !0, $8
    8     6        ASSIGN                                                   !1, 'UTF-8'
   10     7        ASSIGN                                                   !2, ''
   11     8        INIT_FCALL                                               'mb_strlen'
          9        COALESCE                                         ~12     !0
         10        QM_ASSIGN                                        ~12     ''
         11        SEND_VAL                                                 ~12
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $13     
         14        ASSIGN                                                   !3, $13
   12    15        ASSIGN                                                   !4, 0
         16      > JMP                                                      ->44
   13    17    >   INIT_FCALL                                               'mb_substr'
         18        SEND_VAR                                                 !0
         19        SEND_VAR                                                 !4
         20        SEND_VAL                                                 1
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $16     
         23        ASSIGN                                                   !5, $16
   14    24        INIT_FCALL                                               'mb_strtoupper'
         25        SEND_VAR                                                 !5
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                         $18     
         28        ASSIGN                                                   !6, $18
   15    29        INIT_FCALL                                               'mb_strtolower'
         30        SEND_VAR                                                 !5
         31        SEND_VAR                                                 !1
         32        DO_ICALL                                         $20     
         33        ASSIGN                                                   !7, $20
   16    34        IS_NOT_EQUAL                                             !6, !7
         35      > JMPZ                                                     ~22, ->41
         36    >   CONCAT                                           ~23     '%5B', !6
         37        CONCAT                                           ~24     ~23, !7
         38        CONCAT                                           ~25     ~24, '%5D'
         39        QM_ASSIGN                                        ~26     ~25
         40      > JMP                                                      ->42
         41    >   QM_ASSIGN                                        ~26     !5
         42    >   ASSIGN_OP                                     8          !2, ~26
   12    43        PRE_INC                                                  !4
         44    >   IS_SMALLER                                               !4, !3
         45      > JMPNZ                                                    ~29, ->17
   19    46    >   INIT_FCALL                                               'var_dump'
         47        INIT_FCALL                                               'utf8_decode'
         48        SEND_VAR                                                 !2
         49        DO_FCALL_BY_NAME                                         
         50        SEND_VAR                                                 $30
         51        DO_ICALL                                                 
         52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.6 ms | 1444 KiB | 20 Q