3v4l.org

run code in 300+ PHP versions simultaneously
<?php function callStatic($class, $method, $args, $ref, $defined, $called) { var_dump($class, $defined, $called); } class n_0d19ad5d1a89cbbf06a49f56e9dcb11d { public static function foo() { return callStatic('static', 'bar', array(), array(), __CLASS__, call_user_func(function () { set_error_handler(function () { }); $called = get_called_class(); restore_error_handler(); return $called; })); } } class n_1c54f3f5b4e9e0fc521faa21fe127ad8 extends n_0d19ad5d1a89cbbf06a49f56e9dcb11d { protected static function bar() { return __CLASS__; } } echo callStatic('n_1c54f3f5b4e9e0fc521faa21fe127ad8', 'foo', array(), array(), __CLASS__, call_user_func(function () { set_error_handler(function () { }); $called = get_called_class(); restore_error_handler(); return $called; }));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3bbQM
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_FCALL                                               'callstatic'
          1        SEND_VAL                                                 'n_1c54f3f5b4e9e0fc521faa21fe127ad8'
          2        SEND_VAL                                                 'foo'
          3        SEND_VAL                                                 <array>
          4        SEND_VAL                                                 <array>
          5        SEND_VAL                                                 ''
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3bbQM%3A28%242'
   35     7        INIT_USER_CALL                                0          'call_user_func', ~0
          8        DO_FCALL                                      0  $1      
          9        SEND_VAR                                                 $1
         10        DO_FCALL                                      0  $2      
         11        ECHO                                                     $2
         12      > RETURN                                                   1

Function callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3bbQM
function name:  callStatic
number of ops:  12
compiled vars:  !0 = $class, !1 = $method, !2 = $args, !3 = $ref, !4 = $defined, !5 = $called
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
          5        RECV                                             !5      
    4     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !4
          9        SEND_VAR                                                 !5
         10        DO_ICALL                                                 
    5    11      > RETURN                                                   null

End of function callstatic

Function %00%7Bclosure%7D%2Fin%2F3bbQM%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3bbQM
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $called
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'set_error_handler'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3bbQM%3A12%241'
   14     2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   15     4        GET_CALLED_CLASS                                 ~3      
          5        ASSIGN                                                   !0, ~3
   16     6        INIT_FCALL                                               'restore_error_handler'
          7        DO_ICALL                                                 
   17     8      > RETURN                                                   !0
   18     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3bbQM%3A11%240

Function %00%7Bclosure%7D%2Fin%2F3bbQM%3A12%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3bbQM
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3bbQM%3A12%241

Function %00%7Bclosure%7D%2Fin%2F3bbQM%3A28%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3bbQM
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $called
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   INIT_FCALL                                               'set_error_handler'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3bbQM%3A29%243'
   31     2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   32     4        GET_CALLED_CLASS                                 ~3      
          5        ASSIGN                                                   !0, ~3
   33     6        INIT_FCALL                                               'restore_error_handler'
          7        DO_ICALL                                                 
   34     8      > RETURN                                                   !0
   35     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3bbQM%3A28%242

Function %00%7Bclosure%7D%2Fin%2F3bbQM%3A29%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3bbQM
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3bbQM%3A29%243

Class n_0d19ad5d1a89cbbf06a49f56e9dcb11d:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3bbQM
function name:  foo
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'callstatic'
          1        SEND_VAL                                                 'static'
          2        SEND_VAL                                                 'bar'
          3        SEND_VAL                                                 <array>
          4        SEND_VAL                                                 <array>
          5        SEND_VAL                                                 'n_0d19ad5d1a89cbbf06a49f56e9dcb11d'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3bbQM%3A11%240'
   18     7        INIT_USER_CALL                                0          'call_user_func', ~0
          8        DO_FCALL                                      0  $1      
          9        SEND_VAR                                                 $1
         10        DO_FCALL                                      0  $2      
         11      > RETURN                                                   $2
   19    12*     > RETURN                                                   null

End of function foo

End of class n_0d19ad5d1a89cbbf06a49f56e9dcb11d.

Class n_1c54f3f5b4e9e0fc521faa21fe127ad8:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3bbQM
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E > > RETURN                                                   'n_1c54f3f5b4e9e0fc521faa21fe127ad8'
   26     1*     > RETURN                                                   null

End of function bar

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3bbQM
function name:  foo
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'callstatic'
          1        SEND_VAL                                                 'static'
          2        SEND_VAL                                                 'bar'
          3        SEND_VAL                                                 <array>
          4        SEND_VAL                                                 <array>
          5        SEND_VAL                                                 'n_0d19ad5d1a89cbbf06a49f56e9dcb11d'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3bbQM%3A11%240'
   18     7        INIT_USER_CALL                                0          'call_user_func', ~0
          8        DO_FCALL                                      0  $1      
          9        SEND_VAR                                                 $1
         10        DO_FCALL                                      0  $2      
         11      > RETURN                                                   $2
   19    12*     > RETURN                                                   null

End of function foo

End of class n_1c54f3f5b4e9e0fc521faa21fe127ad8.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.76 ms | 1407 KiB | 22 Q