3v4l.org

run code in 300+ PHP versions simultaneously
<?php // usually, the order of a class definition doesn't matter $a = new A(); class A {} // when extending a class and when the parent is defined before the child, it works as well $b = new B(); class baseB {} class B extends baseB{} // but when we try to reverse the order of definition, it fails, // (though for some reason it says it's C, not baseC cannot be found) try { $c = new C(); } catch (Throwable $e){ echo $e->getMessage();} class C extends baseC {} class BaseC{} // So we could think that the order of definition is important // yet we can define D before baseD this way class D extends baseD {} $d = new D(); class baseD{}
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 10
Branch analysis from position: 10
2 jumps found. (Code = 107) Position 1 = 11, Position 2 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QFAGv
function name:  (null)
number of ops:  20
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $e, !4 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $5      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
    8     3        NEW                                              $8      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $8
   15     6        NEW                                              $11     'C'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $11
          9      > JMP                                                      ->14
   16    10  E > > CATCH                                       last         'Throwable'
         11    >   INIT_METHOD_CALL                                         !3, 'getMessage'
         12        DO_FCALL                                      0  $14     
         13        ECHO                                                     $14
   17    14    >   DECLARE_CLASS                                            'c', 'basec'
   22    15        DECLARE_CLASS                                            'd', 'based'
   23    16        NEW                                              $15     'D'
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !4, $15
   24    19      > RETURN                                                   1

Class A: [no user functions]
Class baseB: [no user functions]
Class B: [no user functions]
Class C: [no user functions]
Class BaseC: [no user functions]
Class D: [no user functions]
Class baseD: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.88 ms | 1393 KiB | 13 Q