3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function __call($name, $args){ echo "__call " . $name . PHP_EOL; } public static function __callStatic($name, $args) { echo "__callStatic " . $name . PHP_EOL; } public function make_call_self() { self::ted(); } public function make_call_static() { static::ted(); } function make_call_classname() { foo::bob(); } function make_call_classname_lambda() { $x = function(){ foo::nat(); }; $x(); } } $x = new foo(); $x->make_call_self(); $x->make_call_static(); $x->make_call_classname(); $x->make_call_classname_lambda(); foo::sam();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Nqll
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   31     3        INIT_METHOD_CALL                                         !0, 'make_call_self'
          4        DO_FCALL                                      0          
   32     5        INIT_METHOD_CALL                                         !0, 'make_call_static'
          6        DO_FCALL                                      0          
   33     7        INIT_METHOD_CALL                                         !0, 'make_call_classname'
          8        DO_FCALL                                      0          
   34     9        INIT_METHOD_CALL                                         !0, 'make_call_classname_lambda'
         10        DO_FCALL                                      0          
   35    11        INIT_STATIC_METHOD_CALL                                  'foo', 'sam'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Class foo:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Nqll
function name:  __call
number of ops:  6
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        CONCAT                                           ~2      '__call+', !0
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
    6     5      > 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/2Nqll
function name:  __callStatic
number of ops:  6
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        CONCAT                                           ~2      '__callStatic+', !0
          3        CONCAT                                           ~3      ~2, '%0A'
          4        ECHO                                                     ~3
   10     5      > RETURN                                                   null

End of function __callstatic

Function make_call_self:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Nqll
function name:  make_call_self
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                  'ted'
          1        DO_FCALL                                      0          
   14     2      > RETURN                                                   null

End of function make_call_self

Function make_call_static:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Nqll
function name:  make_call_static
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'ted'
          1        DO_FCALL                                      0          
   18     2      > RETURN                                                   null

End of function make_call_static

Function make_call_classname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Nqll
function name:  make_call_classname
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_STATIC_METHOD_CALL                                  'foo', 'bob'
          1        DO_FCALL                                      0          
   22     2      > RETURN                                                   null

End of function make_call_classname

Function make_call_classname_lambda:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Nqll
function name:  make_call_classname_lambda
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   DECLARE_LAMBDA_FUNCTION                          ~1      [0]
          1        ASSIGN                                                   !0, ~1
   26     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
   27     4      > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Nqll
function name:  {closure}
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_STATIC_METHOD_CALL                                  'foo', 'nat'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   null

End of Dynamic Function 0

End of function make_call_classname_lambda

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.22 ms | 1453 KiB | 13 Q