Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Assertion failure in zif_highlight_string when messing up output buffers #20906

Open
@vi3tL0u1s

Description

Description

The following code:

<?php
class A {
 function __destruct() {
 highlight_string("<?php", true);
 trigger_error("");
 ob_start(function () use (&$c) { $c = new A; return '/'; }, 1);
 $c = new A;
 unset($c);
 ob_start(function &() use (&$c) { $c = new A; return '/'; }, 1);
 }
}
new A;

Resulted in this output:

/php: /path/to/php-src/ext/standard/basic_functions.c:1837: zif_highlight_string: Assertion `zval_get_type(&(*(return_value))) == 6' failed.
Aborted

Commit

2813f62476f6fb1b8d59f25527dbf2953fdf69a7

Configurations

./configure --enable-debug --enable-address-sanitizer --disable-shared --with-pic --enable-mbstring --with-zlib

PHP Version

PHP 8.6.0-dev (cli) (built: Jan 11 2026 13:54:51) (NTS DEBUG)
Copyright (c) The PHP Group
Zend Engine v4.6.0-dev, Copyright (c) Zend Technologies
 with Zend OPcache v8.6.0-dev, Copyright (c), by Zend Technologies

Operating System

Ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /