--- linux-gpib-4.0.3/language/php/gpib.c.orig 2016-04-09 15:33:09.000000000 +0200 +++ linux-gpib-4.0.3/language/php/gpib.c 2016-07-14 16:47:47.929605503 +0200 @@ -60,6 +60,10 @@ #include "php.h" #include "ext/standard/info.h" +#if PHP_MAJOR_VERSION >= 7 +#define PZVAL_IS_REF(pz) Z_ISREF_P(pz) +#endif + /* ---- macros for declarations -------------------------- */ #define FUN_ACCESSOR(functionName) \ @@ -495,7 +499,11 @@ ) == FAILURE) { return; } +#if PHP_MAJOR_VERSION >= 7 + RETURN_STRING((char*)gpib_error_string(n)); +#else RETURN_STRING((char*)gpib_error_string(n), 1); +#endif } #endif @@ -550,7 +558,11 @@ memset(p,0,len+1); r=ibrd(n,p,len); p[ibcnt]='\0'; +#if PHP_MAJOR_VERSION >= 7 + ZVAL_STRING(z,p); +#else ZVAL_STRING(z,p,1); +#endif efree(p); RETURN_LONG(r); }