3v4l.org

run code in 300+ PHP versions simultaneously
<?php function demo(callable $callback) { $callback(); } demo(new class ("Monde") { public function __invoke() { var_dump($this); } });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7r7Jm
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'demo'
          1        DECLARE_ANON_CLASS                               <array> 
          2        NEW                                              $1      $0
          3        SEND_VAL_EX                                              'Monde'
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $1
          6        DO_FCALL                                      0          
   11     7      > RETURN                                                   1

Function demo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7r7Jm
function name:  demo
number of ops:  4
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
    5     3      > RETURN                                                   null

End of function demo

Class class@anonymous:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7r7Jm
function name:  __invoke
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   10     4      > RETURN                                                   null

End of function __invoke

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.32 ms | 1398 KiB | 16 Q