1--TEST--
2catch assert() errors
3--INI--
4assert.active=1
5assert.warning=1
6assert.callback=
7assert.bail=0
8assert.quiet_eval=0
9--FILE--
10<?php
11
12assert(1);
13assert('1');
14assert('$a');
15
16try {
17	assert('aa=sd+as+safsafasfasafsaf');
18} catch (Throwable $e) {
19	echo $e->getMessage(), "\n";
20}
21
22assert('0');
23
24assert_options(ASSERT_BAIL, 1);
25
26try {
27	assert('aa=sd+as+safsafasfasafsaf');
28} catch (Throwable $e) {
29	echo $e->getMessage(), "\n";
30}
31
32echo "done\n";
33
34?>
35--EXPECTF--
36Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d
37
38Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d
39
40Notice: Undefined variable: a in %sassert02.php(%d) : assert code on line 1
41
42Warning: assert(): Assertion "$a" failed in %sassert02.php on line %d
43
44Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d
45Failure evaluating code:
46aa=sd+as+safsafasfasafsaf
47
48Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d
49
50Warning: assert(): Assertion "0" failed in %sassert02.php on line %d
51
52Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d
53
54Fatal error: Uncaught ParseError: syntax error, unexpected '=', expecting ';' in %s(%d) : assert code:1
55Stack trace:
56#0 %s(%d): assert('aa=sd+as+safsaf...')
57#1 {main}
58
59Next Error: Failure evaluating code:
60aa=sd+as+safsafasfasafsaf in %s:%d
61Stack trace:
62#0 %s(%d): assert('aa=sd+as+safsaf...')
63#1 {main}
64  thrown in %s on line %d
65