|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46388 stream_notification_callback inside of object destroys object variables
Submitted: 2008-10-25 23:35 UTC Modified: 2008-10-26 13:29 UTC
From: bbc dot quincy at gmx dot de Assigned: felipe
Status: Closed Package: Streams related
PHP Version: 5.2.6 OS: Linux
Private report: No CVE-ID:
 [2008-10-25 23:35 UTC] bbc dot quincy at gmx dot de
The stream_notification_callback is being used inside of a class and tries to modify object variables. Inside of the callback function the varibles are returned in the right way. After leaving the function, changed variables are destroyed. (Example 1)

Surprisingly if the variable is modified outside of the switch statement, but still inside of the stream_notification_callback, variable value changes and cannot be overwritten with the following statements. (Example 2)

Reproduce code:
Example 1:
Example 2:

Expected result:
The function should modify the right variables.

Actual result:
Example 1 output is:
string(7) "unknown"
Connected to
MIME-type: text/html;charset=utf-8

Example 2 output is:
string(7) "unknown"
Connected to
MIME-type: text/html;charset=utf-8
string(12) "also unknown"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-26 13:29 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 09:01:45 2015 UTC