Annotation of embedaddon/php/ext/standard/tests/assert/assert_basic5.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: assert() - basic - check switch on warnings using assert_options.
3: --INI--
4: assert.active = 1
5: assert.warning = 0
6: assert.callback = f1
7: assert.bail = 0
8: assert.quiet_eval = 0
9: --FILE--
10: <?php
11: function f1()
12: {
13: echo "f1 called\n";
14: }
15:
16: //switch warning on and test return value
17: var_dump($rao=assert_options(ASSERT_WARNING, 1));
18: $sa = "0 != 0";
19: var_dump($r2=assert($sa));
20: $sa = "0 == 0";
21: var_dump($r2=assert($sa));
22:
23: //switch warning on and test return value
24: var_dump($rao=assert_options(ASSERT_WARNING, 0));
25: --EXPECTF--
26: int(0)
27: f1 called
28:
29: Warning: assert(): Assertion "0 != 0" failed in %s on line 10
30: NULL
31: bool(true)
32: int(1)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>