blob: e9b3f04b04770ed0974fc19f5047781357748a3f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
--TEST--
assert() - basic - Test that bailout works
--INI--
assert.active = 1
assert.warning = 1
assert.callback = f1
assert.quiet_eval = 1
assert.bail = 0
--FILE--
<?php
function f1($message)
{
echo "f1 called\n";
}
//bail out on error
var_dump($rao = assert_options(ASSERT_BAIL, 1));
$sa = "0 != 0";
var_dump($r2 = assert($sa, "0 is 0"));
echo "If this is printed BAIL hasn't worked";
--EXPECTF--
int(0)
Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d
f1 called
Warning: assert(): 0 is 0: "0 != 0" failed in %s on line 10
|