3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $bar; function __construct($foo) { $this->bar = $foo; } public function test() { $i = new static('hi'); echo get_class($i); } } class B extends A { } $a = new A; $a->test(); $b = new B; $b->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ujvo0
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   21     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
   23     5        NEW                                              $6      'B'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   24     8        INIT_METHOD_CALL                                         !1, 'test'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ujvo0
function name:  __construct
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ujvo0
function name:  test
number of ops:  7
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                          static              $1      
          1        SEND_VAL_EX                                              'hi'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   13     4        GET_CLASS                                        ~4      !0
          5        ECHO                                                     ~4
   14     6      > RETURN                                                   null

End of function test

End of class A.

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ujvo0
function name:  __construct
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ujvo0
function name:  test
number of ops:  7
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                          static              $1      
          1        SEND_VAL_EX                                              'hi'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   13     4        GET_CLASS                                        ~4      !0
          5        ECHO                                                     ~4
   14     6      > RETURN                                                   null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.93 ms | 1390 KiB | 13 Q