Description
Hi.
The trim function will remove whitespaces in the parameters. The default characters are \n\r\t\v\0, source.
I think maybe \f is missing here? In most of the cases in php (such as is_numeric, source) we recognized \f as a whitespace. Also in libc isspace.c we too include \f as whitespaces:
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2005,2007 Oracle. All rights reserved.
*
* $Id: myisspace.c,v 1.4 2007/05/17 15:14:54 bostic Exp $
*/
/*
* myisspace --
*
* PUBLIC: #ifndef HAVE_ISSPACE
* PUBLIC: int myisspace __P((int));
* PUBLIC: #endif
*/
int
myisspace(c)
int c;
{
return (c == '\t' || c == '\n' ||
c == '\v' || c == '\f' || c == '\r' || c == ' ' ? 1 : 0);
}
Since the document indicate that trim would "Strip whitespace (or other characters) from the beginning and end of a string", I think \f may be an unexpected case here as it is usually treated as whitespaces. Thanks.
PHP Version
Operating System
No response
Description
Hi.
The
trimfunction will remove whitespaces in the parameters. The default characters are\n\r\t\v\0, source.I think maybe
\fis missing here? In most of the cases in php (such asis_numeric, source) we recognized\fas a whitespace. Also in libcisspace.cwe too include\fas whitespaces:Since the document indicate that
trimwould "Strip whitespace (or other characters) from the beginning and end of a string", I think\fmay be an unexpected case here as it is usually treated as whitespaces. Thanks.PHP Version
Operating System
No response