xref: /PHP-8.0/ext/opcache/tests/bug66251.phpt (revision d30cd7d7)
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--SKIPIF--
8<?php if (!extension_loaded('Zend OPcache')) die("skip Zend OPcache extension not loaded"); ?>
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