3v4l.org

run code in 300+ PHP versions simultaneously
<?php function character_iterator ($str) { $len=strlen($str); for ($i=0;$i<$len;++$i) yield ord($str[$i]); } function code_point_iterator ($str) { $i=0; $cp=0; foreach (character_iterator(iconv('utf-8','utf-32be',$str)) as $b) { if ($i===4) { $i=0; yield $cp; $cp=0; } $cp<<=8; $cp|=$b; ++$i; } if ($i!==0) yield $cp; } foreach (code_point_iterator('schieße') as $cp) var_dump(\IntlChar::charName(\IntlChar::foldCase($cp))); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/TMmpL
function name:  (null)
number of ops:  17
compiled vars:  !0 = $cp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   INIT_FCALL                                               'code_point_iterator'
          1        SEND_VAL                                                 'schie%C3%9Fe'
          2        DO_FCALL                                      0  $1      
          3      > FE_RESET_R                                       $2      $1, ->15
          4    > > FE_FETCH_R                                               $2, !0, ->15
          5    >   INIT_FCALL                                               'var_dump'
          6        INIT_STATIC_METHOD_CALL                                  'IntlChar', 'charName'
          7        INIT_STATIC_METHOD_CALL                                  'IntlChar', 'foldCase'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $3      
         10        SEND_VAR_NO_REF_EX                                       $3
         11        DO_FCALL                                      0  $4      
         12        SEND_VAR                                                 $4
         13        DO_ICALL                                                 
         14      > JMP                                                      ->4
         15    >   FE_FREE                                                  $2
   35    16      > RETURN                                                   1

Function character_iterator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
Branch analysis from position: 6
filename:       /in/TMmpL
function name:  character_iterator
number of ops:  15
compiled vars:  !0 = $str, !1 = $len, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
    5     2        STRLEN                                           ~3      !0
          3        ASSIGN                                                   !1, ~3
    6     4        ASSIGN                                                   !2, 0
          5      > JMP                                                      ->12
          6    >   INIT_FCALL                                               'ord'
          7        FETCH_DIM_R                                      ~6      !0, !2
          8        SEND_VAL                                                 ~6
          9        DO_ICALL                                         $7      
         10        YIELD                                                    $7
         11        PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, !1
         13      > JMPNZ                                                    ~10, ->6
    8    14    > > GENERATOR_RETURN                                         

End of function character_iterator

Function code_point_iterator:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 23
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 19
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 27
Branch analysis from position: 26
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 23
filename:       /in/TMmpL
function name:  code_point_iterator
number of ops:  28
compiled vars:  !0 = $str, !1 = $i, !2 = $cp, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
   12     2        ASSIGN                                                   !1, 0
   13     3        ASSIGN                                                   !2, 0
   14     4        INIT_FCALL                                               'character_iterator'
          5        INIT_FCALL_BY_NAME                                       'iconv'
          6        SEND_VAL_EX                                              'utf-8'
          7        SEND_VAL_EX                                              'utf-32be'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $6      
         10        SEND_VAR                                                 $6
         11        DO_FCALL                                      0  $7      
         12      > FE_RESET_R                                       $8      $7, ->23
         13    > > FE_FETCH_R                                               $8, !3, ->23
   16    14    >   IS_IDENTICAL                                             !1, 4
         15      > JMPZ                                                     ~9, ->19
   18    16    >   ASSIGN                                                   !1, 0
   19    17        YIELD                                                    !2
   20    18        ASSIGN                                                   !2, 0
   24    19    >   ASSIGN_OP                                     6          !2, 8
   25    20        ASSIGN_OP                                     9          !2, !3
   26    21        PRE_INC                                                  !1
   14    22      > JMP                                                      ->13
         23    >   FE_FREE                                                  $8
   29    24        IS_NOT_IDENTICAL                                         !1, 0
         25      > JMPZ                                                     ~16, ->27
         26    >   YIELD                                                    !2
   31    27    > > GENERATOR_RETURN                                         

End of function code_point_iterator

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.53 ms | 1394 KiB | 19 Q