]> granicus.if.org Git - php/commitdiff
Added comment with problem description and two soltions
authorDmitry Stogov <dmitry@zend.com>
Tue, 6 May 2014 00:35:29 +0000 (04:35 +0400)
committerDmitry Stogov <dmitry@zend.com>
Tue, 6 May 2014 00:35:29 +0000 (04:35 +0400)
Zend/zend_execute_API.c

index ff52993ca007999806b96ad9f5ca39ac9dddfc35..3806af0a056849d9913f0e069bbda88f8cef89fb 100644 (file)
@@ -885,7 +885,22 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
                zval *param;
 
                if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)) {
+                       // TODO: Scalar values don't have reference counters anymore.
+                       // They are assumed to be 1, and they may be easily passed by
+                       // reference now. However, previously scalars with refcount==1
+                       // might be passed and with refcount>1 might not. We can support
+                       // only single behavior ???
+#if 0
+                       if (Z_REFCOUNTED(fci->params[i]) &&
+                               // This solution breaks the following test (omit warning message) ???
+                               // Zend/tests/bug61273.phpt
+                               // ext/reflection/tests/bug42976.phpt
+                               // ext/standard/tests/general_functions/call_user_func_array_variation_001.phpt
+#else
                        if (!Z_REFCOUNTED(fci->params[i]) ||
+                               // This solution breaks the following test (emit warning message) ???
+                               // ext/pdo_sqlite/tests/pdo_005.phpt
+#endif
                            (!Z_ISREF(fci->params[i]) && Z_REFCOUNT(fci->params[i]) > 1)) {
 
                                if (fci->no_separation &&