Skip to content

Commit 853eb83

Browse files
committed
Default assert.exception to 1
1 parent 00743f3 commit 853eb83

17 files changed

+24
-1
lines changed

UPGRADING

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ PHP 8.0 UPGRADE NOTES
2121
========================================
2222

2323
- Core:
24+
. Assertion failures now throw by default. If the old behavior is desired,
25+
then set `assert.exception=0` in INI settings.
2426
. Methods with the same name as the class are no longer interpreted as
2527
constructors. The __construct() method should be used instead.
2628
. Removed ability to call non-static methods statically.

Zend/tests/arrow_functions/007.phpt

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
--TEST--
22
Pretty printing for arrow functions
3+
--INI--
4+
zend.assertions=1
5+
assert.exception=0
36
--FILE--
47
<?php
58

Zend/tests/ast/zend-pow-assign.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
ZEND_POW_ASSIGN
33
--INI--
44
zend.assertions=1
5+
assert.exception=0
56
--FILE--
67
<?php
78

Zend/tests/ast_serialize_backtick_literal.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Serialization of backtick literal is incorrect
33
--INI--
44
zend.assertions=1
5+
assert.exception=0
56
--FILE--
67
<?php
78

Zend/tests/attributes/012_ast_export.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
--TEST--
22
Attributes AST can be exported.
3+
--INI--
4+
zend.assertions=1
5+
assert.exception=0
6+
assert.warning=1
37
--FILE--
48
<?php
59

Zend/tests/match/009.phpt

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
--TEST--
22
Pretty printing for match expression
3+
--INI--
4+
assert.exception=0
35
--FILE--
46
<?php
57

ext/standard/assert.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ PHP_INI_BEGIN()
7777
STD_PHP_INI_BOOLEAN("assert.bail", "0", PHP_INI_ALL, OnUpdateBool, bail, zend_assert_globals, assert_globals)
7878
STD_PHP_INI_BOOLEAN("assert.warning", "1", PHP_INI_ALL, OnUpdateBool, warning, zend_assert_globals, assert_globals)
7979
PHP_INI_ENTRY("assert.callback", NULL, PHP_INI_ALL, OnChangeCallback)
80-
STD_PHP_INI_BOOLEAN("assert.exception", "0", PHP_INI_ALL, OnUpdateBool, exception, zend_assert_globals, assert_globals)
80+
STD_PHP_INI_BOOLEAN("assert.exception", "1", PHP_INI_ALL, OnUpdateBool, exception, zend_assert_globals, assert_globals)
8181
PHP_INI_END()
8282

8383
static void php_assert_init_globals(zend_assert_globals *assert_globals_p) /* {{{ */

ext/standard/tests/assert/assert.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ assert.active = 0
55
assert.warning = 1
66
assert.callback =
77
assert.bail = 0
8+
assert.exception=0
89
--FILE--
910
<?php
1011
function a($file, $line, $unused, $desc)

ext/standard/tests/assert/assert03.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ assert.active = 1
55
assert.warning = 0
66
assert.callback =
77
assert.bail = 0
8+
assert.exception=0
89
--FILE--
910
<?php
1011
function a($file, $line, $unused, $desc)

ext/standard/tests/assert/assert04.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ assert.active = 1
55
assert.warning = 1
66
assert.callback =
77
assert.bail = 0
8+
assert.exception=0
89
--FILE--
910
<?php
1011
/* Assert not active */

ext/standard/tests/assert/assert_basic.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ assert.active = 1
55
assert.warning = 0
66
assert.callback = f1
77
assert.bail = 0
8+
assert.exception=0
89
--FILE--
910
<?php
1011
function f1()

ext/standard/tests/assert/assert_basic2.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ assert.active = 1
55
assert.warning = 1
66
assert.callback=f1
77
assert.bail = 0
8+
assert.exception=0
89
--FILE--
910
<?php
1011
function f2()

ext/standard/tests/assert/assert_basic3.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ assert.active = 1
55
assert.warning = 1
66
assert.callback = f1
77
assert.bail = 0
8+
assert.exception=0
89
--FILE--
910
<?php
1011
function f1()

ext/standard/tests/assert/assert_basic5.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ assert.active = 1
55
assert.warning = 0
66
assert.callback = f1
77
assert.bail = 0
8+
assert.exception=0
89
--FILE--
910
<?php
1011
function f1()

ext/standard/tests/assert/assert_closures.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ assert() - basic - accept closures as callback.
44
assert.active = 1
55
assert.warning = 1
66
assert.bail = 0
7+
assert.exception=0
78
--FILE--
89
<?php
910
assert_options(ASSERT_CALLBACK, function () { echo "Hello World!\n"; });

ext/standard/tests/assert/assert_error2.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ assert.active = 1
55
assert.warning = 1
66
assert.callback = f1
77
assert.bail = 0
8+
assert.exception=0
89
error_reporting = -1
910
display_errors = 1
1011
--FILE--

ext/standard/tests/assert/assert_variation.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ assert.active = 1
55
assert.warning = 0
66
assert.callback = f1
77
assert.bail = 0
8+
assert.exception=0
89
--FILE--
910
<?php
1011
function f1()

0 commit comments

Comments
 (0)