Req #55451 [PATCH]: substr_compare and case sensitivity
| From: | datibbaw@php.net | Date: | Thu, 18 Aug 2011 15:56:29 +0000 |
| Subject: | Req #55451 [PATCH]: substr_compare and case sensitivity | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-162663@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55451&edit=1
ID: 55451
Patch added by: datibbaw@php.net
Reported by: datibbaw@php.net
Summary: substr_compare and case sensitivity
Status: Open
Type: Feature/Change Request
Package: Unknown/Other Function
Operating System: NA
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: substr_compare_optlen
Revision: 1313682989
URL: https://bugs.php.net/patch-display.php?bug=55451&patch=substr_compare_optlen&revision=1313682989
Previous Comments:
------------------------------------------------------------------------
[2011-08-18 15:55:57] datibbaw@php.net
Description:
------------
The $length parameter of this function is optional in the documentation, but
currently it can't be skipped to only set the case sensitivity flag. Values like
null or false get converted into 0 which causes a warning and the function returns
false.
Using null to skip the $length parameter would be nice.
Test script:
---------------
<?php
// should output: 0
echo substr_compare("hello World", "world", 6, null, true), PHP_EOL;
?>
Expected result:
----------------
0
Actual result:
--------------
Warning: substr_compare(): The length must be greater than zero
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55451&edit=1