3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ptr2str($ptr) { $out = ""; for ($i = 0; $i < 8; $i++) { $out .= chr($ptr & 0xff); $ptr >>= 8; } return $out; } class obj { function __tostring() { global $arr; $arr = 1; for ($i = 0; $i < 5; $i++) { $v[$i] = 'hi'.$i; } return 'hi'; } } $arr = array('string' => new obj); array_walk_recursive($arr, 'settype');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WY0pB
function name:  (null)
number of ops:  10
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'obj'
   26     1        NEW                                              $1      'obj'
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~3      $1, 'string'
          4        ASSIGN                                                   !0, ~3
   27     5        INIT_FCALL                                               'array_walk_recursive'
          6        SEND_REF                                                 !0
          7        SEND_VAL                                                 'settype'
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function ptr2str:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
Branch analysis from position: 4
filename:       /in/WY0pB
function name:  ptr2str
number of ops:  15
compiled vars:  !0 = $ptr, !1 = $out, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, ''
    5     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->11
    6     4    >   INIT_FCALL                                               'chr'
          5        BW_AND                                           ~5      !0, 255
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                         $6      
          8        ASSIGN_OP                                     8          !1, $6
    7     9        ASSIGN_OP                                     7          !0, 8
    5    10        PRE_INC                                                  !2
         11    >   IS_SMALLER                                               !2, 8
         12      > JMPNZ                                                    ~10, ->4
    9    13    > > RETURN                                                   !1
   10    14*     > RETURN                                                   null

End of function ptr2str

Class obj:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 4
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 4
Branch analysis from position: 10
Branch analysis from position: 4
filename:       /in/WY0pB
function name:  __tostring
number of ops:  13
compiled vars:  !0 = $arr, !1 = $i, !2 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   BIND_GLOBAL                                              !0, 'arr'
   17     1        ASSIGN                                                   !0, 1
   18     2        ASSIGN                                                   !1, 0
          3      > JMP                                                      ->8
   19     4    >   CONCAT                                           ~6      'hi', !1
          5        ASSIGN_DIM                                               !2, !1
          6        OP_DATA                                                  ~6
   18     7        PRE_INC                                                  !1
          8    >   IS_SMALLER                                               !1, 5
          9      > JMPNZ                                                    ~8, ->4
   22    10    > > RETURN                                                   'hi'
   23    11*       VERIFY_RETURN_TYPE                                       
         12*     > RETURN                                                   null

End of function __tostring

End of class obj.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.22 ms | 1400 KiB | 17 Q