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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.9 ms | 1394 KiB | 13 Q