xref: /PHP-8.1/ext/opcache/tests/opt/gh11245_1.phpt (revision 5cad1a71)
1--TEST--
2GH-11245: In some specific cases SWITCH with one default statement will cause segfault (VAR variation)
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=0x7FFFBFFF
7opcache.opt_debug_level=0x20000
8opcache.preload=
9--EXTENSIONS--
10opcache
11--FILE--
12<?php
13function xx() { return "somegarbage"; }
14switch (xx()) {
15	default:
16		if (!empty($xx)) {return;}
17}
18?>
19--EXPECTF--
20$_main:
21     ; (lines=4, args=0, vars=1, tmps=1)
22     ; (after optimizer)
23     ; %s
240000 T1 = ISSET_ISEMPTY_CV (empty) CV0($xx)
250001 JMPNZ T1 0003
260002 RETURN null
270003 RETURN int(1)
28
29xx:
30     ; (lines=1, args=0, vars=0, tmps=0)
31     ; (after optimizer)
32     ; %s
330000 RETURN string("somegarbage")
34