3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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:  17
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   5     1        NOP                                                      
  15     2        FETCH_CLASS                                   0  :2      'finalfoo'
         3        DECLARE_INHERITED_CLASS                          $3      'fooproxy', $2
         4        ADD_INTERFACE                                            $3, 'proxy'
         5        VERIFY_ABSTRACT_CLASS                                    $3
  20     6        NOP                                                      
  25     7        NEW                                              $5      :1
         8        DO_FCALL                                      0          
         9        FREE                                                     $5
  26    10        NEW                                              $7      :3
        11        DO_FCALL                                      0          
        12        FREE                                                     $7
  27    13        NEW                                              $9      :5
        14        DO_FCALL                                      0          
        15        FREE                                                     $9
        16      > 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_VAR                                                 $0
         3        SEND_VAL                                                 'finalfoo'
         4        SEND_VAL                                                 <false>
         5        DO_ICALL                                         $1      
         6      > JMPZ                                                     $1, ->11
  10     7    >   NEW                                              $2      :-2
         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 7.3.0