- changed the default value of $include_parent of HttpMessage::toString() to false,
authorMichael Wallner <mike@php.net>
Mon, 19 Sep 2005 16:10:18 +0000 (16:10 +0000)
committerMichael Wallner <mike@php.net>
Mon, 19 Sep 2005 16:10:18 +0000 (16:10 +0000)
  which should be the more intuitive behaviour

http_message_object.c
tests/HttpMessage_001.phpt

index cd64d31a4f0bd87f788b5087736f56a6f559ef10..88cec86091f3b19dcf253d7d10b04a21a08f3647 100644 (file)
@@ -871,7 +871,7 @@ PHP_METHOD(HttpMessage, send)
 }
 /* }}} */
 
 }
 /* }}} */
 
-/* {{{ proto string HttpMessage::toString([bool include_parent = true])
+/* {{{ proto string HttpMessage::toString([bool include_parent = false])
  *
  * Get the string representation of the Message.
  */
  *
  * Get the string representation of the Message.
  */
@@ -880,7 +880,7 @@ PHP_METHOD(HttpMessage, toString)
        IF_RETVAL_USED {
                char *string;
                size_t length;
        IF_RETVAL_USED {
                char *string;
                size_t length;
-               zend_bool include_parent = 1;
+               zend_bool include_parent = 0;
                getObject(http_message_object, obj);
 
                if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &include_parent)) {
                getObject(http_message_object, obj);
 
                if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &include_parent)) {
index 6d8171dd639907624c89a61ab74a8613e5cb34ae..00e0e4b663f230023358d0f656f0318f601e18d0 100644 (file)
@@ -23,8 +23,8 @@ $m = new HttpMessage(
 );
 
 var_dump($m->getBody());
 );
 
 var_dump($m->getBody());
-var_dump($m->toString());
-var_dump(HttpMessage::fromString($m->toString())->toString());
+var_dump($m->toString(true));
+var_dump(HttpMessage::fromString($m->toString(true))->toString(true));
 ?>
 --EXPECTF--
 %sTEST
 ?>
 --EXPECTF--
 %sTEST