3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $test = 'foo'; public function __toString() { $this->test = 'bar'; return ''; } } $a = new A(); var_dump($a === ''); var_dump($a->test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cWOn9
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'a'
   12     1        NEW                                              $1      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   14     4        INIT_FCALL                                               'var_dump'
          5        IS_IDENTICAL                                     ~4      !0, ''
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                                 
   16     8        INIT_FCALL                                               'var_dump'
          9        FETCH_OBJ_R                                      ~6      !0, 'test'
         10        SEND_VAL                                                 ~6
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Class A:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cWOn9
function name:  __toString
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN_OBJ                                               'test'
          1        OP_DATA                                                  'bar'
    8     2      > RETURN                                                   ''
    9     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function __tostring

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.53 ms | 1444 KiB | 14 Q