php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80338 see reported bug in another thread that was closed
Submitted: 2020-11-08 18:44 UTC Modified: 2020-11-08 18:47 UTC
From: info at backups dot nl Assigned:
Status: Duplicate Package: *General Issues
PHP Version: 8.0.0RC3 OS: ubuntu server
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: info at backups dot nl
New email:
PHP Version: OS:

Further comment on this bug is unnecessary.

 

 [2020-11-08 18:44 UTC] info at backups dot nl
Description:
------------
https://bugs.php.net/bug.php?id=80336

You closed the issue not allowing any further comments. But i am not done.

You say

> This requires a lot of code changes and makes things 
> slower again as we most of the time don not know the 
> value of the $haystack

this is *not* true

Then please explain to me why do I get the error when the $haystack is empty?


Now i have to check the $haystack before calling strrpos. or strpos etc etc.


Test script:
---------------
$haystack='';
$pos = strrpos($haystack, '.', -1);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-08 18:46 UTC] rtrtrtrtrt at dfdfdfdf dot dfd
it is *not true* that it is lower doing a simple empty-check versus a useless function call and it makes no sense to call a function to tell you some position within nothing - period
 [2020-11-08 18:47 UTC] girgias@php.net
-Status: Open +Status: Duplicate -Block user comment: No +Block user comment: Yes
 [2020-11-08 18:47 UTC] girgias@php.net
These changes were made for various reasons, if you are against this please raise this up on the internals mailing list as said in the previous bug report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC