3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(bool $in) { return $in ? 3 : 5; } $inParam = (new ReflectionParameter('foo', 'in')); $result = foo(TRUE); echo "Param: ", $inParam, PHP_EOL, "Type: ", $inParam->getType();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XnUD5
function name:  (null)
number of ops:  17
compiled vars:  !0 = $inParam, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $2      'ReflectionParameter'
          1        SEND_VAL_EX                                              'foo'
          2        SEND_VAL_EX                                              'in'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
    8     5        INIT_FCALL                                               'foo'
          6        SEND_VAL                                                 <true>
          7        DO_FCALL                                      0  $5      
          8        ASSIGN                                                   !1, $5
   10     9        ECHO                                                     'Param%3A+'
         10        ECHO                                                     !0
         11        ECHO                                                     '%0A'
         12        ECHO                                                     'Type%3A+'
         13        INIT_METHOD_CALL                                         !0, 'getType'
         14        DO_FCALL                                      0  $7      
         15        ECHO                                                     $7
         16      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XnUD5
function name:  foo
number of ops:  7
compiled vars:  !0 = $in
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1      > JMPZ                                                     !0, ->4
          2    >   QM_ASSIGN                                        ~1      3
          3      > JMP                                                      ->5
          4    >   QM_ASSIGN                                        ~1      5
          5    > > RETURN                                                   ~1
    5     6*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.11 ms | 1398 KiB | 14 Q