bug37816.phpt
来自「PHP v6.0 For Linux 运行环境:Win9X/ WinME/ Wi」· PHPT 代码 · 共 29 行
PHPT
29 行
--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 + =
减小字号Ctrl + -
显示快捷键?