3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ords_to_unistr($ords, $encoding = 'UTF-8'){ // Turns an array of ordinal values into a string of unicode characters $str = ''; for($i = 0; $i < sizeof($ords); $i++){ // Pack this number into a 4-byte string // (Or multiple one-byte strings, depending on context.) $v = $ords[$i]; $str .= pack("N",$v); } $str = mb_convert_encoding($str,$encoding,"UCS-4BE"); return($str); } echo ords_to_unistr(array(239));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n2tk0
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'ords_to_unistr'
          1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function ords_to_unistr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
Branch analysis from position: 5
filename:       /in/n2tk0
function name:  ords_to_unistr
number of ops:  24
compiled vars:  !0 = $ords, !1 = $encoding, !2 = $str, !3 = $i, !4 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      'UTF-8'
    4     2        ASSIGN                                                   !2, ''
    5     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->13
    8     5    >   FETCH_DIM_R                                      ~7      !0, !3
          6        ASSIGN                                                   !4, ~7
    9     7        INIT_FCALL                                               'pack'
          8        SEND_VAL                                                 'N'
          9        SEND_VAR                                                 !4
         10        DO_ICALL                                         $9      
         11        ASSIGN_OP                                     8          !2, $9
    5    12        PRE_INC                                                  !3
         13    >   COUNT                                            ~12     !0
         14        IS_SMALLER                                               !3, ~12
         15      > JMPNZ                                                    ~13, ->5
   11    16    >   INIT_FCALL                                               'mb_convert_encoding'
         17        SEND_VAR                                                 !2
         18        SEND_VAR                                                 !1
         19        SEND_VAL                                                 'UCS-4BE'
         20        DO_ICALL                                         $14     
         21        ASSIGN                                                   !2, $14
   12    22      > RETURN                                                   !2
   13    23*     > RETURN                                                   null

End of function ords_to_unistr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.87 ms | 1399 KiB | 18 Q