xref: /PHP-8.4/ext/opcache/tests/opt/gh11245_1.phpt (revision e48a5c14)
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=
9zend_test.observer.enabled=0
10--EXTENSIONS--
11opcache
12--FILE--
13<?php
14function xx() { return "somegarbage"; }
15switch (xx()) {
16	default:
17		if (!empty($xx)) {return;}
18}
19?>
20--EXPECTF--
21$_main:
22     ; (lines=4, args=0, vars=1, tmps=1)
23     ; (after optimizer)
24     ; %s
250000 T1 = ISSET_ISEMPTY_CV (empty) CV0($xx)
260001 JMPNZ T1 0003
270002 RETURN null
280003 RETURN int(1)
29
30xx:
31     ; (lines=1, args=0, vars=0, tmps=0)
32     ; (after optimizer)
33     ; %s
340000 RETURN string("somegarbage")
35