3v4l.org

run code in 300+ PHP versions simultaneously
<? define ('Foo', 1); class Foo { public function foo() { return "foo"; } } class Bar { public function foo() { return "foo"; } } $a = [\Foo, \Bar]; $b = new $a[1]; echo $b->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rFk3r
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'Foo'
          2        SEND_VAL                                                 1
          3        DO_ICALL                                                 
   21     4        FETCH_CONSTANT                                   ~3      'Foo'
          5        INIT_ARRAY                                       ~4      ~3
          6        FETCH_CONSTANT                                   ~5      'Bar'
          7        ADD_ARRAY_ELEMENT                                ~4      ~5
          8        ASSIGN                                                   !0, ~4
   23     9        FETCH_DIM_R                                      ~7      !0, 1
         10        FETCH_CLASS                                   0  $8      ~7
         11        NEW                                              $9      $8
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $9
   24    14        INIT_METHOD_CALL                                         !1, 'foo'
         15        DO_FCALL                                      0  $12     
         16        ECHO                                                     $12
         17      > RETURN                                                   1

Class Foo:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rFk3r
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   'foo'
    9     1*     > RETURN                                                   null

End of function foo

End of class Foo.

Class Bar:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rFk3r
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   'foo'
   17     1*     > RETURN                                                   null

End of function foo

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.04 ms | 1399 KiB | 15 Q