Skip to content

Commit 6080b4f

Browse files
committed
Fxi PHP version checks
1 parent 83f07ad commit 6080b4f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

ibase_query.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,12 +1159,16 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{
11591159
if (flag & PHP_IBASE_PHPDATE) {
11601160
ZVAL_COPY(val, &t_dateo);
11611161
} else {
1162-
#if PHP_MAJOR_VERSION >= 8
1162+
#if PHP_VERSION_ID >= 80400
11631163
ZVAL_STR(val, php_format_date_obj(t_format, strlen(t_format), t_date_obj));
11641164
#else
11651165
zval format_zval, retval;
11661166
ZVAL_STRING(&format_zval, t_format);
1167-
zend_call_method_with_1_params(&t_dateo, php_date_get_date_ce(), NULL, "format", &retval, &format_zval);
1167+
#if PHP_MAJOR_VERSION >= 8
1168+
zend_call_method_with_1_params(Z_OBJ(t_dateo), php_date_get_date_ce(), NULL, "format", &retval, &format_zval);
1169+
#else
1170+
zend_call_method_with_1_params(&t_dateo, php_date_get_date_ce(), NULL, "format", &retval, &format_zval);
1171+
#endif
11681172
zval_ptr_dtor(&format_zval);
11691173
ZVAL_STR(val, Z_STR(retval));
11701174
#endif

0 commit comments

Comments
 (0)