php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65801 trim() can return null
Submitted: 2013-10-01 12:51 UTC Modified: 2013-10-01 17:41 UTC
From: mausglov at yandex dot ru Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: 5.4.20 OS: Windows
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mausglov at yandex dot ru
New email:
PHP Version: OS:

 

 [2013-10-01 12:51 UTC] mausglov at yandex dot ru
Description:
------------
Please, add something like:
For non-strings trim() can return null

( E.g. http://www.php.net/manual/en/function.parse-url.php has a similar remark )

Test script:
---------------
<?
$a = new \stdClass();
$b = trim( $a );

var_dump($b);

Expected result:
----------------
Warning: trim() expects parameter 1 to be string, object given in ... on line 3
string(0) ""

Actual result:
--------------
Warning: trim() expects parameter 1 to be string, object given in ... on line 3
NULL


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-01 17:41 UTC] aharvey@php.net
-Status: Open +Status: Wont fix
 [2013-10-01 17:41 UTC] aharvey@php.net
Documented at http://ca2.php.net/functions.internal.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 04:01:29 2024 UTC