]> granicus.if.org Git - php/commitdiff
Default assert.exception to 1
authorLevi Morrison <levim@php.net>
Sun, 2 Aug 2020 19:34:53 +0000 (13:34 -0600)
committerLevi Morrison <levim@php.net>
Sun, 2 Aug 2020 19:39:35 +0000 (13:39 -0600)
17 files changed:
UPGRADING
Zend/tests/arrow_functions/007.phpt
Zend/tests/ast/zend-pow-assign.phpt
Zend/tests/ast_serialize_backtick_literal.phpt
Zend/tests/attributes/012_ast_export.phpt
Zend/tests/match/009.phpt
ext/standard/assert.c
ext/standard/tests/assert/assert.phpt
ext/standard/tests/assert/assert03.phpt
ext/standard/tests/assert/assert04.phpt
ext/standard/tests/assert/assert_basic.phpt
ext/standard/tests/assert/assert_basic2.phpt
ext/standard/tests/assert/assert_basic3.phpt
ext/standard/tests/assert/assert_basic5.phpt
ext/standard/tests/assert/assert_closures.phpt
ext/standard/tests/assert/assert_error2.phpt
ext/standard/tests/assert/assert_variation.phpt

index d4ddcede72fa23c90bd073f8aa16c902d1f23dcc..b1c722c4a4e8c6c8b275c235c6ba1b5a1fa1ba67 100644 (file)
--- a/UPGRADING
+++ b/UPGRADING
@@ -21,6 +21,8 @@ PHP 8.0 UPGRADE NOTES
 ========================================
 
 - Core:
+  . Assertion failures now throw by default. If the old behavior is desired,
+    then set `assert.exception=0` in INI settings.
   . Methods with the same name as the class are no longer interpreted as
     constructors. The __construct() method should be used instead.
   . Removed ability to call non-static methods statically.
index 0fcc4930d16b73821cee17b0eab72d67598942a0..92b525ffbba089f834394dae00d821e97eaa5454 100644 (file)
@@ -1,5 +1,8 @@
 --TEST--
 Pretty printing for arrow functions
+--INI--
+zend.assertions=1
+assert.exception=0
 --FILE--
 <?php
 
index d978e77ce6f09c42baa2bdfb92ed8988aaef08ae..cae942053908b75cdea1786ea989844468c8b2cd 100644 (file)
@@ -2,6 +2,7 @@
 ZEND_POW_ASSIGN
 --INI--
 zend.assertions=1
+assert.exception=0
 --FILE--
 <?php
 
index 4dd65963c58d1ea9f8ec9be86c454ae48f4e11ac..a757a1db2e25f1a1d2e61518ccf90331c2a33399 100644 (file)
@@ -2,6 +2,7 @@
 Serialization of backtick literal is incorrect
 --INI--
 zend.assertions=1
+assert.exception=0
 --FILE--
 <?php
 
index c811327d0cd9bfbe58860a1941e92f18a41f6922..9412acc6059e72fb91ef3330ad256052bf20f97b 100644 (file)
@@ -1,5 +1,9 @@
 --TEST--
 Attributes AST can be exported.
+--INI--
+zend.assertions=1
+assert.exception=0
+assert.warning=1
 --FILE--
 <?php
 
index 32153e745342bef04f4138adc0389e9dfcea4790..4d5b4a540f9106bead9532e53d592ac1c25a0814 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 Pretty printing for match expression
+--INI--
+assert.exception=0
 --FILE--
 <?php
 
index 45648fbc494724522cf6ada588079d94a6715a9d..3203a4e041be7a17791be714db744f5cbe1253e0 100644 (file)
@@ -77,7 +77,7 @@ PHP_INI_BEGIN()
         STD_PHP_INI_BOOLEAN("assert.bail",             "0",    PHP_INI_ALL,    OnUpdateBool,           bail,                           zend_assert_globals,            assert_globals)
         STD_PHP_INI_BOOLEAN("assert.warning",  "1",    PHP_INI_ALL,    OnUpdateBool,           warning,                        zend_assert_globals,            assert_globals)
         PHP_INI_ENTRY("assert.callback",               NULL,   PHP_INI_ALL,    OnChangeCallback)
-        STD_PHP_INI_BOOLEAN("assert.exception",        "0",    PHP_INI_ALL,    OnUpdateBool,           exception,                      zend_assert_globals,            assert_globals)
+        STD_PHP_INI_BOOLEAN("assert.exception",        "1",    PHP_INI_ALL,    OnUpdateBool,           exception,                      zend_assert_globals,            assert_globals)
 PHP_INI_END()
 
 static void php_assert_init_globals(zend_assert_globals *assert_globals_p) /* {{{ */
index 7935b7c8fd5123503df7dab673b7404c4da0e3b2..54924365b00a9e631b2f7b858d9d9ea463312bdc 100644 (file)
@@ -5,6 +5,7 @@ assert.active = 0
 assert.warning = 1
 assert.callback =
 assert.bail = 0
+assert.exception=0
 --FILE--
 <?php
 function a($file, $line, $unused, $desc)
index 4428790fa2d5bf92802b39d8023f1e95827d8d6e..5224537f449080564c871ea76f6759c4eb2b6cfc 100644 (file)
@@ -5,6 +5,7 @@ assert.active = 1
 assert.warning = 0
 assert.callback =
 assert.bail = 0
+assert.exception=0
 --FILE--
 <?php
 function a($file, $line, $unused, $desc)
index 35f7668ce18d74249e94df3754876147b0359098..0584e65cb6bce388e02adc91d65ec26a58172d51 100644 (file)
@@ -5,6 +5,7 @@ assert.active = 1
 assert.warning = 1
 assert.callback =
 assert.bail = 0
+assert.exception=0
 --FILE--
 <?php
 /* Assert not active */
index dbf15c199815de3c80b75145117f2029832d9540..dee0f46f72fac45acc58763eab81a5602b893938 100644 (file)
@@ -5,6 +5,7 @@ assert.active = 1
 assert.warning = 0
 assert.callback = f1
 assert.bail = 0
+assert.exception=0
 --FILE--
 <?php
 function f1()
index 9d768e0d36dee1fed36c41ca137ac07f89a3299e..bd2f23005d8385c92a06d4e462fd5cb86a498fcd 100644 (file)
@@ -5,6 +5,7 @@ assert.active = 1
 assert.warning = 1
 assert.callback=f1
 assert.bail = 0
+assert.exception=0
 --FILE--
 <?php
 function f2()
index 8374eff951dbee3e5f3f6f28465170f1e2a4e97b..ca896f9f14faf45370ad4e9dab19559b8c60cf19 100644 (file)
@@ -5,6 +5,7 @@ assert.active = 1
 assert.warning = 1
 assert.callback = f1
 assert.bail = 0
+assert.exception=0
 --FILE--
 <?php
 function f1()
index 98053c73134202511bd489583a45779440c9685e..cfdc3028ee4861fa70bee643dc8c219b5b9b50be 100644 (file)
@@ -5,6 +5,7 @@ assert.active = 1
 assert.warning = 0
 assert.callback = f1
 assert.bail = 0
+assert.exception=0
 --FILE--
 <?php
 function f1()
index 13a7e5415e1cd1cf9015a9932fb22b8356282fcc..df497a3828fd8d2978e9eec098e3b472d87c9c24 100644 (file)
@@ -4,6 +4,7 @@ assert() - basic - accept closures as callback.
 assert.active = 1
 assert.warning = 1
 assert.bail = 0
+assert.exception=0
 --FILE--
 <?php
 assert_options(ASSERT_CALLBACK, function () { echo "Hello World!\n"; });
index 027bd03067eaf1277b783176c570dd3df56b8f6e..bc138c3346fd5b312e7fb8cb24f3361d047da557 100644 (file)
@@ -5,6 +5,7 @@ assert.active = 1
 assert.warning = 1
 assert.callback = f1
 assert.bail = 0
+assert.exception=0
 error_reporting = -1
 display_errors = 1
 --FILE--
index 7b550b36d1e29133f4a3ca36c2ea5e396f5358ae..d6ea8a15e67b8afeea0cd52d193cc63ba9809f30 100644 (file)
@@ -5,6 +5,7 @@ assert.active = 1
 assert.warning = 0
 assert.callback = f1
 assert.bail = 0
+assert.exception=0
 --FILE--
 <?php
 function f1()