File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33?? ??? ????, PHP 7.4.7
44
55- Core:
6+ . Fixed bug #97599 (coredump in set_error_handler). (Laruence)
67 . Fixed bug #79566 (Private SHM is not private on Windows). (cmb)
78 . Fixed bug #79489 (.user.ini does not inherit). (cmb)
89
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Bug #79599 (coredump in set_error_handler)
3+ --FILE--
4+ <?php
5+ set_error_handler (function ($ code , $ message ){
6+ throw new \Exception ($ message );
7+ });
8+ function test1 (){
9+ $ a [] = $ b ;
10+ }
11+ function test2 (){
12+ $ a [$ c ] = $ b ;
13+ }
14+ try {
15+ test1 ();
16+ }catch (\Exception $ e ){
17+ var_dump ($ e ->getMessage ());
18+ }
19+ try {
20+ test2 ();
21+ }catch (\Exception $ e ){
22+ var_dump ($ e ->getMessage ());
23+ }
24+ ?>
25+ --EXPECT--
26+ string(21) "Undefined variable: b"
27+ string(21) "Undefined variable: c"
Original file line number Diff line number Diff line change @@ -1248,6 +1248,10 @@ ZEND_API zval *zend_get_configuration_directive(zend_string *name) /* {{{ */
12481248 } \
12491249 } while (0)
12501250
1251+ static void arg_copy_ctor (zval * zv ) {
1252+ zval_copy_ctor (zv );
1253+ }
1254+
12511255static ZEND_COLD void zend_error_va_list (
12521256 int type , const char * error_filename , uint32_t error_lineno ,
12531257 const char * format , va_list args )
@@ -1341,7 +1345,9 @@ static ZEND_COLD void zend_error_va_list(
13411345 if (!symbol_table ) {
13421346 ZVAL_NULL (& params [4 ]);
13431347 } else {
1344- ZVAL_ARR (& params [4 ], zend_array_dup (symbol_table ));
1348+ array_init (& params [4 ]);
1349+ /* always try to do noninvasive duplication */
1350+ zend_hash_copy (Z_ARRVAL (params [4 ]), symbol_table , arg_copy_ctor );
13451351 }
13461352
13471353 ZVAL_COPY_VALUE (& orig_user_error_handler , & EG (user_error_handler ));
You can’t perform that action at this time.
0 commit comments