|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58245 Extending HttpMessage bit buckes member variables
Submitted: 2008-06-23 18:56 UTC Modified: 2008-07-11 12:45 UTC
From: joe at digg dot com Assigned: mike (profile)
Status: Closed Package: pecl_http (PECL)
PHP Version: 5.2.0 OS: Debian/GNU Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
10 + 1 = ?
Subscribe to this entry?

 [2008-06-23 18:56 UTC] joe at digg dot com
I'm trying to use HttpMessage to loosely couple interacting 
with requests in the application framework we're using here at 
Digg and ran across some really bizarre behavior. 

The problem is that when I extend HttpMessage, create a member 
variable and then attempt to write to that variable the write 
is bit-bucketed. 

Reproduce code:

class Foo
    protected $foo = null;
    public function test()
        $this->foo = $_SERVER['SERVER_NAME'];

class Bar extends HttpMessage
    protected $foo = null;
    public function test()
        $this->foo = $_SERVER['SERVER_NAME'];

$foo = new Foo();

$bar = new Bar();

// Results in the host from Foo and NULL from Bar


Expected result:
Uh ... assigning to member variables should work? At the 
*very* least I should be able to assign to member variables I 
declare myself. 

Actual result:
Values are not assigned to member variables I've declared. 
This is forcing me to, essentially, use the decorator pattern 
as (along with HttpMessage::fromEnv() not firing my child 
class's constructor) extending this class yields unexpected 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-11 12:45 UTC]
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 23:01:28 2024 UTC