1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 11:13:36 +02:00
Files
archived-php-src/ext/opcache/tests/jit/switch_jumptable.phpt
T
Max Semenik e9f783fcdd Migrate skip checks to --EXTENSIONS--, p3
For rationale, see #6787

Extensions migrated in part 3:
* ftp
* gmp
* iconv
* opcache
* shmop
2021-04-03 15:23:25 +02:00

41 lines
613 B
PHP

--TEST--
Switch jumptable generation
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--EXTENSIONS--
opcache
--FILE--
<?php
function test1(string $val) {
switch ($val) {
case 'str1':
case 'str2':
echo "correct\n";
return;
}
echo "wrong\n";
}
function test2(int $val) {
switch ($val) {
case 1:
case 2:
case 3:
case 4:
case 5:
echo "correct\n";
return;
}
echo "wrong\n";
}
test1("str1");
test2(1);
?>
--EXPECT--
correct
correct