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"; }; class Test2 { function call() { } } $test2 = new Test2; $obj = new Test(array($test2, 'call')); $obj->call();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hpdCa
function name:  (null)
number of ops:  14
compiled vars:  !0 = $closure, !1 = $test2, !2 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhpdCa%3A19%240'
          1        ASSIGN                                                   !0, ~3
   29     2        NEW                                              $5      'Test2'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
   30     5        NEW                                              $8      'Test'
          6        INIT_ARRAY                                       ~9      !1
          7        ADD_ARRAY_ELEMENT                                ~9      'call'
          8        SEND_VAL_EX                                              ~9
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $8
   33    11        INIT_METHOD_CALL                                         !2, 'call'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FhpdCa%3A19%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hpdCa
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%2FhpdCa%3A19%240

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hpdCa
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/hpdCa
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.

Class Test2:
Function call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hpdCa
function name:  call
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E > > RETURN                                                   null

End of function call

End of class Test2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.78 ms | 1399 KiB | 13 Q