#24852 [Opn->Bgs]: protected and private properties' contents can be seen from the outside
ID: 24852
Updated by: zeev@php.net
Reported By: hecsoxpij at freemail dot hu
-Status: Open
+Status: Bogus
Bug Type: Zend Engine 2 problem
Operating System: Windows 2000 SP2
PHP Version: 5CVS-2003-07-29 (dev)
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Expected behavior
Previous Comments:
------------------------------------------------------------------------
[2003-07-29 07:13:30] hecsoxpij at freemail dot hu
Description:
------------
If I create a class with private or protected properties in it the
contents of those can be seen from the outside via the functions
var_dump and print_r. This may lead to some security vulnerabilities
with future applications.
This may not be actually a bug, but it seems rather illogical to be
able to access the values with this method while others fail.
Reproduce code:
---------------
class Test
{
private $foo;
function __construct ()
{
$this->foo = 'xy';
}
}
$test = new Test;
print_r($test);
Expected result:
----------------
test Object
(
)
Actual result:
--------------
test Object
(
[foo:private] => xy
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24852&edit=1
Thread (2 messages)