xref: /PHP-8.1/ext/opcache/tests/bug66251.phpt (revision e9f783fc)
1--TEST--
2Bug #66251 (Constants get statically bound at compile time when Optimized)
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7--EXTENSIONS--
8opcache
9--FILE--
10<?php
11printf ("A=%s\n", getA());
12const A="hello";
13function getA() {return A;}
14?>
15--EXPECTF--
16Fatal error: Uncaught Error: Undefined constant "A" in %s:%d
17Stack trace:
18#0 %s(%d): getA()
19#1 {main}
20  thrown in %s on line %d
21