summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Otto <martijn.otto@copernica.com>2015-03-31 13:00:01 +0200
committerMartijn Otto <martijn.otto@copernica.com>2015-03-31 13:00:01 +0200
commit02809d4b89385fba1660b77609a40be5df5a8013 (patch)
treebdd24b0fb2a76dc75ee9a78f6553728236ef461d
parent6a90c9cd9b16a2785b9bc4a56867a1778b772f27 (diff)
Add a workaround for PHP 5.3
-rw-r--r--zend/value.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/zend/value.cpp b/zend/value.cpp
index f596669..67bead3 100644
--- a/zend/value.cpp
+++ b/zend/value.cpp
@@ -1465,7 +1465,7 @@ bool Value::contains(int index) const
* Does the array contain a certain key
* @param key
* @param size
- * @return
+ * @return
*/
bool Value::contains(const char *key, int size) const
{
@@ -1492,16 +1492,20 @@ bool Value::contains(const char *key, int size) const
// check if the 'has_property' method is available for this object
auto *has_property = Z_OBJ_HT_P(_val)->has_property;
-
+
// leap out if no 'has_property' function is not set (which should normally not occur)
if (!has_property) return false;
// the property must be a zval, turn the key into a value
Value property(key, size);
-
- // call the has_property() method (0 means: check whether property exists and is not NULL,
+
+ // call the has_property() method (0 means: check whether property exists and is not NULL,
// this is not really what we want, but the closest to the possible values of that parameter)
+#if PHP_VERSION_ID >= 50400
return has_property(_val, property._val, 0, nullptr TSRMLS_CC);
+#else
+ return has_property(_val, property._val, 0 TSRMLS_CC);
+#endif
}
else
{