3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $callable; function __construct($callable) { $this->callable = $callable; } function call() { $callHack = $this->callable; $callHack('adad'); } } $closure = function () { echo "Hello"; }; $obj = new Test('var_dump'); $obj->call();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3rub3
function name:  (null)
number of ops:  9
compiled vars:  !0 = $closure, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3rub3%3A19%240'
          1        ASSIGN                                                   !0, ~2
   24     2        NEW                                              $4      'Test'
          3        SEND_VAL_EX                                              'var_dump'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $4
   27     6        INIT_METHOD_CALL                                         !1, 'call'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2F3rub3%3A19%240

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3rub3
function name:  __construct
number of ops:  4
compiled vars:  !0 = $callable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'callable'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function __construct

Function call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3rub3
function name:  call
number of ops:  6
compiled vars:  !0 = $callHack
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~1      'callable'
          1        ASSIGN                                                   !0, ~1
   14     2        INIT_DYNAMIC_CALL                                        !0
          3        SEND_VAL_EX                                              'adad'
          4        DO_FCALL                                      0          
   15     5      > RETURN                                                   null

End of function call

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.79 ms | 1386 KiB | 13 Q