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(); } public function far() { var_dump(isset($this)); var_dump(get_called_class()); C::foo(); } } 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(); echo "**************\n"; $d->far();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qngY6
function name:  (null)
number of ops:  35
compiled vars:  !0 = $c, !1 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   INIT_FCALL                                               'var_dump'
          1        GET_CALLED_CLASS                                 ~2      
          2        SEND_VAL                                                 ~2
          3        DO_ICALL                                                 
   43     4        INIT_FCALL                                               'f'
          5        DO_FCALL                                      0          
   44     6        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   45     7        NEW                                              $5      'C'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !0, $5
   46    10        NEW                                              $8      'D'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $8
   47    13        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   48    14        INIT_METHOD_CALL                                         !0, 'foo'
         15        DO_FCALL                                      0          
   49    16        INIT_METHOD_CALL                                         !1, 'foo'
         17        DO_FCALL                                      0          
   50    18        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   51    19        INIT_METHOD_CALL                                         !0, 'bar'
         20        DO_FCALL                                      0          
   52    21        INIT_METHOD_CALL                                         !1, 'bar'
         22        DO_FCALL                                      0          
   53    23        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   54    24        INIT_STATIC_METHOD_CALL                                  'D', 'bar'
         25        DO_FCALL                                      0          
   55    26        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   56    27        INIT_METHOD_CALL                                         !1, 'yar'
         28        DO_FCALL                                      0          
   57    29        INIT_STATIC_METHOD_CALL                                  'D', 'yar'
         30        DO_FCALL                                      0          
   58    31        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   59    32        INIT_METHOD_CALL                                         !1, 'far'
         33        DO_FCALL                                      0          
         34      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qngY6
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/qngY6
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/qngY6
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/qngY6
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/qngY6
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/qngY6
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/qngY6
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 far:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qngY6
function name:  far
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   INIT_FCALL                                               'var_dump'
          1        ISSET_ISEMPTY_THIS                               ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   37     4        INIT_FCALL                                               'var_dump'
          5        GET_CALLED_CLASS                                 ~2      
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   38     8        INIT_STATIC_METHOD_CALL                                  'C', 'foo'
          9        DO_FCALL                                      0          
   39    10      > RETURN                                                   null

End of function far

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qngY6
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/qngY6
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:
154.32 ms | 1411 KiB | 16 Q