3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = array(2, 12, 23, 34, 36, 36, 36, 56); Sort($array); $number = 30; Foreach($array as $key => $val) If($val >= $number) break; $larger = array_slice($array, $key); Echo count($larger) . "\n"; Var_dump($larger);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 12
Branch analysis from position: 12
filename:       /in/8FoOP
function name:  (null)
number of ops:  25
compiled vars:  !0 = $array, !1 = $number, !2 = $val, !3 = $key, !4 = $larger
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        INIT_FCALL                                                   'sort'
          2        SEND_REF                                                     !0
          3        DO_ICALL                                                     
    6     4        ASSIGN                                                       !1, 30
    8     5      > FE_RESET_R                                           $8      !0, ->12
          6    > > FE_FETCH_R                                           ~9      $8, !2, ->12
          7    >   ASSIGN                                                       !3, ~9
          8        IS_SMALLER_OR_EQUAL                                          !1, !2
          9      > JMPZ                                                         ~11, ->11
         10    > > JMP                                                          ->12
         11    > > JMP                                                          ->6
         12    >   FE_FREE                                                      $8
   10    13        INIT_FCALL                                                   'array_slice'
         14        SEND_VAR                                                     !0
         15        SEND_VAR                                                     !3
         16        DO_ICALL                                             $12     
         17        ASSIGN                                                       !4, $12
   12    18        COUNT                                                ~14     !4
         19        CONCAT                                               ~15     ~14, '%0A'
         20        ECHO                                                         ~15
   13    21        INIT_FCALL                                                   'var_dump'
         22        SEND_VAR                                                     !4
         23        DO_ICALL                                                     
         24      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.68 ms | 2049 KiB | 16 Q