downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ReflectionMethod::getPrototype> <ReflectionMethod::getDeclaringClass
Last updated: Fri, 20 May 2011

view this page in

ReflectionMethod::getModifiers

(PHP 5)

ReflectionMethod::getModifiersGets the method modifiers

Descripción

public int ReflectionMethod::getModifiers ( void )

Gets the method modifiers.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

A numeric representation of the modifiers. The modifiers are listed below. The actual meanings of these modifiers are described in the predefined constants.

ReflectionMethod modifiers
value constant
1 ReflectionMethod::IS_STATIC
2 ReflectionMethod::IS_ABSTRACT
4 ReflectionMethod::IS_FINAL
256 ReflectionMethod::IS_PUBLIC
512 ReflectionMethod::IS_PROTECTED
1024 ReflectionMethod::IS_PRIVATE

Ejemplos

Example #1 ReflectionMethod::getModifiers() example

<?php
class Testing
{
    final public static function 
foo()
    {
        return;
    }
    public function 
bar()
    {
        return;
    }
}

$foo = new ReflectionMethod('Testing''foo');

echo 
"Modifiers for method foo():\n";
echo 
$foo->getModifiers() . "\n";
echo 
implode(' 'Reflection::getModifierNames($foo->getModifiers())) . "\n";

$bar = new ReflectionMethod('Testing''bar');

echo 
"Modifiers for method bar():\n";
echo 
$bar->getModifiers() . "\n";
echo 
implode(' 'Reflection::getModifierNames($bar->getModifiers()));
?>

El resultado del ejemplo sería algo similar a:

Modifiers for method foo():
261
final public static
Modifiers for method bar():
65792

Ver también



add a note add a note User Contributed Notes ReflectionMethod::getModifiers
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites