Skip to content

Reference invariant broken in mb_convert_variables() #16261

Closed

Description

@YuanchengJiang

Description

The following code:

<?php
class Test {
public string $x;
}
$test = new Test;
$ref = "";
$test->x =& $ref;
$fusion = $test;
$b = array(&$fusion);
$c = &$b;
mb_convert_variables("EUC-JP", "Shift_JIS", $c);

Resulted in this output:

/php-src/Zend/zend_variables.c:73: void zend_reference_destroy(zend_reference *): Assertion `!((ref)->sources.ptr != ((void*)0))' failed.
Aborted (core dumped)

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

Activity

  1. ndossche commented on Oct 6, 2024

    @ndossche
    Member

    One of the legacy code places that incorrectly sets references, I'll check it out.

  2. self-assigned this
    on Oct 6, 2024
  3. changed the title [-]Assertion failure in Zend/zend_variables.c:73 [/-] [+]Reference invariant broken in mb_convert_variables()[/+] on Oct 6, 2024
  4. added a commit that references this issue on Oct 6, 2024
    514a9e1
  5. added 2 commits that reference this issue on Oct 7, 2024
    bf70d9b
    2fe8c4a
  6. added 2 commits that reference this issue on Oct 7, 2024
    07e418a
    1e6e7bf
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