3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a[0]=" помидорка"; $a[1]=""; $a[2]="огурец "; $a[3]=" апельсин "; $a[4]=" "; $b = array_filter($a, function ($value) { return (bool) trim($value); }); var_dump($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3OFTM
function name:  (null)
number of ops:  20
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN_DIM                                               !0, 0
          1        OP_DATA                                                  '+%D0%BF%D0%BE%D0%BC%D0%B8%D0%B4%D0%BE%D1%80%D0%BA%D0%B0'
    3     2        ASSIGN_DIM                                               !0, 1
          3        OP_DATA                                                  ''
    4     4        ASSIGN_DIM                                               !0, 2
          5        OP_DATA                                                  '%D0%BE%D0%B3%D1%83%D1%80%D0%B5%D1%86+'
    5     6        ASSIGN_DIM                                               !0, 3
          7        OP_DATA                                                  '+%D0%B0%D0%BF%D0%B5%D0%BB%D1%8C%D1%81%D0%B8%D0%BD+'
    6     8        ASSIGN_DIM                                               !0, 4
          9        OP_DATA                                                  '+'
    8    10        INIT_FCALL                                               'array_filter'
         11        SEND_VAR                                                 !0
         12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3OFTM%3A8%240'
   10    13        SEND_VAL                                                 ~7
         14        DO_ICALL                                         $8      
    8    15        ASSIGN                                                   !1, $8
   12    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F3OFTM%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3OFTM
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'trim'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        BOOL                                             ~2      $1
          5      > RETURN                                                   ~2
   10     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3OFTM%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.98 ms | 1396 KiB | 19 Q