File tree Expand file tree Collapse file tree 5 files changed +88
-5
lines changed Expand file tree Collapse file tree 5 files changed +88
-5
lines changed Original file line number Diff line number Diff line change 5
5
6
6
- Core:
7
7
. Fixed bug #79244 (php crashes during parsing INI file). (Laruence)
8
+ . Fixed bug #63206 (restore_error_handler does not restore previous errors
9
+ mask). (Mark Plomer)
8
10
9
11
- COM:
10
12
. Fixed bug #66322 (COMPersistHelper::SaveToFile can save to wrong location).
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 @@ -1645,11 +1645,11 @@ ZEND_FUNCTION(set_error_handler)
1645
1645
1646
1646
if (Z_TYPE (EG (user_error_handler )) != IS_UNDEF ) {
1647
1647
ZVAL_COPY (return_value , & EG (user_error_handler ));
1648
-
1649
- zend_stack_push (& EG (user_error_handlers_error_reporting ), & EG (user_error_handler_error_reporting ));
1650
- zend_stack_push (& EG (user_error_handlers ), & EG (user_error_handler ));
1651
1648
}
1652
1649
1650
+ zend_stack_push (& EG (user_error_handlers_error_reporting ), & EG (user_error_handler_error_reporting ));
1651
+ zend_stack_push (& EG (user_error_handlers ), & EG (user_error_handler ));
1652
+
1653
1653
if (Z_TYPE_P (error_handler ) == IS_NULL ) { /* unset user-defined handler */
1654
1654
ZVAL_UNDEF (& EG (user_error_handler ));
1655
1655
return ;
@@ -1712,10 +1712,10 @@ ZEND_FUNCTION(set_exception_handler)
1712
1712
1713
1713
if (Z_TYPE (EG (user_exception_handler )) != IS_UNDEF ) {
1714
1714
ZVAL_COPY (return_value , & EG (user_exception_handler ));
1715
-
1716
- zend_stack_push (& EG (user_exception_handlers ), & EG (user_exception_handler ));
1717
1715
}
1718
1716
1717
+ zend_stack_push (& EG (user_exception_handlers ), & EG (user_exception_handler ));
1718
+
1719
1719
if (Z_TYPE_P (exception_handler ) == IS_NULL ) { /* unset user-defined handler */
1720
1720
ZVAL_UNDEF (& EG (user_exception_handler ));
1721
1721
return ;
You can’t perform that action at this time.
0 commit comments