Skip to content

Assertion failure when array poping a self addressing variable #17447

Closed

Description

@YuanchengJiang

Description

The following code:

<?php
$input[] = &$input;
array_pop($input);

Resulted in this output:

php: /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_hash.c:1520: void zend_hash_packed_del_val(HashTable *, zval *): Assertion `(zend_gc_refcount(&(ht)->gc) == 1) || ((ht)->u.flags & (1<<6))' failed.
Aborted (core dumped)

PHP Version

nightly

Operating System

No response

Activity

  1. changed the title [-]Assertion failure Zend/zend_hash.c[/-] [+]Assertion failure when array poping a self addressing variable[/+] on Jan 12, 2025
  2. ndossche commented on Jan 12, 2025

    @ndossche
    Member

    We had smth similar with array_shift; I fixed it back then so I'll have a look at this soon.

  3. self-assigned this
    on Jan 12, 2025
  4. added a commit that references this issue on Jan 12, 2025
    b109049
  5. added 2 commits that reference this issue on Jan 16, 2025
    d0d8e68
    ae3ab37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions