3v4l.org

run code in 300+ PHP versions simultaneously
<?php //function roundToValues( $search, array $arr ) { foreach($arr as $k=>$v){ if($k >= $search){ echo "$k > $search\n"; echo "$v\n"; return; } } //} $arr = [ '0', '20' => '0-20', '50' => '20-50', '100' => '50-100', '200' => '100-200', '500' => '200-500' ]; //var_dump( roundToValues('0',$arr) ); foreach($arr as $k=>$v){ if($k >= $search){ echo "$k > $search\n"; echo "$v\n"; return; } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 1, Position 2 = 16
Branch analysis from position: 1
2 jumps found. (Code = 78) Position 1 = 2, Position 2 = 16
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 1
Branch analysis from position: 1
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 34
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 34
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 33
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
Branch analysis from position: 16
filename:       /in/8vgfI
function name:  (null)
number of ops:  36
compiled vars:  !0 = $arr, !1 = $v, !2 = $k, !3 = $search
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > FE_RESET_R                                       $4      !0, ->16
          1    > > FE_FETCH_R                                       ~5      $4, !1, ->16
          2    >   ASSIGN                                                   !2, ~5
    4     3        IS_SMALLER_OR_EQUAL                                      !3, !2
          4      > JMPZ                                                     ~7, ->15
    5     5    >   ROPE_INIT                                     4  ~9      !2
          6        ROPE_ADD                                      1  ~9      ~9, '+%3E+'
          7        ROPE_ADD                                      2  ~9      ~9, !3
          8        ROPE_END                                      3  ~8      ~9, '%0A'
          9        ECHO                                                     ~8
    6    10        NOP                                                      
         11        FAST_CONCAT                                      ~11     !1, '%0A'
         12        ECHO                                                     ~11
    7    13        FE_FREE                                                  $4
         14      > RETURN                                                   null
    3    15    > > JMP                                                      ->1
         16    >   FE_FREE                                                  $4
   12    17        ASSIGN                                                   !0, <array>
   22    18      > FE_RESET_R                                       $13     !0, ->34
         19    > > FE_FETCH_R                                       ~14     $13, !1, ->34
         20    >   ASSIGN                                                   !2, ~14
   23    21        IS_SMALLER_OR_EQUAL                                      !3, !2
         22      > JMPZ                                                     ~16, ->33
   24    23    >   ROPE_INIT                                     4  ~18     !2
         24        ROPE_ADD                                      1  ~18     ~18, '+%3E+'
         25        ROPE_ADD                                      2  ~18     ~18, !3
         26        ROPE_END                                      3  ~17     ~18, '%0A'
         27        ECHO                                                     ~17
   25    28        NOP                                                      
         29        FAST_CONCAT                                      ~20     !1, '%0A'
         30        ECHO                                                     ~20
   26    31        FE_FREE                                                  $13
         32      > RETURN                                                   null
   22    33    > > JMP                                                      ->19
         34    >   FE_FREE                                                  $13
   30    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.7 ms | 1403 KiB | 13 Q