#24837 [Csd]: Incorrect behaviour of PPP using foreach
| From: | helly@php.net | Date: | Thu, 18 Dec 2003 22:01:31 +0000 |
| Subject: | #24837 [Csd]: Incorrect behaviour of PPP using foreach | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-52267@lists.php.net to get a copy of this message | ||
ID: 24837
Updated by: helly@php.net
Reported By: redeye at erisx dot de
Status: Closed
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5CVS-2003-11-29
Assigned To: helly
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2003-07-28 02:39:49] redeye at erisx dot de
Description:
------------
Using a foreach ( or while ) loop to print the
content of an object should to my understanding
skip private and protected values ( or methods ).
Actually these values are returned but missing
their respective keys, so at least their source
is hidden.
Reproduce code:
---------------
<pre><?php
class test {
private $foo = 'test foo';
private $bar = 'test bar';
protected $foobar = 'test foobar';
}
$test = new test;
foreach ( $test AS $key => $val ){
echo $key." => ".$val."\r\n";
}
?></pre>
Expected result:
----------------
empty page :)
Actual result:
--------------
=> test foo
=> test bar
=> test foobar
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24837&edit=1