3v4l.org

run code in 300+ PHP versions simultaneously
<?php $search = '35'; $range = ''; $arr = [ '0', '1' => '20;0-20', '2' => '50;20-50', '3' => '100;50-100', '4' => '200;100-200', '5' => '500;200-500' ]; foreach ( $arr as $k => $v ) { $values = explode(";", $v); //print_r($values); $range = $values[0]; if ( $$values[1] >= $search ) break; } echo $range; //print_r($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 19
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 19
Branch analysis from position: 19
filename:       /in/bE6bc
function name:  (null)
number of ops:  22
compiled vars:  !0 = $search, !1 = $range, !2 = $arr, !3 = $v, !4 = $k, !5 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '35'
    3     1        ASSIGN                                                   !1, ''
    5     2        ASSIGN                                                   !2, <array>
   14     3      > FE_RESET_R                                       $9      !2, ->19
          4    > > FE_FETCH_R                                       ~10     $9, !3, ->19
          5    >   ASSIGN                                                   !4, ~10
   15     6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '%3B'
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $12     
         10        ASSIGN                                                   !5, $12
   17    11        FETCH_DIM_R                                      ~14     !5, 0
         12        ASSIGN                                                   !1, ~14
   18    13        FETCH_R                      local               ~16     !5
         14        FETCH_DIM_R                                      ~17     ~16, 1
         15        IS_SMALLER_OR_EQUAL                                      !0, ~17
         16      > JMPZ                                                     ~18, ->18
         17    > > JMP                                                      ->19
   14    18    > > JMP                                                      ->4
         19    >   FE_FREE                                                  $9
   19    20        ECHO                                                     !1
   20    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.74 ms | 1387 KiB | 15 Q