@@ -196,15 +196,18 @@ static void (*old_zend_execute)(zend_execute_data *execute_data);
196
196
static void (* old_zend_execute_internal )(zend_execute_data * execute_data_ptr , zval * return_value );
197
197
#define zend_execute_fn zend_execute_ex
198
198
199
- #if ZEND_MODULE_API_NO < 20170718 /* PHP 7.1 - 7.2 */
199
+ #if PHP_VERSION_ID < 70200 /* PHP 7.1 */
200
200
static void (* old_zend_error_cb )(int type , const char * error_filename , const uint error_lineno , const char * format , va_list args );
201
201
#define MEMPROF_ZEND_ERROR_CB_ARGS_PASSTHRU type, error_filename, error_lineno, format, args
202
- #elif ZEND_MODULE_API_NO < 20200930 /* PHP 7.3 - 7.4 */
202
+ #elif PHP_VERSION_ID < 80000 /* PHP 7.2 - 7.4 */
203
203
static void (* old_zend_error_cb )(int type , const char * error_filename , const uint32_t error_lineno , const char * format , va_list args );
204
204
#define MEMPROF_ZEND_ERROR_CB_ARGS_PASSTHRU type, error_filename, error_lineno, format, args
205
- #else /* PHP 8 */
205
+ #elif PHP_VERSION_ID < 80100 /* PHP 8.0 */
206
206
static void (* old_zend_error_cb )(int type , const char * error_filename , const uint32_t error_lineno , zend_string * message );
207
207
#define MEMPROF_ZEND_ERROR_CB_ARGS_PASSTHRU type, error_filename, error_lineno, message
208
+ #else /* PHP 8.1 */
209
+ static void (* old_zend_error_cb )(int type , zend_string * error_filename , const uint32_t error_lineno , zend_string * message );
210
+ #define MEMPROF_ZEND_ERROR_CB_ARGS_PASSTHRU type, error_filename, error_lineno, message
208
211
#endif
209
212
210
213
static PHP_INI_MH ((* origOnChangeMemoryLimit )) = NULL ;
@@ -764,17 +767,19 @@ static char * generate_filename(const char * format) {
764
767
return filename ;
765
768
}
766
769
767
- #if ZEND_MODULE_API_NO < 20170718 /* PHP 7.1 - 7.2 */
770
+ #if PHP_VERSION_ID < 70200 /* PHP 7.1 */
768
771
static void memprof_zend_error_cb (int type , const char * error_filename , const uint error_lineno , const char * format , va_list args )
769
- #elif ZEND_MODULE_API_NO < 20200930 /* PHP 7.3 - 7.4 */
772
+ #elif PHP_VERSION_ID < 80000 /* PHP 7.2 - 7.4 */
770
773
static void memprof_zend_error_cb (int type , const char * error_filename , const uint32_t error_lineno , const char * format , va_list args )
771
- #else /* PHP 8 */
774
+ #elif PHP_VERSION_ID < 80100 /* PHP 8.0 */
772
775
static void memprof_zend_error_cb (int type , const char * error_filename , const uint32_t error_lineno , zend_string * message )
776
+ #else /* PHP 8.1 */
777
+ static void memprof_zend_error_cb (int type , zend_string * error_filename , const uint32_t error_lineno , zend_string * message )
773
778
#endif
774
779
{
775
780
char * filename ;
776
781
php_stream * stream ;
777
- #if ZEND_MODULE_API_NO < 20200930
782
+ #if PHP_VERSION_ID < 80000
778
783
const char * msg = format ;
779
784
#else
780
785
const char * msg = ZSTR_VAL (message );
0 commit comments