3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X {} function foo(...$args) { foreach ($args as $v) { $t = gettype($v); if ($t === 'object') { $c = get_class($v); echo "$t:$c\n"; } else { echo "$t\n"; } } $f = function(X $x, string $y, int $z) {}; $ref_func = new ReflectionFunction($f); $ref_params = $ref_func->getParameters(); foreach ($ref_params as $p) { echo "{$p->getType()}\n"; } } foo(42, "hello", new X(), 1.2e3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ve1B9
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'foo'
          1        SEND_VAL                                                 42
          2        SEND_VAL                                                 'hello'
          3        NEW                                              $0      'X'
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $0
          6        SEND_VAL                                                 1200
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 19
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 37
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 37
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
Branch analysis from position: 19
filename:       /in/Ve1B9
function name:  foo
number of ops:  39
compiled vars:  !0 = $args, !1 = $v, !2 = $t, !3 = $c, !4 = $f, !5 = $ref_func, !6 = $ref_params, !7 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_VARIADIC                                    !0      
    7     1      > FE_RESET_R                                       $8      !0, ->19
          2    > > FE_FETCH_R                                               $8, !1, ->19
    8     3    >   GET_TYPE                                         ~9      !1
          4        ASSIGN                                                   !2, ~9
    9     5        IS_IDENTICAL                                             !2, 'object'
          6      > JMPZ                                                     ~11, ->15
   10     7    >   GET_CLASS                                        ~12     !1
          8        ASSIGN                                                   !3, ~12
   11     9        ROPE_INIT                                     4  ~15     !2
         10        ROPE_ADD                                      1  ~15     ~15, '%3A'
         11        ROPE_ADD                                      2  ~15     ~15, !3
         12        ROPE_END                                      3  ~14     ~15, '%0A'
         13        ECHO                                                     ~14
         14      > JMP                                                      ->18
   13    15    >   NOP                                                      
         16        FAST_CONCAT                                      ~17     !2, '%0A'
         17        ECHO                                                     ~17
    7    18    > > JMP                                                      ->2
         19    >   FE_FREE                                                  $8
   17    20        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FVe1B9%3A17%240'
         21        ASSIGN                                                   !4, ~18
   18    22        NEW                                              $20     'ReflectionFunction'
         23        SEND_VAR_EX                                              !4
         24        DO_FCALL                                      0          
         25        ASSIGN                                                   !5, $20
   19    26        INIT_METHOD_CALL                                         !5, 'getParameters'
         27        DO_FCALL                                      0  $23     
         28        ASSIGN                                                   !6, $23
   20    29      > FE_RESET_R                                       $25     !6, ->37
         30    > > FE_FETCH_R                                               $25, !7, ->37
   21    31    >   INIT_METHOD_CALL                                         !7, 'getType'
         32        DO_FCALL                                      0  $26     
         33        NOP                                                      
         34        FAST_CONCAT                                      ~27     $26, '%0A'
         35        ECHO                                                     ~27
   20    36      > JMP                                                      ->30
         37    >   FE_FREE                                                  $25
   23    38      > RETURN                                                   null

End of function foo

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

End of function %00%7Bclosure%7D%2Fin%2FVe1B9%3A17%240

Class X: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.18 ms | 1403 KiB | 14 Q