Skip to content

Commit f360ab2

Browse files
committed
Fixes for PHP5
1 parent 6cf20af commit f360ab2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

php_zephir_parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extern zend_module_entry zephir_parser_module_entry;
4242

4343
#define ZEPHIR_PARSER_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(zephir_parser, v)
4444

45-
#if defined(ZTS) && defined(COMPILE_DL_ZEPHIR_PARSER)
45+
#if defined(ZTS) && defined(COMPILE_DL_ZEPHIR_PARSER) && PHP_VERSION_ID >= 70000
4646
ZEND_TSRMLS_CACHE_EXTERN();
4747
#endif
4848

zephir_parser.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ static PHP_FUNCTION(zephir_parse_file)
4343
zval *r = &ret;
4444
#else
4545
zval *error_msg;
46-
zval *e = error_msg;
46+
zval *e;
4747
zval *ret;
48-
zval *r = ret;
48+
zval *r;
4949
#endif
5050

5151
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &content, &content_len, &filepath, &filepath_len) == FAILURE) {
@@ -55,6 +55,8 @@ static PHP_FUNCTION(zephir_parse_file)
5555
#if PHP_VERSION_ID < 70000
5656
MAKE_STD_ZVAL(ret);
5757
MAKE_STD_ZVAL(error_msg);
58+
e = error_msg;
59+
r = ret;
5860
#endif
5961
ZVAL_NULL(e);
6062
xx_parse_program(r, content, content_len, filepath, e);
@@ -130,7 +132,7 @@ zend_module_entry zephir_parser_module_entry = {
130132

131133
/* implement standard "stub" routine to introduce ourselves to Zend */
132134
#ifdef COMPILE_DL_ZEPHIR_PARSER
133-
#ifdef ZTS
135+
#if defined(ZTS) && PHP_VERSION_ID >= 70000
134136
ZEND_TSRMLS_CACHE_DEFINE();
135137
#endif
136138
ZEND_GET_MODULE(zephir_parser)

0 commit comments

Comments
 (0)