1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 03:32:20 +02:00
Files
archived-php-src/ext/reflection/tests/bug37816.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

29 lines
408 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";
}
?>
===DONE===
--EXPECT--
Caught: Cannot access non-public member TestClass::p
===DONE===