Bug #80336 [Nab]: Fatal error: Uncaught ValueError: strrpos(): Argument #3 ($offset) must be con

From: Date: Sun, 08 Nov 2020 17:58:52 +0000
Subject: Bug #80336 [Nab]: Fatal error: Uncaught ValueError: strrpos(): Argument #3 ($offset) must be con
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230199@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80336&edit=1 ID: 80336 Updated by: cmb@php.net Reported by: info at backups dot nl Summary: Fatal error: Uncaught ValueError: strrpos(): Argument #3 ($offset) must be con Status: Not a bug Type: Bug Package: Strings related Operating System: Ubunutom 20.04 PHP Version: 8.0.0RC3 Assigned To: cmb -Block user comment: No +Block user comment: Yes Private report: N New Comment: > I must say i am not pleased with this change. Then consider to raise that on the internals mailing list[1]. This bug tracker is not the appropriate place for *discussions*. [1] <https://www.php.net/mailing-lists.php#internals> Previous Comments: ------------------------------------------------------------------------ [2020-11-08 17:35:33] rtrtrtrtrt at dfdfdfdf dot dfd > 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 if/empty are language constructs while strrpos() is an expesnive function call ------------------------------------------------------------------------ [2020-11-08 17:30:56] info at backups dot nl Hi I must say i am not pleased with this change. Because now we have to check by a if statement if the $haystack NOT is empty before calling any strpos or strrpos or any function that uses a $haystack=false parameter. The php function should do this and just return false not the ones calling the function. 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. ------------------------------------------------------------------------ [2020-11-08 15:53:08] cmb@php.net Fine. I'm closing this ticket; please re-open if there is actually an issue with a non-empty string. ------------------------------------------------------------------------ [2020-11-08 13:31:16] info at backups dot nl i will add a check to test the value of $url being empty. Thanks for the hint. ------------------------------------------------------------------------ [2020-11-08 13:26:56] cmb@php.net Are you absolutely sure that $url contains a non-empty value? See <https://3v4l.org/YXmj3>. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=80336 -- Edit this bug report at https://bugs.php.net/bug.php?id=80336&edit=1

« previous php.bugs (#230199) next »