📄 bug37816.phpt
字号:
--TEST--Bug #37816 (ReflectionProperty does not throw exception when accessing protected attribute)--FILE--<?phpclass TestClass{ protected $p = 2;}$o = new TestClass;$r = new ReflectionProperty($o, 'p');try{ $x = $r->getValue($o);}catch (Exception $e){ echo 'Caught: ' . $e->getMessage() . "\n";}?>===DONE===--EXPECTF--Caught: Cannot access non-public member TestClass::p===DONE===
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -