From a1544105974460934536dbd0d398d0330de7f444 Mon Sep 17 00:00:00 2001 From: Popa Adrian Marius Date: Thu, 3 Dec 2015 17:28:51 +0200 Subject: [PATCH 1/3] Add PDO_Firebird fix in NEWS --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 9e85dc35db6..60e7ed1eb1d 100644 --- a/NEWS +++ b/NEWS @@ -67,6 +67,9 @@ PHP NEWS . Fixed bug #70993 (Array key references break argument processing). (Laruence) +- PDO_Firebird: + . Fixed bug #60052 (Integer returned as a 64bit integer on X64_86). (Mariuz) + 03 Dec 2015, PHP 7.0.0 - Core: From 5b9267c4c0909b3c3ba27326bda9020d4a1c4470 Mon Sep 17 00:00:00 2001 From: Lior Kaplan Date: Thu, 3 Dec 2015 17:53:48 +0200 Subject: [PATCH 2/3] Align NEWS entries format --- NEWS | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 60e7ed1eb1d..3dcb4e72cd5 100644 --- a/NEWS +++ b/NEWS @@ -7,7 +7,7 @@ PHP NEWS . Fixed bug #70997 (When using parentClass:: instead of parent::, static context changed). (Dmitry) . Fixed bug #70970 (Segfault when combining error handler with output - buffering). (Laruence) + buffering). (Laruence) . Fixed bug #70967 (Weird error handling for __toString when Error is thrown). (Laruence) . Fixed bug #70958 (Invalid opcode while using ::class as trait method @@ -60,7 +60,7 @@ PHP NEWS . Fixed bug #70960 (ReflectionFunction for array_unique returns wrong number of parameters). (Laruence) -- Streams/Socket +- Streams/Socket: . Add IPV6_V6ONLY constant / make it usable in stream contexts. (Bob) - Soap: @@ -155,7 +155,7 @@ PHP NEWS . Fixed bug #69487 (SAPI may truncate POST data). (cmb) . Fixed bug #70198 (Checking liveness does not work as expected). (Shafreeck Sea, Anatol Belski) - . Fixed bug #70241/#70293 (Skipped assertions affect Generator returns). (Bob) + . Fixed bug #70241,#70293 (Skipped assertions affect Generator returns). (Bob) . Fixed bug #70239 (Creating a huge array doesn't result in exhausted, but segfault). (Laruence, Anatol) . Fixed "finally" issues. (Nikita, Dmitry) @@ -195,7 +195,7 @@ PHP NEWS (Laruence) . Fixed bug #69521 (Segfault in gc_collect_cycles()). (arjen at react dot com, Laruence) - . Improved zend_string API (Francois Laupretre) + . Improved zend_string API. (Francois Laupretre) . Fixed bug #69955 (Segfault when trying to combine [] and assign-op on ArrayAccess object). (Laruence) . Fixed bug #69957 (Different ways of handling div/mod/intdiv). (Bob) @@ -345,8 +345,8 @@ PHP NEWS (https://wiki.php.net/rfc/date.timezone_warning_removal). (Bob) . Added "v" DateTime format modifier to get the 3-digit version of fraction of seconds. (Mariano Iglesias) - . Implemented FR #69089: Added DateTime::RFC3339_EXTENDED to output in - RFC3339 Extended format which includes fraction of seconds. (Mariano + . Implemented FR #69089 (Added DateTime::RFC3339_EXTENDED to output in + RFC3339 Extended format which includes fraction of seconds). (Mariano Iglesias) - DBA: @@ -379,7 +379,7 @@ PHP NEWS reqeusts). (Laruence) . Fixed bug #68945 (Unknown admin values segfault pools). (Laruence) . Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes). (Chris Wright) - . Implement request #67106 (Split main fpm config). (Elan Ruusamäe, Remi) + . Implemented FR #67106 (Split main fpm config). (Elan Ruusamäe, Remi) - FTP: . Fixed bug #69082 (FTPS support on Windows). (Anatol) @@ -528,7 +528,7 @@ PHP NEWS and WIFCONTINUED). (Matteo) . Fixed bug #60509 (pcntl_signal doesn't decrease ref-count of old handler when setting SIG_DFL). (Julien) - . Request #68505 (Added wifcontinued and wcontinued). (xilon-jul) + . Implemented FR #68505 (Added wifcontinued and wcontinued). (xilon-jul) . Added rusage support to pcntl_wait() and pcntl_waitpid(). (Anton Stepanenko, Tony) @@ -544,7 +544,7 @@ PHP NEWS . Fixed bug #69864 (Segfault in preg_replace_callback). (cmb, ab) - PDO: - . Fix bug #70861 (Segmentation fault in pdo_parse_params() during Drupal 8 + . Fixed bug #70861 (Segmentation fault in pdo_parse_params() during Drupal 8 test suite). (Anatol) . Fixed bug #70389 (PDO constructor changes unrelated variables). (Laruence) . Fixed bug #70272 (Segfault in pdo_mysql). (Laruence) @@ -657,7 +657,7 @@ PHP NEWS Allowed modification of iterated ArrayObject using the same behavior as proposed in `Fix "foreach" behavior`. Removed "Array was modified outside object and internal position is no longer valid" hack. (Dmitry) - . Implemented #67886 (SplPriorityQueue/SplHeap doesn't expose extractFlags + . Implemented FR #67886 (SplPriorityQueue/SplHeap doesn't expose extractFlags nor curruption state). (Julien) . Fixed bug #66405 (RecursiveDirectoryIterator::CURRENT_AS_PATHNAME breaks the RecursiveIterator). (Paul Garvin) From 3ae3341533b68cccaccfc0d78456b72d004dfc80 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 4 Dec 2015 11:10:07 +0800 Subject: [PATCH 3/3] Fixed bug #71018 (ReflectionProperty::setValue() behavior changed) --- NEWS | 2 + ext/reflection/php_reflection.c | 29 +++---------- .../ReflectionProperty_setAccessible.phpt | 2 +- ext/reflection/tests/bug71018.phpt | 43 +++++++++++++++++++ 4 files changed, 53 insertions(+), 23 deletions(-) create mode 100644 ext/reflection/tests/bug71018.phpt diff --git a/NEWS b/NEWS index 3dcb4e72cd5..776e98de720 100644 --- a/NEWS +++ b/NEWS @@ -51,6 +51,8 @@ PHP NEWS . Fixed stderr being written to stdout. (Bob) - Reflection: + . Fixed bug #71018 (ReflectionProperty::setValue() behavior changed). + (Laruence) . Fixed bug #70982 (setStaticPropertyValue behaviors inconsistently with 5.6). (Laruence) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 72df8b59017..80001e49977 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -5448,31 +5448,16 @@ ZEND_METHOD(reflection_property, setValue) } variable_ptr = &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]; if (variable_ptr != value) { - if (Z_ISREF_P(variable_ptr)) { - zval garbage; + zval garbage; - ZVAL_COPY_VALUE(&garbage, variable_ptr); /* old value should be destroyed */ + ZVAL_DEREF(variable_ptr); + ZVAL_DEREF(value); - /* To check: can't *variable_ptr be some system variable like error_zval here? */ - ZVAL_COPY_VALUE(variable_ptr, value); - if (Z_REFCOUNTED_P(value) && Z_REFCOUNT_P(value) > 0) { - zval_copy_ctor(variable_ptr); - } - zval_dtor(&garbage); - } else { - zval garbage; + ZVAL_COPY_VALUE(&garbage, variable_ptr); - ZVAL_COPY_VALUE(&garbage, variable_ptr); - /* if we assign referenced variable, we should separate it */ - if (Z_REFCOUNTED_P(value)) { - Z_ADDREF_P(value); - } - if (Z_ISREF_P(value)) { - SEPARATE_ZVAL(value); - } - ZVAL_COPY_VALUE(variable_ptr, value); - zval_ptr_dtor(&garbage); - } + ZVAL_COPY(variable_ptr, value); + + zval_ptr_dtor(&garbage); } } else { const char *class_name, *prop_name; diff --git a/ext/reflection/tests/ReflectionProperty_setAccessible.phpt b/ext/reflection/tests/ReflectionProperty_setAccessible.phpt index 1e829b3a6c3..cc184c19203 100644 --- a/ext/reflection/tests/ReflectionProperty_setAccessible.phpt +++ b/ext/reflection/tests/ReflectionProperty_setAccessible.phpt @@ -132,7 +132,7 @@ string(44) "Cannot access non-public member B::protected" string(50) "Cannot access non-public member B::protectedStatic" string(42) "Cannot access non-public member A::private" string(1) "a" -string(1) "b" +string(1) "f" string(1) "c" string(1) "e" string(1) "f" diff --git a/ext/reflection/tests/bug71018.phpt b/ext/reflection/tests/bug71018.phpt new file mode 100644 index 00000000000..00baa31d3c2 --- /dev/null +++ b/ext/reflection/tests/bug71018.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug #71018 (ReflectionProperty::setValue() behavior changed) +--FILE-- +setValue(\T1::class, "world"); +$Prop2->setValue(\T2::class, 'hello'); +var_dump("T2::self = " . T2::getDataBySelf()); +var_dump("T2::static = " . T2::getDataByStatic()); + +// #2 +// prints: hello, hello in both PHP5 and PHP7 - OK +T1::$data = "world"; +T2::$data = 'hello'; + +var_dump("T2::self = " . T2::getDataBySelf()); +var_dump("T2::static = " . T2::getDataByStatic()); +?> +--EXPECT-- +string(16) "T2::self = hello" +string(18) "T2::static = hello" +string(16) "T2::self = hello" +string(18) "T2::static = hello"