xref: /PHP-8.1/ext/opcache/tests/jit/const_001.phpt (revision e9f783fc)
1--TEST--
2JIT CONST: defined
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.jit_buffer_size=1M
8opcache.protect_memory=1
9--EXTENSIONS--
10opcache
11--FILE--
12<?php
13function define_const() {
14    define("CUSTOM_CONSTANT", 1);
15}
16function test_defined() {
17    var_dump(defined("CUSTOM_CONSTANT"));
18    define_const();
19    var_dump(defined("CUSTOM_CONSTANT"));
20}
21
22test_defined();
23?>
24--EXPECT--
25bool(false)
26bool(true)
27