|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58972 responseMessage property is private with little options for overloading send()
Submitted: 2009-12-02 15:06 UTC Modified: 2009-12-30 10:09 UTC
From: grant dot kidd at gmail dot com Assigned: mike (profile)
Status: Closed Package: pecl_http (PECL)
PHP Version: 5.2.1 OS: 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:
26 - 12 = ?
Subscribe to this entry?

 [2009-12-02 15:06 UTC] grant dot kidd at gmail dot com
I'm attempting to write classes that extend HttpRequest and HttpMessage.  According to the documentation, all the properties for HttpRequest class are protected.  As such, I should allow me to send an HttpRequest, intercept the return value, create a new HttpMessage using the factory method and save that new class to the responseMessage property.

Currently there is no way to set the responseMessage property for HttpRequest.

Reproduce code:
class Client extends HttpRequest {
	public function send() {
		$response = parent::send();
		$this->responseMessage = Client_Message::factory($this->getRawResponseMessage());
		return $this->getResponseMessage();

class Client_Message extends HttpMessage {
	public static function factory($raw_message = null, $class_name = null) {
		return parent::factory($raw_message, get_class());

$c = new Client('');
print get_class($c->getResponseMessage());

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-30 10:09 UTC]
This bug has been fixed in SVN.

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.

Now one can set the message class HttpRequest is going to use.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 13 05:01:35 2024 UTC