ID:               26325
 Updated by:       [EMAIL PROTECTED]
 Reported By:      drm at melp dot nl
-Status:           Open
+Status:           Feedback
 Bug Type:         Zend Engine 2 problem
 Operating System: *
 PHP Version:      5.0.0b2 (beta2)
 New Comment:

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?



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

[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 

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

[2003-11-22 18:57:46] drm at melp dot nl

You are right, i hadn't researched the problem that well, since i
assumed php5 would treat properties the php4-style the same way as php4
itself. But you are right; the code sample above when ran in php5
doesn't give a notice, though php4 does.

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

[2003-11-22 10:26:03] [EMAIL PROTECTED]

Actually, the main issue here is that PHP doesn't give a notice at all
if you access an undefined property, whether it is a private property
in a base class or not.



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

[2003-11-22 09:05:03] drm at melp dot nl

Excuse me, but you are *totally* missing my point here. You are telling
me things i had already pointed out in the first post.

I'll reduce my feature request to one simple line:

Can *at least* a "notice" be triggered when a private member variable
does not exist but is accessed? And by accessed i do NOT mean
assigned!

You're saying it behaves the same way php4 does, but that's just plain
bs. See the following code in PHP4:

<?
error_reporting ( E_ALL );
class Test {
   function getMember () {
      return $this->member;
   }
}
$t = new Test ();
echo $t->getMember ();
?>

This would yield the following notice:
Notice: Undefined property: member in test.php on line 5

All i'm asking is that some notice of the SAME sort can be implemented
in php5 when trying to access parent private members.

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

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