1
0
mirror of https://github.com/php/php-src.git synced 2026-04-05 07:02:33 +02:00
Files
archived-php-src/ext/standard/tests/assert/bug80290.phpt
Nikita Popov 3bd3651bcc Fixed bug #80290
Dropping the dtor arg args[3] rather than using STR_COPY: Since
PHP 8, we no longer support separation in call_user_function(),
so we also don't need to worry about things like arguments being
replaced with references.
2020-10-30 11:13:35 +01:00

22 lines
468 B
PHP

--TEST--
Bug #80290: Double free when ASSERT_CALLBACK is used with a dynamic message
--FILE--
<?php
assert_options(ASSERT_CALLBACK, function($file, $line, $unused, $message) {
var_dump($message);
});
$x = 'x';
assert(false, 'Dynamic message: ' . $x);
?>
--EXPECTF--
string(18) "Dynamic message: x"
Fatal error: Uncaught AssertionError: Dynamic message: x in %s:%d
Stack trace:
#0 %s(%d): assert(false, 'Dynamic message...')
#1 {main}
thrown in %s on line %d