|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79817 str_replace() does not handle INDIRECT elements
Submitted: 2020-07-09 05:36 UTC Modified: 2020-07-10 11:13 UTC
From: changochen1 at gmail dot com Assigned: nikic (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 7.3.20 OS:
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.
Block user comment
Status: Assign to:
Bug Type:
From: changochen1 at gmail dot com
New email:
PHP Version: OS:


 [2020-07-09 05:36 UTC] changochen1 at gmail dot com
php: /home/yongheng/php_clean/Zend/zend_operators.c:915: zend_string *__zval_get_string_func(zval *, zend_bool): Assertion `0' failed.

Test script:
switch ( $a ) {
    case str_replace('x' , array () , $GLOBALS );


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-09 07:10 UTC]
-Status: Open +Status: Verified -PHP Version: 8.0Git-2020-07-09 (Git) +PHP Version: 7.3.20
 [2020-07-09 07:10 UTC]
The problem is that we're passing an IS_INDIRECT value to
zval_get_tmp_string()[1] which doesn't expect that.

[1] <>
 [2020-07-10 11:13 UTC]
-Summary: Assertion `0' failed. in __zval_get_string_func +Summary: str_replace() does not handle INDIRECT elements -Status: Verified +Status: Assigned -Assigned To: +Assigned To: nikic
 [2020-07-10 12:10 UTC]
Automatic comment on behalf of
Log: Fixed bug #79817
 [2020-07-10 12:10 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jun 13 00:01:24 2021 UTC