3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __call($name, $args) { if (is_callable($this->{$name})) { return call_user_func_array($this->{$name}, $args); } } } $foo = new Foo; $foo->bar = function () { return 1; }; echo $foo->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kRtHT
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   11     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FkRtHT%3A11%240'
          4        ASSIGN_OBJ                                               !0, 'bar'
          5        OP_DATA                                                  ~5
   12     6        INIT_METHOD_CALL                                         !0, 'bar'
          7        DO_FCALL                                      0  $6      
          8        ECHO                                                     $6
          9      > RETURN                                                   1

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

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

Class Foo:
Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kRtHT
function name:  __call
number of ops:  14
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        INIT_FCALL                                               'is_callable'
          3        FETCH_OBJ_R                                      ~2      !0
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6      > JMPZ                                                     $3, ->13
    6     7    >   FETCH_OBJ_R                                      ~4      !0
          8        INIT_USER_CALL                                0          'call_user_func_array', ~4
          9        SEND_ARRAY                                               !1
         10        CHECK_UNDEF_ARGS                                         
         11        DO_FCALL                                      0  $5      
         12      > RETURN                                                   $5
    8    13    > > RETURN                                                   null

End of function __call

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.82 ms | 1396 KiB | 15 Q