src/Reflection/ReflectionClass.php
private function parsePropertyModifiers($loc): int
    {
        $tokens    = $this->getTokenStream();
        $modifiers = 0; // initialize bit filed with all modifiers switched off

        // Enable visibility bits
        switch ($tokens->type($loc)) {
            case T_PRIVATE:
                $modifiers |= \ReflectionProperty::IS_PRIVATE;
                break;
            case T_PROTECTED:
                $modifiers |= \ReflectionProperty::IS_PROTECTED;
                break;
            case T_VAR:
            case T_PUBLIC:
                $modifiers |= \ReflectionProperty::IS_PUBLIC;
                break;
        }

        // Look forward and backward for STATIC modifier
        $prev = $tokens->previous($loc);
        $next = $tokens->next($loc);

        // If found write the bits
        if ($tokens->type($prev) === T_STATIC || $tokens->type($next) === T_STATIC) {
            $modifiers |= \ReflectionProperty::IS_STATIC;
        }

        return $modifiers;
    }
private function parsePropertyModifiers($loc): int
    {
        $tokens    = $this->getTokenStream();
        $modifiers = 0; // initialize bit filed with all modifiers switched off

        // Enable visibility bits
        switch ($tokens->type($loc)) {
            case T_PRIVATE:
                $modifiers |= \ReflectionProperty::IS_PRIVATE;
                break;
            case T_PROTECTED:
                $modifiers |= \ReflectionProperty::IS_PROTECTED;
                break;
            case T_VAR:
            case T_PUBLIC:
                $modifiers |= \ReflectionProperty::IS_PUBLIC;
                break;
        }

        // Look forward and backward for STATIC modifier
        $prev = $tokens->previous($loc);
        $next = $tokens->next($loc);

        // If found write the bits
        if ($tokens->type($prev) === T_STATIC || $tokens->type($next) === T_STATIC) {
            $modifiers |= \ReflectionProperty::IS_STATIC;
        }

        return $modifiers;
    }
private function parsePropertyModifiers ( $ loc ) : int { $ tokens = $ this -> getTokenStream ( ) ; $ modifiers = 0 ; // initialize bit filed with all modifiers switched off // Enable visibility bits switch ( $ tokens -> type ( $ loc ) ) { case T_PRIVATE : $ modifiers |= \ ReflectionProperty :: IS_PRIVATE ; break ; case T_PROTECTED : $ modifiers |= \ ReflectionProperty :: IS_PROTECTED ; break ; case T_VAR : case T_PUBLIC : $ modifiers |= \ ReflectionProperty :: IS_PUBLIC ; break ; } // Look forward and backward for STATIC modifier $ prev = $ tokens -> previous ( $ loc ) ; $ next = $ tokens -> next ( $ loc ) ; // If found write the bits if ( $ tokens -> type ( $ prev ) === T_STATIC || $ tokens -> type ( $ next ) === T_STATIC ) { $ modifiers |= \ ReflectionProperty :: IS_STATIC ; } return $ modifiers ; }
Parse visibility and static modifier of the property in to a bit field
combining all the modifiers as is done in by PHP Reflection for the
\ReflectionProperty.

Note that properties can not be final and thus this function does not
scan for T_FINAL.

@see \ReflectionProperty

@param int $loc location of the visibility modifier

@return int
Parse visibility and static modifier of the property in to a bit field combining all the modifiers as is done in by PHP Reflection for the \ ReflectionProperty .