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 = 2, Position 2 = 17
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 16
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/1XrLb
function name:  (null)
number of ops:  19
compiled vars:  !0 = $arr, !1 = $v, !2 = $k, !3 = $search
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   22     1      > FE_RESET_R                                       $5      !0, ->17
          2    > > FE_FETCH_R                                       ~6      $5, !1, ->17
          3    >   ASSIGN                                                   !2, ~6
   23     4        IS_SMALLER_OR_EQUAL                                      !3, !2
          5      > JMPZ                                                     ~8, ->16
   24     6    >   ROPE_INIT                                     4  ~10     !2
          7        ROPE_ADD                                      1  ~10     ~10, '+%3E+'
          8        ROPE_ADD                                      2  ~10     ~10, !3
          9        ROPE_END                                      3  ~9      ~10, '%0A'
         10        ECHO                                                     ~9
   25    11        NOP                                                      
         12        FAST_CONCAT                                      ~12     !1, '%0A'
         13        ECHO                                                     ~12
   26    14        FE_FREE                                                  $5
         15      > RETURN                                                   null
   22    16    > > JMP                                                      ->2
         17    >   FE_FREE                                                  $5
   30    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.49 ms | 1385 KiB | 13 Q