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/TSQq2
function name:  (null)
number of ops:  32
compiled vars:  !0 = $c, !1 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   INIT_FCALL                                               'var_dump'
          1        GET_CALLED_CLASS                                 ~2      
          2        SEND_VAL                                                 ~2
          3        DO_ICALL                                                 
   38     4        INIT_FCALL                                               'f'
          5        DO_FCALL                                      0          
   39     6        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   40     7        NEW                                              $5      'C'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !0, $5
   41    10        NEW                                              $8      'D'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $8
   42    13        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   43    14        INIT_METHOD_CALL                                         !0, 'foo'
         15        DO_FCALL                                      0          
   44    16        INIT_METHOD_CALL                                         !1, 'foo'
         17        DO_FCALL                                      0          
   45    18        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   46    19        INIT_METHOD_CALL                                         !0, 'bar'
         20        DO_FCALL                                      0          
   47    21        INIT_METHOD_CALL                                         !1, 'bar'
         22        DO_FCALL                                      0          
   48    23        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   49    24        INIT_STATIC_METHOD_CALL                                  'D', 'bar'
         25        DO_FCALL                                      0          
   50    26        ECHO                                                     '%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A'
   51    27        INIT_METHOD_CALL                                         !1, 'yar'
         28        DO_FCALL                                      0          
   52    29        INIT_STATIC_METHOD_CALL                                  'D', 'yar'
         30        DO_FCALL                                      0          
         31      > RETURN                                                   1

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