3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encode($to_encode){ $i=0; $len=strlen($to_encode); $ret=''; for($i=0;$i<$len;++$i){ $ret.=str_pad(ord($to_encode[$i]),3,"0",STR_PAD_LEFT); } return $ret; } function decode($numberstr){ $numberstr=(string)$numberstr; $ret=''; $i=0; } $str="the quick brown fox jumps over the lazy dog こどものじかん"; var_dump(encode($str));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/46sSR
function name:  (null)
number of ops:  8
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 'the+quick+brown+fox+jumps+over+the+lazy+dog+%E3%81%93%E3%81%A9%E3%82%82%E3%81%AE%E3%81%98%E3%81%8B%E3%82%93'
   19     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'encode'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function encode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 7
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 7
Branch analysis from position: 21
Branch analysis from position: 7
filename:       /in/46sSR
function name:  encode
number of ops:  23
compiled vars:  !0 = $to_encode, !1 = $i, !2 = $len, !3 = $ret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, 0
    4     2        STRLEN                                           ~5      !0
          3        ASSIGN                                                   !2, ~5
    5     4        ASSIGN                                                   !3, ''
    6     5        ASSIGN                                                   !1, 0
          6      > JMP                                                      ->19
    7     7    >   INIT_FCALL                                               'str_pad'
          8        INIT_FCALL                                               'ord'
          9        FETCH_DIM_R                                      ~9      !0, !1
         10        SEND_VAL                                                 ~9
         11        DO_ICALL                                         $10     
         12        SEND_VAR                                                 $10
         13        SEND_VAL                                                 3
         14        SEND_VAL                                                 '0'
         15        SEND_VAL                                                 0
         16        DO_ICALL                                         $11     
         17        ASSIGN_OP                                     8          !3, $11
    6    18        PRE_INC                                                  !1
         19    >   IS_SMALLER                                               !1, !2
         20      > JMPNZ                                                    ~14, ->7
   10    21    > > RETURN                                                   !3
   11    22*     > RETURN                                                   null

End of function encode

Function decode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/46sSR
function name:  decode
number of ops:  6
compiled vars:  !0 = $numberstr, !1 = $ret, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        CAST                                          6  ~3      !0
          2        ASSIGN                                                   !0, ~3
   14     3        ASSIGN                                                   !1, ''
   15     4        ASSIGN                                                   !2, 0
   17     5      > RETURN                                                   null

End of function decode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.01 ms | 1403 KiB | 20 Q