3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface proxy {} class finalfoo { public function __construct() { if (is_subclass_of($this, __CLASS__, false)) { throw new \Exception('Nein! Class is final!'); } } } class fooproxy extends finalfoo implements proxy { } class naughtyfoo { } new finalfoo; new fooproxy; new naughtyfoo;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SpQ6B
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_CLASS                                            'fooproxy', 'finalfoo'
   25     1        NEW                                              $0      'finalfoo'
          2        DO_FCALL                                      0          
          3        FREE                                                     $0
   26     4        NEW                                              $2      'fooproxy'
          5        DO_FCALL                                      0          
          6        FREE                                                     $2
   27     7        NEW                                              $4      'naughtyfoo'
          8        DO_FCALL                                      0          
          9        FREE                                                     $4
         10      > RETURN                                                   1

Class proxy: [no user functions]
Class finalfoo:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SpQ6B
function name:  __construct
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'is_subclass_of'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        SEND_VAL                                                 'finalfoo'
          4        SEND_VAL                                                 <false>
          5        DO_ICALL                                         $1      
          6      > JMPZ                                                     $1, ->11
   10     7    >   NEW                                              $2      'Exception'
          8        SEND_VAL_EX                                              'Nein%21+Class+is+final%21'
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $2
   12    11    > > RETURN                                                   null

End of function __construct

End of class finalfoo.

Class fooproxy: [no user functions]
Class naughtyfoo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.04 ms | 1395 KiB | 15 Q