3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ '.ws_config', 'Akms-wpp-all-vars.cfg', 'makes-lop-use-vars.cfg', '.ptp-sync/ASERD_EDITMSG', '.ptp-sync/index', '.ptp-sync/hooks/apply_value', ]; $hidden = new class (new ArrayIterator($array)) extends FilterIterator { public function accept(): bool { return !str_starts_with($this->current(), '.ptp-sync/'); } }; $result = iterator_to_array($hidden, true); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lQkMA
function name:  (null)
number of ops:  18
compiled vars:  !0 = $array, !1 = $hidden, !2 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   13     1        DECLARE_ANON_CLASS                                   <ptr>   'filteriterator'
          2        NEW                                                  $5      $4
          3        NEW                                                  $6      'ArrayIterator'
          4        SEND_VAR_EX                                                  !0
          5        DO_FCALL                                          0          
          6        SEND_VAR_NO_REF_EX                                           $6
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !1, $5
   20     9        INIT_FCALL                                                   'iterator_to_array'
         10        SEND_VAR                                                     !1
         11        SEND_VAL                                                     <true>
         12        DO_ICALL                                             $10     
         13        ASSIGN                                                       !2, $10
   22    14        INIT_FCALL                                                   'print_r'
         15        SEND_VAR                                                     !2
         16        DO_ICALL                                                     
         17      > RETURN                                                       1

Class FilterIterator@anonymous:
Function accept:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lQkMA
function name:  accept
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   INIT_METHOD_CALL                                             'current'
          1        DO_FCALL                                          0  $0      
          2        FRAMELESS_ICALL_2                str_starts_with      ~1      $0, '.ptp-sync%2F'
          3        BOOL_NOT                                             ~2      ~1
          4        VERIFY_RETURN_TYPE                                           ~2
          5      > RETURN                                                       ~2
   17     6*       VERIFY_RETURN_TYPE                                           
          7*     > RETURN                                                       null

End of function accept

End of class FilterIterator@anonymous.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.58 ms | 1906 KiB | 15 Q