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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Tue May 28 01:01:31 2024 UTC