3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $x; function __construct(){ $this->x = function(){echo "x";}; } function __call($name, $arguments) { if($name instanceof Closure){ call_user_func_array($this->name, $arguments); } } } $o->{"x"}();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rKeJr
function name:  (null)
number of ops:  3
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_METHOD_CALL                                         !0, 'x'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FrKeJr%3A8%240

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rKeJr
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FrKeJr%3A8%240'
          1        ASSIGN_OBJ                                               'x'
          2        OP_DATA                                                  ~1
    9     3      > RETURN                                                   null

End of function __construct

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

End of function __call

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.18 ms | 1395 KiB | 13 Q