3v4l.org

run code in 300+ PHP versions simultaneously
<?php function uord($str) { $arr = ($str = unpack('C*', substr($str, 0, 4))) ? $str[1] : 0; if (0xF0 <= $arr) return (($arr - 0xF0)<<18) + (($str[2] - 0x80)<<12) + (($str[3] - 0x80)<<6) + $str[4] - 0x80; if (0xE0 <= $arr) return (($arr - 0xE0)<<12) + (($str[2] - 0x80)<<6) + $str[3] - 0x80; if (0xC0 <= $arr) return (($arr - 0xC0)<<6) + $str[2] - 0x80; return $arr; } function uchr ($codes) { if (is_scalar($codes)) $codes = func_get_args(); $str = ''; foreach ($codes as $code) $str .= html_entity_decode('&#'.$code.';',ENT_NOQUOTES,'UTF-8'); return $str; } $str = "Düsseldorf ist scheiße!"; print_r(uord($str)); echo '<br/>'; echo uchr(23383); echo '<br/>'; echo uchr(23383,215,23383); echo '<br/>'; echo uchr(array(23383,215,23383,215,23383)); echo '<br/>';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hYjhp
function name:  (null)
number of ops:  26
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 'D%C3%BCsseldorf+ist+schei%C3%9Fe%21'
   19     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'uord'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
   20     7        ECHO                                                     '%3Cbr%2F%3E'
   21     8        INIT_FCALL                                               'uchr'
          9        SEND_VAL                                                 23383
         10        DO_FCALL                                      0  $4      
         11        ECHO                                                     $4
   22    12        ECHO                                                     '%3Cbr%2F%3E'
   23    13        INIT_FCALL                                               'uchr'
         14        SEND_VAL                                                 23383
         15        SEND_VAL                                                 215
         16        SEND_VAL                                                 23383
         17        DO_FCALL                                      0  $5      
         18        ECHO                                                     $5
   24    19        ECHO                                                     '%3Cbr%2F%3E'
   25    20        INIT_FCALL                                               'uchr'
         21        SEND_VAL                                                 <array>
         22        DO_FCALL                                      0  $6      
         23        ECHO                                                     $6
   26    24        ECHO                                                     '%3Cbr%2F%3E'
         25      > RETURN                                                   1

Function uord:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 33
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 45
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 53
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 33
Branch analysis from position: 19
Branch analysis from position: 33
filename:       /in/hYjhp
function name:  uord
number of ops:  55
compiled vars:  !0 = $str, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'unpack'
          2        SEND_VAL                                                 'C%2A'
          3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 4
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                         $3      
         10        ASSIGN                                           ~4      !0, $3
         11      > JMPZ                                                     ~4, ->15
         12    >   FETCH_DIM_R                                      ~5      !0, 1
         13        QM_ASSIGN                                        ~6      ~5
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~6      0
         16    >   ASSIGN                                                   !1, ~6
    6    17        IS_SMALLER_OR_EQUAL                                      240, !1
         18      > JMPZ                                                     ~8, ->33
         19    >   SUB                                              ~9      !1, 240
         20        SL                                               ~10     ~9, 18
         21        FETCH_DIM_R                                      ~11     !0, 2
         22        SUB                                              ~12     ~11, 128
         23        SL                                               ~13     ~12, 12
         24        ADD                                              ~14     ~10, ~13
         25        FETCH_DIM_R                                      ~15     !0, 3
         26        SUB                                              ~16     ~15, 128
         27        SL                                               ~17     ~16, 6
         28        ADD                                              ~18     ~14, ~17
         29        FETCH_DIM_R                                      ~19     !0, 4
         30        ADD                                              ~20     ~18, ~19
         31        SUB                                              ~21     ~20, 128
         32      > RETURN                                                   ~21
    7    33    >   IS_SMALLER_OR_EQUAL                                      224, !1
         34      > JMPZ                                                     ~22, ->45
         35    >   SUB                                              ~23     !1, 224
         36        SL                                               ~24     ~23, 12
         37        FETCH_DIM_R                                      ~25     !0, 2
         38        SUB                                              ~26     ~25, 128
         39        SL                                               ~27     ~26, 6
         40        ADD                                              ~28     ~24, ~27
         41        FETCH_DIM_R                                      ~29     !0, 3
         42        ADD                                              ~30     ~28, ~29
         43        SUB                                              ~31     ~30, 128
         44      > RETURN                                                   ~31
    8    45    >   IS_SMALLER_OR_EQUAL                                      192, !1
         46      > JMPZ                                                     ~32, ->53
         47    >   SUB                                              ~33     !1, 192
         48        SL                                               ~34     ~33, 6
         49        FETCH_DIM_R                                      ~35     !0, 2
         50        ADD                                              ~36     ~34, ~35
         51        SUB                                              ~37     ~36, 128
         52      > RETURN                                                   ~37
    9    53    > > RETURN                                                   !1
   10    54*     > RETURN                                                   null

End of function uord

Function uchr:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 5
filename:       /in/hYjhp
function name:  uchr
number of ops:  20
compiled vars:  !0 = $codes, !1 = $str, !2 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        TYPE_CHECK                                  124          !0
          2      > JMPZ                                                     ~3, ->5
          3    >   FUNC_GET_ARGS                                    ~4      
          4        ASSIGN                                                   !0, ~4
   14     5    >   ASSIGN                                                   !1, ''
   15     6      > FE_RESET_R                                       $7      !0, ->17
          7    > > FE_FETCH_R                                               $7, !2, ->17
          8    >   INIT_FCALL                                               'html_entity_decode'
          9        CONCAT                                           ~8      '%26%23', !2
         10        CONCAT                                           ~9      ~8, '%3B'
         11        SEND_VAL                                                 ~9
         12        SEND_VAL                                                 0
         13        SEND_VAL                                                 'UTF-8'
         14        DO_ICALL                                         $10     
         15        ASSIGN_OP                                     8          !1, $10
         16      > JMP                                                      ->7
         17    >   FE_FREE                                                  $7
   16    18      > RETURN                                                   !1
   17    19*     > RETURN                                                   null

End of function uchr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.41 ms | 1407 KiB | 28 Q