3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bob = function($x, $y = 1){ return $x + $y; }; $functionReflection = new ReflectionFunction($bob); $parameters = $functionReflection->getParameters(); foreach($parameters as $param) { echo $param->name . ' '; echo intval($param->isOptional()); echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 20
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/tBDIH
function name:  (null)
number of ops:  22
compiled vars:  !0 = $bob, !1 = $functionReflection, !2 = $parameters, !3 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FtBDIH%3A3%240'
          1        ASSIGN                                                   !0, ~4
    7     2        NEW                                              $6      'ReflectionFunction'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
    8     6        INIT_METHOD_CALL                                         !1, 'getParameters'
          7        DO_FCALL                                      0  $9      
          8        ASSIGN                                                   !2, $9
   10     9      > FE_RESET_R                                       $11     !2, ->20
         10    > > FE_FETCH_R                                               $11, !3, ->20
   11    11    >   FETCH_OBJ_R                                      ~12     !3, 'name'
         12        CONCAT                                           ~13     ~12, '+'
         13        ECHO                                                     ~13
   12    14        INIT_METHOD_CALL                                         !3, 'isOptional'
         15        DO_FCALL                                      0  $14     
         16        CAST                                          4  ~15     $14
         17        ECHO                                                     ~15
   13    18        ECHO                                                     '%0A'
   10    19      > JMP                                                      ->10
         20    >   FE_FREE                                                  $11
   14    21      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FtBDIH%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tBDIH
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      1
    4     2        ADD                                              ~2      !0, !1
          3      > RETURN                                                   ~2
    5     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FtBDIH%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.65 ms | 1386 KiB | 13 Q