3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct() { echo "A::__construct()<br>"; } public function A() { echo "A::A()<br>"; } public function callme5() { static::__construct(); } public function callme4() { $classname = get_class($this); $this->$classname(); } } class B extends A { public function __construct() { echo "B::__construct()<br>"; } public function B() { echo "B::B()<br>"; } } class C extends A { public function __construct() { echo "C::__construct()<br>"; } } class D extends A { public function D() { echo "D::D()<br>"; } } echo "---A---<br>"; $obj = new A(); $obj->callme4(); $obj->callme5(); echo "---B---<br>"; $obj = new B(); $obj->callme4(); $obj->callme5(); echo "---C---<br>"; $obj = new C(); //$obj->callme4(); $obj->callme5(); echo "---D---<br>"; $obj = new D(); $obj->callme4(); $obj->callme5();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  (null)
number of ops:  31
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   ECHO                                                     '---A---%3Cbr%3E'
   45     1        NEW                                              $1      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   46     4        INIT_METHOD_CALL                                         !0, 'callme4'
          5        DO_FCALL                                      0          
   47     6        INIT_METHOD_CALL                                         !0, 'callme5'
          7        DO_FCALL                                      0          
   49     8        ECHO                                                     '---B---%3Cbr%3E'
   50     9        NEW                                              $6      'B'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !0, $6
   51    12        INIT_METHOD_CALL                                         !0, 'callme4'
         13        DO_FCALL                                      0          
   52    14        INIT_METHOD_CALL                                         !0, 'callme5'
         15        DO_FCALL                                      0          
   54    16        ECHO                                                     '---C---%3Cbr%3E'
   55    17        NEW                                              $11     'C'
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !0, $11
   57    20        INIT_METHOD_CALL                                         !0, 'callme5'
         21        DO_FCALL                                      0          
   59    22        ECHO                                                     '---D---%3Cbr%3E'
   60    23        NEW                                              $15     'D'
         24        DO_FCALL                                      0          
         25        ASSIGN                                                   !0, $15
   61    26        INIT_METHOD_CALL                                         !0, 'callme4'
         27        DO_FCALL                                      0          
   62    28        INIT_METHOD_CALL                                         !0, 'callme5'
         29        DO_FCALL                                      0          
         30      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'A%3A%3A__construct%28%29%3Cbr%3E'
    6     1      > RETURN                                                   null

End of function __construct

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  A
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'A%3A%3AA%28%29%3Cbr%3E'
   10     1      > RETURN                                                   null

End of function a

Function callme5:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  callme5
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                  
          1        DO_FCALL                                      0          
   14     2      > RETURN                                                   null

End of function callme5

Function callme4:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  callme4
number of ops:  6
compiled vars:  !0 = $classname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_THIS                                       ~1      
          1        GET_CLASS                                        ~2      ~1
          2        ASSIGN                                                   !0, ~2
   18     3        INIT_METHOD_CALL                                         !0
          4        DO_FCALL                                      0          
   19     5      > RETURN                                                   null

End of function callme4

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/pJ4Hd
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   ECHO                                                     'B%3A%3A__construct%28%29%3Cbr%3E'
   25     1      > RETURN                                                   null

End of function __construct

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  B
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   ECHO                                                     'B%3A%3AB%28%29%3Cbr%3E'
   29     1      > RETURN                                                   null

End of function b

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  A
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'A%3A%3AA%28%29%3Cbr%3E'
   10     1      > RETURN                                                   null

End of function a

Function callme5:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  callme5
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                  
          1        DO_FCALL                                      0          
   14     2      > RETURN                                                   null

End of function callme5

Function callme4:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  callme4
number of ops:  6
compiled vars:  !0 = $classname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_THIS                                       ~1      
          1        GET_CLASS                                        ~2      ~1
          2        ASSIGN                                                   !0, ~2
   18     3        INIT_METHOD_CALL                                         !0
          4        DO_FCALL                                      0          
   19     5      > RETURN                                                   null

End of function callme4

End of class B.

Class C:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   ECHO                                                     'C%3A%3A__construct%28%29%3Cbr%3E'
   35     1      > RETURN                                                   null

End of function __construct

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  A
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'A%3A%3AA%28%29%3Cbr%3E'
   10     1      > RETURN                                                   null

End of function a

Function callme5:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  callme5
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                  
          1        DO_FCALL                                      0          
   14     2      > RETURN                                                   null

End of function callme5

Function callme4:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  callme4
number of ops:  6
compiled vars:  !0 = $classname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_THIS                                       ~1      
          1        GET_CLASS                                        ~2      ~1
          2        ASSIGN                                                   !0, ~2
   18     3        INIT_METHOD_CALL                                         !0
          4        DO_FCALL                                      0          
   19     5      > RETURN                                                   null

End of function callme4

End of class C.

Class D:
Function d:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  D
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   ECHO                                                     'D%3A%3AD%28%29%3Cbr%3E'
   41     1      > RETURN                                                   null

End of function d

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'A%3A%3A__construct%28%29%3Cbr%3E'
    6     1      > RETURN                                                   null

End of function __construct

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  A
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'A%3A%3AA%28%29%3Cbr%3E'
   10     1      > RETURN                                                   null

End of function a

Function callme5:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  callme5
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                  
          1        DO_FCALL                                      0          
   14     2      > RETURN                                                   null

End of function callme5

Function callme4:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pJ4Hd
function name:  callme4
number of ops:  6
compiled vars:  !0 = $classname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_THIS                                       ~1      
          1        GET_CLASS                                        ~2      ~1
          2        ASSIGN                                                   !0, ~2
   18     3        INIT_METHOD_CALL                                         !0
          4        DO_FCALL                                      0          
   19     5      > RETURN                                                   null

End of function callme4

End of class D.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.37 ms | 1407 KiB | 13 Q