ID:               26325
 Updated by:       [EMAIL PROTECTED]
 Reported By:      drm at melp dot nl
-Status:           Open
+Status:           Closed
 Bug Type:         Zend Engine 2 problem
 Operating System: *
-PHP Version:      5.0.0b2 (beta2)
+PHP Version:      5.0.0b2
 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.

A derived class does not know *anything* about private members of a
base class. Hence there cannot be a distinction. Hence the result is
correct.


Previous Comments:
------------------------------------------------------------------------

[2003-12-23 10:30:23] arjen at glas dot its dot tudelft dot nl

I've tested this with php5-200312222030 snapshot and I get two notices,
when using this code (which is correct):
<?
error_reporting ( E_ALL );
class Test
{
    private $member = "member";
}

class DeriveTest extends Test
{
     function __toString()
     {
        return "Member: {$this->member}, nonexistent
{$this->nonexistent}";
    }
}
$o = new DeriveTest ();
echo $o, '<br>';
highlight_file(__FILE__);
?>

It could, however, be done even better if it were a bit more
explainatory notice. Like Java's error for instance:
DeriveTest.java:5: member2 has private access in Test
                return "Member contains: " + member2 + " and getMember
sais: " + nonexistent;
                                             ^
DeriveTest.java:5: cannot resolve symbol
symbol  : variable nonexistent
location: class DeriveTest
                return "Member contains: " + member2 + " and getMember
sais: " + nonexistent;
                                                                       
         ^
2 errors

I.e. a distinction between nonexistent members and private members.

------------------------------------------------------------------------

[2003-12-17 12:06:25] drm at melp dot nl

sniper >

I tried the snapshot (labeled PHP/5.0.0b3-dev), but the problem
persists.

------------------------------------------------------------------------

[2003-12-16 03:00:41] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

AFAICT, bug #26182 is fixed..so try the snapshot?


------------------------------------------------------------------------

[2003-11-26 11:07:13] drm at melp dot nl

J > Sorry i reacted that way, I misinterpreted your post. 

I cannot reproduce what you mean in PHP4. Can you give an example?

I tried some stuff, but all the versions i tried gave expected results.
Changing "private $member" into "var $member" or removing that line
completely results in:

-----
Member contains: Test constructor, though getMember() says: Test
constructor?
Member contains: a, though getMember() says: a?
-----

which is logical, since the member will be public as soon as you
introduce it, both with "var $member" and removing the line completely
(and initializing it in the Test constructor). When removing the
initialization in the Test constructor, the same notice as in the other
codesample will be produced. (Notice: Undefined property: member in
....)

btw: i figure this hasn't got anything to do with the fact that I
tested on WinXP, maybe that should be changed to OS: irrelevant?

------------------------------------------------------------------------

[2003-11-24 11:28:58] [EMAIL PROTECTED]

Take your original example and edit it so it works in PHP 
4. It runs in both 4 and 5 without a notice. Based on your 
original example code, that isn't "just plain bs."  
 
Upon further inspection based on your second example, 
there is definitely something weird going on here. This is 
most likely related to #26182. 
 
J 
 
I'm not positive, but I think this may have something to 
do with #26182.  
 
J 

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/26325

-- 
Edit this bug report at http://bugs.php.net/?id=26325&edit=1

Reply via email to