3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); class CallableArray { private array $foo; public function doFoo(callable $foo): void { $this->foo = $foo; var_dump($this->foo); } } $c = new CallableArray(); $c->doFoo(['CallableArray', 'doFoo']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WJ8NW
function name:  (null)
number of ops:  7
compiled vars:  !0 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   NEW                                                  $1      'CallableArray'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   13     3        INIT_METHOD_CALL                                             !0, 'doFoo'
          4        SEND_VAL_EX                                                  <array>
          5        DO_FCALL                                          0          
          6      > RETURN                                                       1

Class CallableArray:
Function dofoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WJ8NW
function name:  doFoo
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    7     1        ASSIGN_OBJ                                                   'foo'
          2        OP_DATA                                                      !0
    8     3        INIT_FCALL                                                   'var_dump'
          4        FETCH_OBJ_R                                          ~2      'foo'
          5        SEND_VAL                                                     ~2
          6        DO_ICALL                                                     
    9     7      > RETURN                                                       null

End of function dofoo

End of class CallableArray.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
130.83 ms | 478 KiB | 8 Q