3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $var = "A"; public function __toString() { return $this->var; } } class B extends A { protected $var = "B"; } $b = new B; echo $b;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gJjCR
function name:  (null)
number of ops:  7
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'a'
   12     1        DECLARE_CLASS                                            'b', 'a'
   16     2        NEW                                              $1      'B'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   17     5        ECHO                                                     !0
          6      > RETURN                                                   1

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

End of function __tostring

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.51 ms | 1393 KiB | 13 Q