3v4l.org

run code in 500+ PHP versions simultaneously
<?php $ts = [7,-10,13,8,4,-7.2,-12,-3.7,3.5,-9.6,6.5,-1.7,-6.2,7]; const KEY_NAMES = [0 => 'negative', 1 => 'non-negatuve']; $result = []; foreach ($ts as $v) { $result[KEY_NAMES[$v >= 0]][] = $v; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/SOGNf
function name:  (null)
number of ops:  17
compiled vars:  !0 = $ts, !1 = $result, !2 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        DECLARE_CONST                                                'KEY_NAMES', <array>
    6     2        ASSIGN                                                       !1, <array>
    7     3      > FE_RESET_R                                           $5      !0, ->12
          4    > > FE_FETCH_R                                                   $5, !2, ->12
    8     5    >   FETCH_CONSTANT                                       ~6      'KEY_NAMES'
          6        IS_SMALLER_OR_EQUAL                                  ~7      0, !2
          7        FETCH_DIM_R                                          ~8      ~6, ~7
          8        FETCH_DIM_W                                          $9      !1, ~8
          9        ASSIGN_DIM                                                   $9
         10        OP_DATA                                                      !2
    7    11      > JMP                                                          ->4
         12    >   FE_FREE                                                      $5
   11    13        INIT_FCALL                                                   'var_export'
         14        SEND_VAR                                                     !1
         15        DO_ICALL                                                     
         16      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
208.17 ms | 1907 KiB | 13 Q