Incorrect behaviour of PPP using foreach
| Bug #24837 | Incorrect behaviour of PPP using foreach | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2003-07-28 02:39 UTC | Modified: | 2003-12-22 05:39 UTC |
|
||||||||||
| From: | redeye at erisx dot de | Assigned: | helly (profile) | |||||||||||
| Status: | Closed | Package: | Scripting Engine problem | |||||||||||
| PHP Version: | 5CVS-2003-11-29 | OS: | * | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2003-07-28 02:39 UTC] 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
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2003-12-18 17:01 UTC] helly@php.net
[2003-12-22 03:59 UTC] redeye at erisx dot de
[2003-12-22 05:39 UTC] helly@php.net