mirror of
https://github.com/php/php-src.git
synced 2024-09-29 13:56:09 +00:00
868930e079
Using a non-literal expression in a declare value can cause the compiler to crash trying to turn that AST node into a usable zval. There was an existing test for such values using 'encoding', but that didn't crash because it's handled by the lexer rather than being compiled. Trying to use a non-literal with ticks reproduces the crash.
11 lines
231 B
PHP
11 lines
231 B
PHP
--TEST--
|
|
Use of non-literals in declare ticks values crashes compiler
|
|
--FILE--
|
|
<?php
|
|
declare(ticks = UNKNOWN_CONST) {
|
|
echo 'Done';
|
|
}
|
|
--EXPECTF--
|
|
|
|
Fatal error: declare(ticks) value must be a literal in %sdeclare_006.php on line 2
|