summaryrefslogtreecommitdiff
path: root/ext/oci8/oci8_interface.c
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-05-20 16:20:33 +0200
committerChristopher Jones <sixd@php.net>2020-07-22 17:29:30 +1000
commit0d146cb3eba487c4e1d4b554072c30cc4d394cd8 (patch)
treed068ae6c10921a4096b8269fa472081998134fad /ext/oci8/oci8_interface.c
parenta986933ddeff664367d11bebaca2ea6977dbce62 (diff)
downloadphp-git-0d146cb3eba487c4e1d4b554072c30cc4d394cd8.tar.gz
Some cleanup in OCI8 extension for PHP 8
Diffstat (limited to 'ext/oci8/oci8_interface.c')
-rw-r--r--ext/oci8/oci8_interface.c40
1 files changed, 2 insertions, 38 deletions
diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c
index 58e069eb5d..689ac1c2e0 100644
--- a/ext/oci8/oci8_interface.c
+++ b/ext/oci8/oci8_interface.c
@@ -31,7 +31,7 @@
#include "ext/standard/info.h"
#include "php_ini.h"
-#if HAVE_OCI8
+#ifdef HAVE_OCI8
#include "php_oci8.h"
#include "php_oci8_int.h"
@@ -48,38 +48,18 @@ PHP_FUNCTION(oci_register_taf_callback)
zval *callback;
zend_string *callback_name;
+ /* TODO Use ZPP callable */
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z!", &z_connection, &callback) == FAILURE) {
RETURN_THROWS();
}
if (callback) {
-#if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 2)
if (!zend_is_callable(callback, 0, 0)) {
callback_name = zend_get_callable_name(callback);
php_error_docref(NULL, E_WARNING, "Function '%s' is not callable", ZSTR_VAL(callback_name));
-#if PHP_VERSION_ID < 70300
zend_string_release(callback_name);
-#else
- zend_string_release_ex(callback_name, 0);
-#endif
- RETURN_FALSE;
- }
-#else
- if (!zend_is_callable(callback, 0, &callback_name)) {
- php_error_docref(NULL, E_WARNING, "Function '%s' is not callable", ZSTR_VAL(callback_name));
-#if PHP_VERSION_ID < 70300
- zend_string_release(callback_name);
-#else
- zend_string_release_ex(callback_name, 0);
-#endif
RETURN_FALSE;
}
-#if PHP_VERSION_ID < 70300
- zend_string_release(callback_name);
-#else
- zend_string_release_ex(callback_name, 0);
-#endif
-#endif
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
@@ -152,18 +132,10 @@ PHP_FUNCTION(oci_define_by_name)
/* if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) { */
zvtmp = zend_string_init(name, name_len, 0);
if ((define = zend_hash_add_new_ptr(statement->defines, zvtmp, define)) != NULL) {
-#if PHP_VERSION_ID < 70300
- zend_string_release(zvtmp);
-#else
zend_string_release_ex(zvtmp, 0);
-#endif
} else {
efree(define);
-#if PHP_VERSION_ID < 70300
- zend_string_release(zvtmp);
-#else
zend_string_release_ex(zvtmp, 0);
-#endif
RETURN_FALSE;
}
@@ -1365,11 +1337,7 @@ PHP_FUNCTION(oci_fetch_all)
zend_string *zvtmp;
zvtmp = zend_string_init(columns[ i ]->name, columns[ i ]->name_len, 0);
zend_symtable_update(Z_ARRVAL(row), zvtmp, &element);
-#if PHP_VERSION_ID < 70300
- zend_string_release(zvtmp);
-#else
zend_string_release_ex(zvtmp, 0);
-#endif
}
}
@@ -1408,11 +1376,7 @@ PHP_FUNCTION(oci_fetch_all)
array_init(&tmp);
zvtmp = zend_string_init(columns[ i ]->name, columns[ i ]->name_len, 0);
outarrs[ i ] = zend_symtable_update(Z_ARRVAL_P(array), zvtmp, &tmp);
-#if PHP_VERSION_ID < 70300
- zend_string_release(zvtmp);
-#else
zend_string_release_ex(zvtmp, 0);
-#endif
}
}