|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44779 filter returns NULL in CLI when it shouldn't
Submitted: 2008-04-18 17:45 UTC Modified: 2008-07-24 09:13 UTC
From: Assigned:
Status: Closed Package: Filter related
PHP Version: 5.3CVS-2008-04-18 (snap) OS: Mac
Private report: No CVE-ID: None
 [2008-04-18 17:45 UTC]
The filter extension appears to have issues with CLI. I have not fully tested it but will provide examples below to demonstrate the problem.

These tests use INPUT_SERVER, but others may be affected. Note: The same code is working correctly for me in mod_php.

Reproduce code:
philip$ cat > foo.php
var_dump( filter_input(INPUT_SERVER, 'PHP_SELF') );
var_dump( $_SERVER['PHP_SELF'] );
philip$ php foo.php 
string(7) "foo.php"

philip$ php -r 'var_dump($_SERVER["PHP_SELF"]);'
string(1) "-"
philip$ php -r 'var_dump( filter_input(INPUT_SERVER, "PHP_SELF"));'


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-24 09:13 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 09:01:27 2024 UTC