3v4l.org

run code in 500+ PHP versions simultaneously
<?php $closure = fn (string $str) => "hello {$str}"; echo $closure('via regular')."\n\n\n"; echo $closure->__invoke('via __invoke')."\n\n\n"; print_r(get_class_methods($closure));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VKjAF
function name:  (null)
number of ops:  19
compiled vars:  !0 = $closure
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                              ~1      [0]
          1        ASSIGN                                                       !0, ~1
    5     2        INIT_DYNAMIC_CALL                                            !0
          3        SEND_VAL_EX                                                  'via+regular'
          4        DO_FCALL                                          0  $3      
          5        CONCAT                                               ~4      $3, '%0A%0A%0A'
          6        ECHO                                                         ~4
    7     7        INIT_METHOD_CALL                                             !0, '__invoke'
          8        SEND_VAL_EX                                                  'via+__invoke'
          9        DO_FCALL                                          0  $5      
         10        CONCAT                                               ~6      $5, '%0A%0A%0A'
         11        ECHO                                                         ~6
    9    12        INIT_FCALL                                                   'print_r'
         13        INIT_FCALL                                                   'get_class_methods'
         14        SEND_VAR                                                     !0
         15        DO_ICALL                                             $7      
         16        SEND_VAR                                                     $7
         17        DO_ICALL                                                     
         18      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VKjAF
function name:  {closure:/in/VKjAF:3}
number of ops:  5
compiled vars:  !0 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        NOP                                                          
          2        FAST_CONCAT                                          ~1      'hello+', !0
          3      > RETURN                                                       ~1
          4*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.23 ms | 1729 KiB | 15 Q