Bug #80336 [Asn->Nab]: Fatal error: Uncaught ValueError: strrpos(): Argument #3 ($offset) must be con
| From: | cmb@php.net | Date: | Sun, 08 Nov 2020 15:53:08 +0000 |
| Subject: | Bug #80336 [Asn->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-230193@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: Assigned
+Status: Not a bug
Type: Bug
-Package: Testing related
+Package: Strings related
Operating System: Ubunutom 20.04
PHP Version: 8.0.0RC3
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Fine. I'm closing this ticket; please re-open if there is
actually an issue with a non-empty string.
Previous Comments:
------------------------------------------------------------------------
[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>.
------------------------------------------------------------------------
[2020-11-08 12:56:01] info at backups dot nl
Description:
------------
Hi
I get this fatal error in php 8.0 rc3
Fatal Uncaught ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1
Why do i get this error on this code. It is exactly as the php documentation describes to use it.
$pos = strrpos($url, '.', -1);
Please advice.
Test script:
---------------
$url='https://myserver.com';
$pos = strrpos($url, '.', -1);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80336&edit=1