3v4l.org

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

Class Abs:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PuSgS
function name:  __toString
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'strtolower'
          1        NEW                                              $0      'ReflectionClass'
          2        FETCH_THIS                                       $1      
          3        SEND_VAR_EX                                              $1
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $0, 'getShortName'
          6        DO_FCALL                                      0  $3      
          7        SEND_VAR                                                 $3
          8        DO_ICALL                                         $4      
          9        CONCAT                                           ~5      $4, 'OK'
         10        VERIFY_RETURN_TYPE                                       ~5
         11      > RETURN                                                   ~5
    7    12*       VERIFY_RETURN_TYPE                                       
         13*     > 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:
153.14 ms | 1395 KiB | 15 Q