3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f() { var_dump(get_called_class()); } class C { public function __construct() { var_dump(isset($this)); var_dump(get_called_class()); } public function foo() { var_dump(isset($this)); var_dump(get_called_class()); } public static function bar() { var_dump(isset($this)); var_dump(get_called_class()); } public static function yar() { var_dump(isset($this)); var_dump(get_called_class()); } } class D extends C { public function __construct() { var_dump(isset($this)); var_dump(get_called_class()); } public static function yar() { var_dump(isset($this)); var_dump(get_called_class()); C::yar(); } } //var_dump(get_called_class()); f(); echo "**************\n"; $c = new C; $d = new D; echo "**************\n"; $c->foo(); $d->foo(); echo "**************\n"; $c->bar(); $d->bar(); echo "**************\n"; D::bar(); echo "**************\n"; $d->yar(); D::yar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uukb4
function name:  (null)
number of ops:  28
compiled vars:  !0 = $c, !1 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   INIT_FCALL                                               'f'
          1        DO_FCALL                                      0          
   39     2        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   40     3        NEW                                              $3      'C'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $3
   41     6        NEW                                              $6      'D'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   42     9        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   43    10        INIT_METHOD_CALL                                         !0, 'foo'
         11        DO_FCALL                                      0          
   44    12        INIT_METHOD_CALL                                         !1, 'foo'
         13        DO_FCALL                                      0          
   45    14        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   46    15        INIT_METHOD_CALL                                         !0, 'bar'
         16        DO_FCALL                                      0          
   47    17        INIT_METHOD_CALL                                         !1, 'bar'
         18        DO_FCALL                                      0          
   48    19        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   49    20        INIT_STATIC_METHOD_CALL                                  'D', 'bar'
         21        DO_FCALL                                      0          
   50    22        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   51    23        INIT_METHOD_CALL                                         !1, 'yar'
         24        DO_FCALL                                      0          
   52    25        INIT_STATIC_METHOD_CALL                                  'D', 'yar'
         26        DO_FCALL                                      0          
         27      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uukb4
function name:  f
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        GET_CALLED_CLASS                                 ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    4     4      > RETURN                                                   null

End of function f

Class C:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uukb4
function name:  __construct
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'var_dump'
          1        ISSET_ISEMPTY_THIS                               ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    9     4        INIT_FCALL                                               'var_dump'
          5        GET_CALLED_CLASS                                 ~2      
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   10     8      > RETURN                                                   null

End of function __construct

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uukb4
function name:  foo
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        ISSET_ISEMPTY_THIS                               ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   13     4        INIT_FCALL                                               'var_dump'
          5        GET_CALLED_CLASS                                 ~2      
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   14     8      > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uukb4
function name:  bar
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'var_dump'
          1        ISSET_ISEMPTY_THIS                               ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   17     4        INIT_FCALL                                               'var_dump'
          5        GET_CALLED_CLASS                                 ~2      
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   18     8      > RETURN                                                   null

End of function bar

Function yar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uukb4
function name:  yar
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        ISSET_ISEMPTY_THIS                               ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   21     4        INIT_FCALL                                               'var_dump'
          5        GET_CALLED_CLASS                                 ~2      
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   22     8      > RETURN                                                   null

End of function yar

End of class C.

Class D:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uukb4
function name:  __construct
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'var_dump'
          1        ISSET_ISEMPTY_THIS                               ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   28     4        INIT_FCALL                                               'var_dump'
          5        GET_CALLED_CLASS                                 ~2      
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   29     8      > RETURN                                                   null

End of function __construct

Function yar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uukb4
function name:  yar
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   INIT_FCALL                                               'var_dump'
          1        ISSET_ISEMPTY_THIS                               ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   32     4        INIT_FCALL                                               'var_dump'
          5        GET_CALLED_CLASS                                 ~2      
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   33     8        INIT_STATIC_METHOD_CALL                                  'C', 'yar'
          9        DO_FCALL                                      0          
   34    10      > RETURN                                                   null

End of function yar

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uukb4
function name:  foo
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        ISSET_ISEMPTY_THIS                               ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   13     4        INIT_FCALL                                               'var_dump'
          5        GET_CALLED_CLASS                                 ~2      
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   14     8      > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uukb4
function name:  bar
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'var_dump'
          1        ISSET_ISEMPTY_THIS                               ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   17     4        INIT_FCALL                                               'var_dump'
          5        GET_CALLED_CLASS                                 ~2      
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   18     8      > RETURN                                                   null

End of function bar

End of class D.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.95 ms | 1411 KiB | 16 Q