Skip to content

Commit e368916

Browse files
workaround to fixed removed SEPARATE_ZVAL_IF_NOT_REF method
1 parent b028a26 commit e368916

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

zend/macros.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Macros.h
3+
*
4+
* Some macros have changed or have been removed between PHP versions.
5+
* In this file we write custom versions of such macros to overcome that
6+
*
7+
* @author Emiel Bruijntjes <[email protected]>
8+
* @copyright 2023 Copernica BV
9+
*/
10+
11+
/**
12+
* Include guard
13+
*/
14+
#pragma once
15+
16+
/**
17+
* The "SEPARATE_ZVAL_IF_NOT_REF()" macro has been removed
18+
*/
19+
#ifndef SEPARATE_ZVAL_IF_NOT_REF
20+
#define SEPARATE_ZVAL_IF_NOT_REF(zv) do { \
21+
zval *_zv = (zv); \
22+
if (Z_TYPE_P(_zv) == IS_ARRAY) { \
23+
SEPARATE_ARRAY(_zv); \
24+
} \
25+
} while(0)
26+
#endif

zend/value.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "includes.h"
2828
#include "string.h"
2929
#include "lowercase.h"
30+
#include "macros.h"
3031

3132
/**
3233
* Set up namespace

0 commit comments

Comments
 (0)