@@ -29,11 +29,7 @@ nr_php_zend_hash_key_is_string(const zend_hash_key* hash_key) {
29
29
return 0 ;
30
30
}
31
31
32
- #ifdef PHP7
33
32
return (NULL != hash_key -> key );
34
- #else
35
- return ((NULL != hash_key -> arKey ) && (0 != hash_key -> nKeyLength ));
36
- #endif /* PHP7 */
37
33
}
38
34
39
35
static inline int NRPURE
@@ -56,11 +52,7 @@ nr_php_zend_hash_key_string_len(const zend_hash_key* hash_key) {
56
52
return 0 ;
57
53
}
58
54
59
- #ifdef PHP7
60
55
return hash_key -> key ? hash_key -> key -> len : 0 ;
61
- #else
62
- return (nr_string_len_t )NRSAFELEN (hash_key -> nKeyLength );
63
- #endif
64
56
}
65
57
66
58
static inline const char * NRPURE
@@ -69,11 +61,7 @@ nr_php_zend_hash_key_string_value(const zend_hash_key* hash_key) {
69
61
return NULL ;
70
62
}
71
63
72
- #ifdef PHP7
73
64
return hash_key -> key ? hash_key -> key -> val : NULL ;
74
- #else
75
- return hash_key -> arKey ;
76
- #endif
77
65
}
78
66
79
67
/*
@@ -84,7 +72,6 @@ nr_php_zend_hash_key_string_value(const zend_hash_key* hash_key) {
84
72
* Strings will always be duplicated, since that's non-optional in
85
73
* PHP 7 anyway.
86
74
*/
87
- #ifdef PHP7
88
75
#define nr_php_add_assoc_string (ht , key , str ) \
89
76
add_assoc_string((ht), (key), (str))
90
77
@@ -95,19 +82,6 @@ nr_php_zend_hash_key_string_value(const zend_hash_key* hash_key) {
95
82
96
83
#define nr_php_add_next_index_stringl (ht , str , strlen ) \
97
84
add_next_index_stringl((ht), (str), (strlen))
98
- #else
99
- #define nr_php_add_assoc_string (ht , key , str ) \
100
- add_assoc_string((ht), (key), (str), 1)
101
-
102
- #define nr_php_add_assoc_stringl (ht , key , str , strlen ) \
103
- add_assoc_stringl((ht), (key), (str), (strlen), 1)
104
-
105
- #define nr_php_add_next_index_string (ht , str ) \
106
- add_next_index_string((ht), (str), 1)
107
-
108
- #define nr_php_add_next_index_stringl (ht , str , strlen ) \
109
- add_next_index_stringl((ht), (str), (strlen), 1)
110
- #endif /* PHP7 */
111
85
112
86
/*
113
87
* Purpose : Wrap add_assoc_zval to ensure consistent ownership behaviour.
@@ -164,28 +138,11 @@ static inline int nr_php_add_assoc_zval(zval* arr,
164
138
static inline int nr_php_add_index_zval (zval * arr ,
165
139
zend_ulong index ,
166
140
zval * value ) {
167
- #ifdef PHP7
168
141
zval copy ;
169
142
170
143
ZVAL_DUP (& copy , value );
171
144
172
145
return add_index_zval (arr , index , & copy );
173
- #else
174
- zval * copy ;
175
-
176
- ALLOC_ZVAL (copy );
177
- INIT_PZVAL (copy );
178
-
179
- /*
180
- * When we drop support for PHP 5.3, we can just use ZVAL_COPY_VALUE here.
181
- */
182
- copy -> value = value -> value ;
183
- Z_TYPE_P (copy ) = Z_TYPE_P (value );
184
-
185
- zval_copy_ctor (copy );
186
-
187
- return add_index_zval (arr , index , copy );
188
- #endif /* PHP7 */
189
146
}
190
147
191
148
typedef int (* nr_php_ptr_apply_t )(void * value ,
0 commit comments