summaryrefslogtreecommitdiff
path: root/ext/standard/tests/assert/assert_basic5.phpt
blob: cf2ed6ded3491e6655b81bae4528b45460e25967 (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
29
--TEST--
assert() - basic - check switch on warnings using assert_options.
--INI--
assert.active = 1
assert.warning = 0
assert.callback = f1
assert.bail = 0
--FILE--
<?php
function f1()
{
	echo "f1 called\n";
}

//switch warning on and test return value
var_dump($rao=assert_options(ASSERT_WARNING, 1));
var_dump($r2=assert(0 != 0));
var_dump($r2=assert(0 == 0));

//switch warning on and test return value
var_dump($rao=assert_options(ASSERT_WARNING, 0));
--EXPECTF--
int(0)
f1 called

Warning: assert(): assert(0 != 0) failed in %s on line %d
bool(false)
bool(true)
int(1)