original_string: public static function filter(array $a, $filter, array $listedProperties = [], &$count = 0)
      {
          $count = 0;
  
          foreach ($a as $k => $v) {
              $type = self::EXCLUDE_STRICT & $filter;
  
              if (null === $v) {
                  $type |= self::EXCLUDE_NULL & $filter;
                  $type |= self::EXCLUDE_EMPTY & $filter;
              } elseif (false === $v || '' === $v || '0' === $v || 0 === $v || 0.0 === $v || [] === $v) {
                  $type |= self::EXCLUDE_EMPTY & $filter;
              }
              if ((self::EXCLUDE_NOT_IMPORTANT & $filter) && !\in_array($k, $listedProperties, true)) {
                  $type |= self::EXCLUDE_NOT_IMPORTANT;
              }
              if ((self::EXCLUDE_VERBOSE & $filter) && \in_array($k, $listedProperties, true)) {
                  $type |= self::EXCLUDE_VERBOSE;
              }
  
              if (!isset($k[1]) || "\0" !== $k[0]) {
                  $type |= self::EXCLUDE_PUBLIC & $filter;
              } elseif ('~' === $k[1]) {
                  $type |= self::EXCLUDE_VIRTUAL & $filter;
              } elseif ('+' === $k[1]) {
                  $type |= self::EXCLUDE_DYNAMIC & $filter;
              } elseif ('*' === $k[1]) {
                  $type |= self::EXCLUDE_PROTECTED & $filter;
              } else {
                  $type |= self::EXCLUDE_PRIVATE & $filter;
              }
  
              if ((self::EXCLUDE_STRICT & $filter) ? $type === $filter : $type) {
                  unset($a[$k]);
                  ++$count;
              }
          }
  
          return $a;
      }
code: public static function filter(array $a, $filter, array $listedProperties = [], &$count = 0)
      {
          $count = 0;
  
          foreach ($a as $k => $v) {
              $type = self::EXCLUDE_STRICT & $filter;
  
              if (null === $v) {
                  $type |= self::EXCLUDE_NULL & $filter;
                  $type |= self::EXCLUDE_EMPTY & $filter;
              } elseif (false === $v || '' === $v || '0' === $v || 0 === $v || 0.0 === $v || [] === $v) {
                  $type |= self::EXCLUDE_EMPTY & $filter;
              }
              if ((self::EXCLUDE_NOT_IMPORTANT & $filter) && !\in_array($k, $listedProperties, true)) {
                  $type |= self::EXCLUDE_NOT_IMPORTANT;
              }
              if ((self::EXCLUDE_VERBOSE & $filter) && \in_array($k, $listedProperties, true)) {
                  $type |= self::EXCLUDE_VERBOSE;
              }
  
              if (!isset($k[1]) || "\0" !== $k[0]) {
                  $type |= self::EXCLUDE_PUBLIC & $filter;
              } elseif ('~' === $k[1]) {
                  $type |= self::EXCLUDE_VIRTUAL & $filter;
              } elseif ('+' === $k[1]) {
                  $type |= self::EXCLUDE_DYNAMIC & $filter;
              } elseif ('*' === $k[1]) {
                  $type |= self::EXCLUDE_PROTECTED & $filter;
              } else {
                  $type |= self::EXCLUDE_PRIVATE & $filter;
              }
  
              if ((self::EXCLUDE_STRICT & $filter) ? $type === $filter : $type) {
                  unset($a[$k]);
                  ++$count;
              }
          }
  
          return $a;
      }
code_tokens: public static function filter ( array $ a , $ filter , array $ listedProperties = [ ] , & $ count = 0 ) { $ count = 0 ; foreach ( $ a as $ k => $ v ) { $ type = self :: EXCLUDE_STRICT & $ filter ; if ( null === $ v ) { $ type |= self :: EXCLUDE_NULL & $ filter ; $ type |= self :: EXCLUDE_EMPTY & $ filter ; } elseif ( false === $ v || '' === $ v || '0' === $ v || 0 === $ v || 0.0 === $ v || [ ] === $ v ) { $ type |= self :: EXCLUDE_EMPTY & $ filter ; } if ( ( self :: EXCLUDE_NOT_IMPORTANT & $ filter ) && ! \ in_array ( $ k , $ listedProperties , true ) ) { $ type |= self :: EXCLUDE_NOT_IMPORTANT ; } if ( ( self :: EXCLUDE_VERBOSE & $ filter ) && \ in_array ( $ k , $ listedProperties , true ) ) { $ type |= self :: EXCLUDE_VERBOSE ; } if ( ! isset ( $ k [ 1 ] ) || "\0" !== $ k [ 0 ] ) { $ type |= self :: EXCLUDE_PUBLIC & $ filter ; } elseif ( '~' === $ k [ 1 ] ) { $ type |= self :: EXCLUDE_VIRTUAL & $ filter ; } elseif ( '+' === $ k [ 1 ] ) { $ type |= self :: EXCLUDE_DYNAMIC & $ filter ; } elseif ( '*' === $ k [ 1 ] ) { $ type |= self :: EXCLUDE_PROTECTED & $ filter ; } else { $ type |= self :: EXCLUDE_PRIVATE & $ filter ; } if ( ( self :: EXCLUDE_STRICT & $ filter ) ? $ type === $ filter : $ type ) { unset ( $ a [ $ k ] ) ; ++ $ count ; } } return $ a ; }
docstring: Filters out the specified properties.
  
  By default, a single match in the $filter bit field filters properties out, following an "or" logic.
  When EXCLUDE_STRICT is set, an "and" logic is applied: all bits must match for a property to be removed.
  
  @param array    $a                The array containing the properties to filter
  @param int      $filter           A bit field of Caster::EXCLUDE_* constants specifying which properties to filter out
  @param string[] $listedProperties List of properties to exclude when Caster::EXCLUDE_VERBOSE is set, and to preserve when Caster::EXCLUDE_NOT_IMPORTANT is set
  @param int      &$count           Set to the number of removed properties
  
  @return array The filtered array
docstring_tokens: Filters out the specified properties .