3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Foo { public abstract function __toString(); } class Bar extends Foo { public function __toString() { return __CLASS__; } } $b = new Bar; print $b . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g4QHN
function name:  (null)
number of ops:  8
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
    8     1        DECLARE_CLASS                                            'bar', 'foo'
   15     2        NEW                                              $1      'Bar'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   16     5        CONCAT                                           ~4      !0, '%0A'
          6        ECHO                                                     ~4
          7      > RETURN                                                   1

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

End of function __tostring

End of class Foo.

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

End of function __tostring

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.26 ms | 1007 KiB | 13 Q