3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); /** * @param array<string,mixed> $a */ function f(array $headers): void { foreach ($headers as $name => $value) { if (str_starts_with($name, 'x-')) { // ... } } } f(['0' => 'hello php']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uM3UM
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'f'
          1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 10
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 9
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/uM3UM
function name:  f
number of ops:  12
compiled vars:  !0 = $headers, !1 = $value, !2 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1      > FE_RESET_R                                       $3      !0, ->10
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->10
          3    >   ASSIGN                                                   !2, ~4
   10     4        INIT_FCALL                                               'str_starts_with'
          5        SEND_VAR                                                 !2
          6        SEND_VAL                                                 'x-'
          7        DO_ICALL                                         $6      
          8      > JMPZ                                                     $6, ->9
    9     9    > > JMP                                                      ->2
         10    >   FE_FREE                                                  $3
   14    11      > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.29 ms | 1012 KiB | 15 Q