stream_notification_callback inside of object destroys object variables
| 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 (profile) | ||
| Status: | Closed | Package: | Streams related | ||
| PHP Version: | 5.2.6 | OS: | Linux | ||
| Private report: | No | CVE-ID: | None | ||
[2008-10-25 23:35 UTC] bbc dot quincy at gmx dot de
Description: ------------ 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: http://quincy.phoenix.net-build.de/example1.txt Example 2: http://quincy.phoenix.net-build.de/example2.txt Expected result: ---------------- The function should modify the right variables. Actual result: -------------- Example 1 output is: string(7) "unknown" Connected to http://www.php.net MIME-type: text/html;charset=utf-8 NULL Example 2 output is: string(7) "unknown" Connected to http://www.php.net MIME-type: text/html;charset=utf-8 string(12) "also unknown"
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2008-10-26 13:29 UTC] felipe@php.net