男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站

ReflectionClass::getProperties

(PHP 5, PHP 7, PHP 8)

ReflectionClass::getProperties獲取一組屬性

說(shuō)明

public ReflectionClass::getProperties(int $filter = ?): array

獲取反射過(guò)的屬性。

參數

filter

可選的過(guò)濾器,過(guò)濾為所需類(lèi)型的屬性。它使用 ReflectionProperty 常量 來(lái)配置,默認獲取所有類(lèi)型的屬性。

返回值

ReflectionProperty 對象的數組。

范例

示例 #1 ReflectionClass::getProperties() 過(guò)濾例子

這個(gè)例子延時(shí)了可選 filter 參數的用法,例子里實(shí)際上忽略了私有屬性。

<?php
class Foo {
    public    
$foo  1;
    protected 
$bar  2;
    private   
$baz  3;
}

$foo = new Foo();

$reflect = new ReflectionClass($foo);
$props   $reflect->getProperties(ReflectionProperty::IS_PUBLIC ReflectionProperty::IS_PROTECTED);

foreach (
$props as $prop) {
    print 
$prop->getName() . "\n";
}

var_dump($props);

?>

以上例程的輸出類(lèi)似于:

foo
bar
array(2) {
  [0]=>
  object(ReflectionProperty)#3 (2) {
    ["name"]=>
    string(3) "foo"
    ["class"]=>
    string(3) "Foo"
  }
  [1]=>
  object(ReflectionProperty)#4 (2) {
    ["name"]=>
    string(3) "bar"
    ["class"]=>
    string(3) "Foo"
  }
}

參見(jiàn)

男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站