Bug #75009 [NEW]: http_response_code() fails on nonstandard error code

From: Date: Mon, 31 Jul 2017 07:17:10 +0000
Subject: Bug #75009 [NEW]: http_response_code() fails on nonstandard error code
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210423@lists.php.net to get a copy of this message
From:             czirkos dot zoltan at gmail dot com
Operating system: Linux 4.4.0-62-generic #83-Ubunt
PHP version:      7.0.21
Package:          Apache2 related
Bug Type:         Bug
Bug description:http_response_code() fails on nonstandard error code

Description:
------------
The http_response_code() function fails for a nonstandard error code
(eg. 210). 500 Internal Server Error is emitted instead.

This only happens with the apache2handler SAPI; eg. Nginx+FPM works
fine.


Test script:
---------------
http_response_code(210);
echo "hello";


Expected result:
----------------
Proper error code sent via the server.

Please not that documenting the list of error codes (in the
documentation at
http://php.net/manual/en/function.http-response-code.php)
is not really
a solution, as custom error codes can be defined.


-- 
Edit bug report at https://bugs.php.net/bug.php?id=75009&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=75009&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=75009&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=75009&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=75009&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=75009&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=75009&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=75009&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=75009&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=75009&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=75009&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=75009&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=75009&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=75009&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75009&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=75009&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=75009&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=75009&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75009&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=75009&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=75009&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#210423) next »