1--TEST--
2bzcompress(): providing invalid options
3--EXTENSIONS--
4bz2
5--FILE--
6<?php
7
8$string = "Life it seems, will fade away
9Drifting further everyday
10Getting lost within myself
11Nothing matters no one else";
12
13try {
14    var_dump(bzcompress($string, 0));
15} catch (Throwable $e) {
16    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
17}
18try {
19    var_dump(bzcompress($string, 100));
20} catch (Throwable $e) {
21    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
22}
23try {
24    var_dump(bzcompress($string, work_factor: -1));
25} catch (Throwable $e) {
26    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
27}
28try {
29    var_dump(bzcompress($string, work_factor: 255));
30} catch (Throwable $e) {
31    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
32}
33
34?>
35--EXPECT--
36ValueError: bzcompress(): Argument #2 ($block_size) must be between 1 and 9
37ValueError: bzcompress(): Argument #2 ($block_size) must be between 1 and 9
38ValueError: bzcompress(): Argument #3 ($work_factor) must be between 0 and 250
39ValueError: bzcompress(): Argument #3 ($work_factor) must be between 0 and 250
40