|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: grant dot kidd at gmail dot com
New email:
PHP Version: OS:


 [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: Sun Jun 16 07:01:28 2024 UTC