Merge branch 'PHP-7.2' into PHP-7.3
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 15 Apr 2019 08:25:00 +0000 (10:25 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 15 Apr 2019 08:25:11 +0000 (10:25 +0200)
1  2 
NEWS
ext/reflection/php_reflection.c

diff --cc NEWS
index da984f9f60dbe99562e2d19abf70ca55d02d7cb0,7c395f520897d8dc71c27956f0c020c82f38473d..65af406231a5b44e0de34b316f4dbefaaebb1b1b
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
@@@ -34,13 -23,14 +34,14 @@@ PH
    . Fixed bug #77800 (phpdbg segfaults on listing some conditional breakpoints).
      (krakjoe)
    . Fixed bug #77805 (phpdbg build fails when readline is shared). (krakjoe)
 -    
 +
  - Reflection:
    . Fixed bug #77772 (ReflectionClass::getMethods(null) doesn't work). (Nikita)
+   . Fixed bug #77882 (Different behavior: always calls destructor). (Nikita)
  
  - Standard:
 -  . Fixed bug #77680 (recursive mkdir on ftp stream wrapper is incorrect).
 -    (Vlad Temian)
 +  . Fixed bug #77793 (Segmentation fault in extract() when overwriting
 +    reference with itself). (Nikita)
    . Fixed bug #77844 (Crash due to null pointer in parse_ini_string with
      INI_SCANNER_TYPED). (Nikita)
    . Fixed bug #77853 (Inconsistent substr_compare behaviour with empty
index 2fa073cbeab5fc50357737e9bdf4b9585e3d057e,0a59d9a74c678a369ace90ad834518208eca827e..f30f47f2b7ee4e004e02b835b4793c0aba9dad88
@@@ -4720,9 -4785,13 +4720,13 @@@ ZEND_METHOD(reflection_class, newInstan
                for (i = 0; i < num_args; i++) {
                        zval_ptr_dtor(&params[i]);
                }
+               if (EG(exception)) {
+                       zend_object_store_ctor_failed(Z_OBJ_P(return_value));
+               }
                if (ret == FAILURE) {
                        php_error_docref(NULL, E_WARNING, "Invocation of %s's constructor failed", ZSTR_VAL(ce->name));
 -                      zval_dtor(return_value);
 +                      zval_ptr_dtor(return_value);
                        RETURN_NULL();
                }
        } else if (ZEND_NUM_ARGS()) {