3v4l.org

run code in 500+ PHP versions simultaneously
<?php $numbersArr = array(3,5,17,19,24,30,38,12,15,21,67); $userInput = 35; // Filter array, return values larger than user input $filtered = array_filter($numbersArr, function ($value) use($userInput) { return $value >= $userInput; } ); If(count($filtered)>0){ Echo min($filtered); }else{ Echo "no number larger than user input"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fMg7K
function name:  (null)
number of ops:  19
compiled vars:  !0 = $numbersArr, !1 = $userInput, !2 = $filtered
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, 35
    7     2        INIT_FCALL                                                   'array_filter'
          3        SEND_VAR                                                     !0
    8     4        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          5        BIND_LEXICAL                                                 ~5, !1
   10     6        SEND_VAL                                                     ~5
    7     7        DO_ICALL                                             $6      
          8        ASSIGN                                                       !2, $6
   12     9        COUNT                                                ~8      !2
         10        IS_SMALLER                                                   0, ~8
         11      > JMPZ                                                         ~9, ->17
   13    12    >   INIT_FCALL                                                   'min'
         13        SEND_VAR                                                     !2
         14        DO_ICALL                                             $10     
         15        ECHO                                                         $10
   12    16      > JMP                                                          ->18
   15    17    >   ECHO                                                         'no+number+larger+than+user+input'
   16    18    > > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fMg7K
function name:  {closure:/in/fMg7K:8}
number of ops:  5
compiled vars:  !0 = $value, !1 = $userInput
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
    9     2        IS_SMALLER_OR_EQUAL                                  ~2      !1, !0
          3      > RETURN                                                       ~2
   10     4*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.42 ms | 2012 KiB | 15 Q