Req #68219 [NEW]: http_response_code()
| From: | ndschnbl at gmail dot com | Date: | Mon, 13 Oct 2014 18:14:04 +0000 |
| Subject: | Req #68219 [NEW]: http_response_code() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-188073@lists.php.net to get a copy of this message | ||
From: ndschnbl at gmail dot com
Operating system: ANY
PHP version: 5.5.17
Package: Output Control
Bug Type: Feature/Change Request
Bug description:http_response_code()
Description:
------------
The http_response_code() function should return number (int) and text
(string) of response. Currently only the int of the response code is
output.
$http_response_headers works for streams in this way; http_response_code
should also include this functionality.
Test script:
---------------
Current:
var_dump(http_response_code());
// int(200)
Suggested:
var_dump(http_response_code)());
// int(200)
// string(2) "OK"
Current:
var_dump(http_response_code());
// int(301)
Suggested:
var_dump(http_response_code());
// int(301)
// string(17) "Moved Permanently"
Expected result:
----------------
HTTP/1.1 200 OK
HTTP/1.1 301 Moved Permanently
etc.
Actual result:
--------------
200
301
--
Edit bug report at https://bugs.php.net/bug.php?id=68219&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68219&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68219&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68219&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68219&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68219&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68219&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68219&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68219&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68219&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68219&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68219&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68219&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68219&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68219&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68219&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68219&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68219&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68219&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68219&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68219&r=mysqlcfg