1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 13:01:02 +02:00
Files
archived-php-src/ext/reflection/tests/bug37816.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

27 lines
387 B
PHP

--TEST--
Bug #37816 (ReflectionProperty does not throw exception when accessing protected attribute)
--FILE--
<?php
class 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";
}
?>
--EXPECT--
Caught: Cannot access non-public member TestClass::$p