xref: /PHP-7.4/Zend/tests/bug80046.phpt (revision 8516434a)
1--TEST--
2Bug #80046: FREE for SWITCH_STRING optimized away
3--FILE--
4<?php
5
6function test($foo) {
7    switch ($foo . 'Bar') {
8        case 'A':
9            throw new Exception('A');
10        default:
11            throw new Exception('Default');
12    }
13}
14try {
15    test('Foo');
16} catch (Exception $e) {
17    echo $e->getMessage(), "\n";
18}
19
20?>
21--EXPECT--
22Default
23