3v4l.org

run code in 500+ PHP versions simultaneously
<?php namespace { define('SOME_CONSTANT', 1); } namespace Some\Name\Space { use ReflectionFunction; $reflection = new ReflectionFunction(function ($const = PHP_EOL, $const2 = SOME_CONSTANT) { }); echo $reflection->getParameters()[0]->getDefaultValueConstantName() . PHP_EOL; echo $reflection->getParameters()[1]->getDefaultValueConstantName() . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WqdX9
function name:  (null)
number of ops:  26
compiled vars:  !0 = $reflection
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                                   'define'
          1        SEND_VAL                                                     'SOME_CONSTANT'
          2        SEND_VAL                                                     1
          3        DO_ICALL                                                     
   12     4        NEW                                                  $2      'ReflectionFunction'
          5        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
   13     6        SEND_VAL_EX                                                  ~3
   12     7        DO_FCALL                                          0          
          8        ASSIGN                                                       !0, $2
   14     9        INIT_METHOD_CALL                                             !0, 'getParameters'
         10        DO_FCALL                                          0  $6      
         11        FETCH_DIM_R                                          ~7      $6, 0
         12        INIT_METHOD_CALL                                             ~7, 'getDefaultValueConstantName'
         13        DO_FCALL                                          0  $8      
         14        FETCH_CONSTANT                                       ~9      'Some%5CName%5CSpace%5CPHP_EOL'
         15        CONCAT                                               ~10     $8, ~9
         16        ECHO                                                         ~10
   15    17        INIT_METHOD_CALL                                             !0, 'getParameters'
         18        DO_FCALL                                          0  $11     
         19        FETCH_DIM_R                                          ~12     $11, 1
         20        INIT_METHOD_CALL                                             ~12, 'getDefaultValueConstantName'
         21        DO_FCALL                                          0  $13     
         22        FETCH_CONSTANT                                       ~14     'Some%5CName%5CSpace%5CPHP_EOL'
         23        CONCAT                                               ~15     $13, ~14
         24        ECHO                                                         ~15
   16    25      > 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/WqdX9
function name:  {closure:/in/WqdX9:12}
number of ops:  3
compiled vars:  !0 = $const, !1 = $const2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV_INIT                                            !0      <const ast>
          1        RECV_INIT                                            !1      <const ast>
   13     2      > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.62 ms | 2265 KiB | 14 Q