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