3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ 'red', ' ', 'blue', ' ', '', 'green ', ' ', 'white', ' ', 'black', ' ', ]; var_export(array_filter($array, fn($v) => !ctype_space($v))); echo "\n---\n"; var_export(preg_grep('/^\s+$/', $array, PREG_GREP_INVERT));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r08CN
function name:  (null)
number of ops:  19
compiled vars:  !0 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                       !0, <array>
   18     1        INIT_FCALL                                                   'var_export'
          2        INIT_FCALL                                                   'array_filter'
          3        SEND_VAR                                                     !0
          4        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
          5        SEND_VAL                                                     ~2
          6        DO_ICALL                                             $3      
          7        SEND_VAR                                                     $3
          8        DO_ICALL                                                     
   20     9        ECHO                                                         '%0A---%0A'
   22    10        INIT_FCALL                                                   'var_export'
         11        INIT_FCALL                                                   'preg_grep'
         12        SEND_VAL                                                     '%2F%5E%5Cs%2B%24%2F'
         13        SEND_VAR                                                     !0
         14        SEND_VAL                                                     1
         15        DO_ICALL                                             $5      
         16        SEND_VAR                                                     $5
         17        DO_ICALL                                                     
         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/r08CN
function name:  {closure:/in/r08CN:18}
number of ops:  7
compiled vars:  !0 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'ctype_space'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $1      
          4        BOOL_NOT                                             ~2      $1
          5      > RETURN                                                       ~2
          6*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.96 ms | 1797 KiB | 17 Q