3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Abs { public function __toString() { return strtolower(get_class($this)); /* Should print test, not abs :P */ } } class Test extends Abs { } $x = new Test; echo $x;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fa161
function name:  (null)
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'abs'
   13     1        DECLARE_CLASS                                            'test', 'abs'
   17     2        NEW                                              $1      'Test'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   18     5        ECHO                                                     !0
          6      > RETURN                                                   1

Class Abs:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fa161
function name:  __toString
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'strtolower'
          1        FETCH_THIS                                       ~0      
          2        GET_CLASS                                        ~1      ~0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5        VERIFY_RETURN_TYPE                                       $2
          6      > RETURN                                                   $2
   10     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function __tostring

End of class Abs.

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.3 ms | 1399 KiB | 15 Q