Skip to content

Assertion failure in Zend/zend_operators.c:2708 #16186

Closed

Description

@YuanchengJiang

Description

The following code:

<?php
$o = new stdClass();
$fusion = $o;
class A {
private $x;
public function getIncrementor() {
return function() { return ++$this->x; };
}
}
$a = new A(0);
$ca = $a->getIncrementor();
$cb2 = Closure::bind($ca, $fusion);
var_dump($cb2());

Resulted in this output:

/php-src/Zend/zend_operators.c:2708: zend_result increment_function(zval *): Assertion `0' failed.
Aborted (core dumped)

To reproduce:

-d "opcache.jit_hot_func=1" -d "zend_extension=/php-src/modules/opcache.so" -d "opcache.enable_cli=1" -d "opcache.jit=0234"

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

Activity

  1. DanielEScherzer commented on Oct 3, 2024

    @DanielEScherzer
    Member

    Minimal reproduction:

    <?php
    class A {
        private $x;
        public function getIncrementor() {
            return function() { $this->x++; };
        }
    }
    $a = new A();
    $ca = $a->getIncrementor();
    $cb2 = Closure::bind($ca, new stdClass());
    $cb2();
  2. self-assigned this
    on Oct 3, 2024
  3. added a commit that references this issue on Oct 7, 2024
    82f70db
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