forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathassert.phpt
65 lines (48 loc) · 1.67 KB
/
assert.phpt
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
--TEST--
assert()
--INI--
assert.active = 0
assert.warning = 1
assert.callback =
assert.bail = 0
assert.exception=0
--FILE--
<?php
function a($file, $line, $unused, $desc)
{
echo "assertion failed $line,\"$desc\"\n";
}
class a
{
static function assert($file, $line, $unused, $desc)
{
echo "class assertion failed $line,\"$desc\"\n";
}
}
assert_options(ASSERT_ACTIVE,1);
assert_options(ASSERT_WARNING,0);
$a = 0;
assert_options(ASSERT_CALLBACK,"a");
assert($a != 0);
assert_options(ASSERT_CALLBACK,array("a","assert"));
assert($a != 0);
$obj = new a();
assert_options(ASSERT_CALLBACK,array(&$obj,"assert"));
assert($a != 0);
?>
--EXPECTF--
Deprecated: PHP Startup: assert.active INI setting is deprecated in Unknown on line 0
Deprecated: PHP Startup: assert.exception INI setting is deprecated in Unknown on line 0
Deprecated: Constant ASSERT_ACTIVE is deprecated in %s on line %d
Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d
Deprecated: Constant ASSERT_WARNING is deprecated in %s on line %d
Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d
Deprecated: Constant ASSERT_CALLBACK is deprecated in %s on line %d
Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d
assertion failed 21,"assert($a != 0)"
Deprecated: Constant ASSERT_CALLBACK is deprecated in %s on line %d
Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d
class assertion failed 24,"assert($a != 0)"
Deprecated: Constant ASSERT_CALLBACK is deprecated in %s on line %d
Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d
class assertion failed 28,"assert($a != 0)"