xref: /PHP-8.4/ext/opcache/tests/leak_001.phpt (revision e9f783fc)
1--TEST--
2Leak 001: Incorrect 'if ();' optimization
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_cache_only=0
7--EXTENSIONS--
8opcache
9--FILE--
10<?php
11if (false);
12
13if (true);
14
15if (2 + 3);
16
17$x = 2;
18$y = 3;
19if ($x + $y);
20
21if ($x);
22
23$a = [[$x]];
24if ($a[0]);
25
26if (new stdClass());
27
28$x = 2;
29$a = [1,$x];
30if ((object)$a);
31?>
32OK
33--EXPECT--
34OK
35