3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { // PHP overloading public function __call($name, $arguments) { call_user_func_array(array($this, "_{$name}"), $arguments); } public static function __callStatic($name, $arguments) { call_user_func_array(get_class() . "::_static_{$name}", $arguments); } // The real function private function _test() { print "in _test();\n"; } private static function _static_test() { print "in _static_test();\n"; } } $a = new A; $a->test(); A::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RAfcr
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   31     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
   32     5        INIT_STATIC_METHOD_CALL                                  'A', 'test'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class A:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RAfcr
function name:  __call
number of ops:  12
compiled vars:  !0 = $name, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        FETCH_THIS                                       ~2      
          3        INIT_ARRAY                                       ~3      ~2
          4        NOP                                                      
          5        FAST_CONCAT                                      ~4      '_', !0
          6        ADD_ARRAY_ELEMENT                                ~3      ~4
          7        INIT_USER_CALL                                0          'call_user_func_array', ~3
          8        SEND_ARRAY                                               !1
          9        CHECK_UNDEF_ARGS                                         
         10        DO_FCALL                                      0          
   10    11      > RETURN                                                   null

End of function __call

Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RAfcr
function name:  __callStatic
number of ops:  11
compiled vars:  !0 = $name, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        GET_CLASS                                        ~2      
          3        NOP                                                      
          4        FAST_CONCAT                                      ~3      '%3A%3A_static_', !0
          5        CONCAT                                           ~4      ~2, ~3
          6        INIT_USER_CALL                                0          'call_user_func_array', ~4
          7        SEND_ARRAY                                               !1
          8        CHECK_UNDEF_ARGS                                         
          9        DO_FCALL                                      0          
   15    10      > RETURN                                                   null

End of function __callstatic

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

End of function _test

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

End of function _static_test

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.43 ms | 1390 KiB | 13 Q