3v4l.org

run code in 300+ 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:  14
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        INIT_FCALL                                               'str_replace'
          5        SEND_VAL                                                 ''
          6        SEND_VAL                                                 ''
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   11     9        INIT_FCALL                                               'var_dump'
         10        FETCH_R                      global              ~5      'anObject'
         11        SEND_VAL                                                 ~5
         12        DO_ICALL                                                 
         13      > 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.0.0


preferences:
138.78 ms | 998 KiB | 15 Q