3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo{ public function __call($method, $args) { if(is_callable(array($this, $method))) { return call_user_func_array($this->$method, $args); } // else throw exception } } $c = function($who) { return "Hello $who"; }; echo $c->call(new Foo,'Wide World');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e2EKF
function name:  (null)
number of ops:  10
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fe2EKF%3A12%240'
          1        ASSIGN                                                   !0, ~1
   13     2        INIT_METHOD_CALL                                         !0, 'call'
          3        NEW                                              $3      'Foo'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $3
          6        SEND_VAL_EX                                              'Wide+World'
          7        DO_FCALL                                      0  $5      
          8        ECHO                                                     $5
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fe2EKF%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e2EKF
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $who
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        NOP                                                      
          2        FAST_CONCAT                                      ~1      'Hello+', !0
          3      > RETURN                                                   ~1
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fe2EKF%3A12%240

Class Foo:
Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e2EKF
function name:  __call
number of ops:  16
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_FCALL                                               'is_callable'
          3        FETCH_THIS                                       ~2      
          4        INIT_ARRAY                                       ~3      ~2
          5        ADD_ARRAY_ELEMENT                                ~3      !0
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > JMPZ                                                     $4, ->15
    6     9    >   FETCH_OBJ_R                                      ~5      !0
         10        INIT_USER_CALL                                0          'call_user_func_array', ~5
         11        SEND_ARRAY                                               !1
         12        CHECK_UNDEF_ARGS                                         
         13        DO_FCALL                                      0  $6      
         14      > RETURN                                                   $6
    9    15    > > RETURN                                                   null

End of function __call

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.59 ms | 1396 KiB | 15 Q