3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 0 => "4", 1 => "8", 2 => "15", 3 => "16", 4 => "23", 5 => "42", 6 => "apple", 7 => "water" ); $ints = array_filter($arr, 'is_numeric'); $strs = array_filter($arr, function($v){ return !is_numeric($v); }, ARRAY_FILTER_USE_KEY); $strs = array_filter($arr, function($v, $k){ return !is_numeric($v); }, ARRAY_FILTER_USE_KEY); echo '<pre>'; print_r($ints); print_r($strs); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/evPYv
function name:  (null)
number of ops:  28
compiled vars:  !0 = $arr, !1 = $ints, !2 = $strs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'is_numeric'
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   13     6        INIT_FCALL                                               'array_filter'
          7        SEND_VAR                                                 !0
          8        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
          9        SEND_VAL                                                 ~6
         10        SEND_VAL                                                 2
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !2, $7
   14    13        INIT_FCALL                                               'array_filter'
         14        SEND_VAR                                                 !0
         15        DECLARE_LAMBDA_FUNCTION                          ~9      [1]
         16        SEND_VAL                                                 ~9
         17        SEND_VAL                                                 2
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !2, $10
   15    20        ECHO                                                     '%3Cpre%3E'
   16    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
   17    24        INIT_FCALL                                               'print_r'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                                 
   18    27      > 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/evPYv
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'is_numeric'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        BOOL_NOT                                         ~2      $1
          5      > RETURN                                                   ~2
          6*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/evPYv
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $v, !1 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'is_numeric'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $2      
          5        BOOL_NOT                                         ~3      $2
          6      > RETURN                                                   ~3
          7*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.42 ms | 1017 KiB | 16 Q