xref: /PHP-8.1/ext/opcache/tests/jit/defined_001.phpt (revision e9f783fc)
1--TEST--
2JIT DEFINED: 001
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.jit_buffer_size=1M
8opcache.jit=1235
9--EXTENSIONS--
10opcache
11--FILE--
12<?php
13function foo($i) {
14    $a = defined("X");
15    $b = defined("X");
16    if (defined("X")) {
17        $c = 1;
18    } else {
19        $c = 0;
20    }
21    if (!defined("X")) {
22        $d = 0;
23    } else {
24        $d = 1;
25    }
26    if ($a || $b || $c || $d) {
27
28        die("Error on $i-th iteration\n");
29    }
30
31}
32for ($i = 0; $i < 10000; $i++) {
33    foo($i);
34}
35echo "ok\n";
36?>
37--EXPECT--
38ok
39