3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Primary { public function __toString() { $GLOBALS['anObject'] = $this; return 'toString output from Primary'; } } $Foo = new Primary; str_replace('', '', $Foo); var_dump($GLOBALS['anObject']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D7nhN
function name:  (null)
number of ops:  12
compiled vars:  !0 = $Foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'primary'
    9     1        NEW                                                  $1      'Primary'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   10     4        FRAMELESS_ICALL_3                str_replace         ~4      '', ''
          5        OP_DATA                                                      !0
          6        FREE                                                         ~4
   11     7        INIT_FCALL                                                   'var_dump'
          8        FETCH_R                          global              ~5      'anObject'
          9        SEND_VAL                                                     ~5
         10        DO_ICALL                                                     
         11      > RETURN                                                       1

Class Primary:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D7nhN
function name:  __toString
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   FETCH_THIS                                           ~1      
          1        FETCH_W                          global              $0      'anObject'
          2        ASSIGN                                                       $0, ~1
    6     3      > RETURN                                                       'toString+output+from+Primary'
    7     4*       VERIFY_RETURN_TYPE                                           
          5*     > RETURN                                                       null

End of function __tostring

End of class Primary.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.83 ms | 2687 KiB | 14 Q