$methods =
[];
foreach (['set', 'isset', 'unset', 'clone', 'serialize', 'unserialize', 'sleep', 'wakeup', 'destruct', 'get'
] as $method) { if (!
$parent || !
method_exists($parent, '__'.
$method)) { $methods[$method] = false;
} else { $m =
new \
ReflectionMethod($parent, '__'.
$method);
$methods[$method] = !
$m->
isAbstract() && !
$m->
isPrivate();
} } $methods['get'
] =
$methods['get'
] ?
($m->
returnsReference() ? 2 : 1
) : 0;
return $methods;
} public static function getScope($propertyScopes,
$class,
$property,
$readonlyScope = null
) { if (null ===
$readonlyScope && !
isset($propertyScopes[$k = "\0
$class\0
$property"
]) && !
isset($propertyScopes[$k = "\0*\0
$property"
])) { return null;
} $frame =
debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS, 3
)[2
];