File tree Expand file tree Collapse file tree 5 files changed +90
-5
lines changed Expand file tree Collapse file tree 5 files changed +90
-5
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ PHP NEWS
2
2
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3
3
?? ??? ????, PHP 7.3.16
4
4
5
+ - Core:
6
+ . Fixed bug #63206 (restore_error_handler does not restore previous errors
7
+ mask). (Mark Plomer)
8
+
5
9
- COM:
6
10
. Fixed bug #66322 (COMPersistHelper::SaveToFile can save to wrong location).
7
11
(cmb)
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #63206 Fully support error_handler stacking, even inside the error_handler
3
+ --FILE--
4
+ <?php
5
+
6
+ set_error_handler (function () {
7
+ echo 'First handler ' . PHP_EOL ;
8
+ });
9
+
10
+ set_error_handler (function () {
11
+ echo 'Second handler ' . PHP_EOL ;
12
+
13
+ set_error_handler (function () {
14
+ echo 'Internal handler ' . PHP_EOL ;
15
+ });
16
+
17
+ $ triggerInternalNotice ++; // warnings while handling the error should go into internal handler
18
+
19
+ restore_error_handler ();
20
+ });
21
+
22
+ $ triggerNotice1 ++;
23
+ $ triggerNotice2 ++;
24
+ ?>
25
+ --EXPECTF--
26
+ Second handler
27
+ Internal handler
28
+ Second handler
29
+ Internal handler
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #63206 Fully support error_handler stacking, even with null
3
+ --FILE--
4
+ <?php
5
+
6
+ set_error_handler (function () {
7
+ echo 'First handler ' . PHP_EOL ;
8
+ });
9
+
10
+ set_error_handler (function () {
11
+ echo 'Second handler ' . PHP_EOL ;
12
+ });
13
+
14
+ set_error_handler (null );
15
+
16
+ set_error_handler (function () {
17
+ echo 'Fourth handler ' . PHP_EOL ;
18
+ });
19
+
20
+ restore_error_handler ();
21
+ restore_error_handler ();
22
+
23
+ $ triggerNotice ++;
24
+ ?>
25
+ --EXPECTF--
26
+ Second handler
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #63206 Fully support exception_handler stacking, even with null
3
+ --FILE--
4
+ <?php
5
+
6
+ set_exception_handler (function () {
7
+ echo 'First handler ' . PHP_EOL ;
8
+ });
9
+
10
+ set_exception_handler (function () {
11
+ echo 'Second handler ' . PHP_EOL ;
12
+ });
13
+
14
+ set_exception_handler (null );
15
+
16
+ set_exception_handler (function () {
17
+ echo 'Fourth handler ' . PHP_EOL ;
18
+ });
19
+
20
+ restore_exception_handler ();
21
+ restore_exception_handler ();
22
+
23
+ throw new Exception ();
24
+ ?>
25
+ --EXPECTF--
26
+ Second handler
Original file line number Diff line number Diff line change @@ -1665,11 +1665,11 @@ ZEND_FUNCTION(set_error_handler)
1665
1665
1666
1666
if (Z_TYPE (EG (user_error_handler )) != IS_UNDEF ) {
1667
1667
ZVAL_COPY (return_value , & EG (user_error_handler ));
1668
-
1669
- zend_stack_push (& EG (user_error_handlers_error_reporting ), & EG (user_error_handler_error_reporting ));
1670
- zend_stack_push (& EG (user_error_handlers ), & EG (user_error_handler ));
1671
1668
}
1672
1669
1670
+ zend_stack_push (& EG (user_error_handlers_error_reporting ), & EG (user_error_handler_error_reporting ));
1671
+ zend_stack_push (& EG (user_error_handlers ), & EG (user_error_handler ));
1672
+
1673
1673
if (Z_TYPE_P (error_handler ) == IS_NULL ) { /* unset user-defined handler */
1674
1674
ZVAL_UNDEF (& EG (user_error_handler ));
1675
1675
return ;
@@ -1732,10 +1732,10 @@ ZEND_FUNCTION(set_exception_handler)
1732
1732
1733
1733
if (Z_TYPE (EG (user_exception_handler )) != IS_UNDEF ) {
1734
1734
ZVAL_COPY (return_value , & EG (user_exception_handler ));
1735
-
1736
- zend_stack_push (& EG (user_exception_handlers ), & EG (user_exception_handler ));
1737
1735
}
1738
1736
1737
+ zend_stack_push (& EG (user_exception_handlers ), & EG (user_exception_handler ));
1738
+
1739
1739
if (Z_TYPE_P (exception_handler ) == IS_NULL ) { /* unset user-defined handler */
1740
1740
ZVAL_UNDEF (& EG (user_exception_handler ));
1741
1741
return ;
You can’t perform that action at this time.
0 commit comments