php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
zend_operators.h
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
5 | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 2.00 of the Zend license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.zend.com/license/2_00.txt. |
11 | If you did not receive a copy of the Zend license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@zend.com so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Authors: Andi Gutmans <andi@php.net> |
16 | Zeev Suraski <zeev@php.net> |
17 | Dmitry Stogov <dmitry@php.net> |
18 +----------------------------------------------------------------------+
19*/
20
21#ifndef ZEND_OPERATORS_H
22#define ZEND_OPERATORS_H
23
24#include <errno.h>
25#include <math.h>
26#include <assert.h>
27#include <stddef.h>
28#include <stdint.h>
29
30#ifdef HAVE_IEEEFP_H
38# if __has_feature(undefined_behavior_sanitizer) && defined(__FreeBSD__) && defined(__clang__)
39# pragma clang attribute push (__attribute__((no_sanitize("undefined"))), apply_to=function)
40# endif
41# include <ieeefp.h>
42# if __has_feature(undefined_behavior_sanitizer) && defined(__FreeBSD__) && defined(__clang__)
43# pragma clang attribute pop
44# endif
45#endif
46
47#include "zend_portability.h"
48#include "zend_strtod.h"
49#include "zend_multiply.h"
51
52#define LONG_SIGN_MASK ZEND_LONG_MIN
53
70
72
79
82
83static zend_always_inline bool instanceof_function(
84 const zend_class_entry *instance_ce, const zend_class_entry *ce) {
85 return instance_ce == ce || instanceof_function_slow(instance_ce, ce);
86}
87
89
105ZEND_API uint8_t ZEND_FASTCALL _is_numeric_string_ex(const char *str, size_t length, zend_long *lval,
106 double *dval, bool allow_errors, int *oflow_info, bool *trailing_data);
107
108ZEND_API const char* ZEND_FASTCALL zend_memnstr_ex(const char *haystack, const char *needle, size_t needle_len, const char *end);
109ZEND_API const char* ZEND_FASTCALL zend_memnrstr_ex(const char *haystack, const char *needle, size_t needle_len, const char *end);
110
111#if SIZEOF_ZEND_LONG == 4
112# define ZEND_DOUBLE_FITS_LONG(d) (!((d) > (double)ZEND_LONG_MAX || (d) < (double)ZEND_LONG_MIN))
113#else
114 /* >= as (double)ZEND_LONG_MAX is outside signed range */
115# define ZEND_DOUBLE_FITS_LONG(d) (!((d) >= (double)ZEND_LONG_MAX || (d) < (double)ZEND_LONG_MIN))
116#endif
117
119
120static zend_always_inline zend_long zend_dval_to_lval(double d)
121{
123 return 0;
124 } else if (!ZEND_DOUBLE_FITS_LONG(d)) {
125 return zend_dval_to_lval_slow(d);
126 }
127 return (zend_long)d;
128}
129
130/* Used to convert a string float to integer during an (int) cast */
131static zend_always_inline zend_long zend_dval_to_lval_cap(double d)
132{
134 return 0;
135 } else if (!ZEND_DOUBLE_FITS_LONG(d)) {
136 return (d > 0 ? ZEND_LONG_MAX : ZEND_LONG_MIN);
137 }
138 return (zend_long)d;
139}
140/* }}} */
141
142static zend_always_inline bool zend_is_long_compatible(double d, zend_long l) {
143 return (double)l == d;
144}
145
148
149static zend_always_inline zend_long zend_dval_to_lval_safe(double d)
150{
151 zend_long l = zend_dval_to_lval(d);
152 if (!zend_is_long_compatible(d, l)) {
154 }
155 return l;
156}
157
158#define ZEND_IS_DIGIT(c) ((c) >= '0' && (c) <= '9')
159#define ZEND_IS_XDIGIT(c) (((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f'))
160
161static zend_always_inline uint8_t is_numeric_string_ex(const char *str, size_t length, zend_long *lval,
162 double *dval, bool allow_errors, int *oflow_info, bool *trailing_data)
163{
164 if (*str > '9') {
165 return 0;
166 }
167 return _is_numeric_string_ex(str, length, lval, dval, allow_errors, oflow_info, trailing_data);
168}
169
170static zend_always_inline uint8_t is_numeric_string(const char *str, size_t length, zend_long *lval, double *dval, bool allow_errors) {
171 return is_numeric_string_ex(str, length, lval, dval, allow_errors, NULL, NULL);
172}
173
174ZEND_API uint8_t ZEND_FASTCALL is_numeric_str_function(const zend_string *str, zend_long *lval, double *dval);
175
176static zend_always_inline const char *
177zend_memnstr(const char *haystack, const char *needle, size_t needle_len, const char *end)
178{
179 const char *p = haystack;
180 size_t off_s;
181
182 ZEND_ASSERT(end >= p);
183
184 if (needle_len == 1) {
185 return (const char *)memchr(p, *needle, (end-p));
186 } else if (UNEXPECTED(needle_len == 0)) {
187 return p;
188 }
189
190 off_s = (size_t)(end - p);
191
192 if (needle_len > off_s) {
193 return NULL;
194 }
195
196 if (EXPECTED(off_s < 1024 || needle_len < 9)) { /* glibc memchr is faster when needle is too short */
197 const char ne = needle[needle_len-1];
198 end -= needle_len;
199
200 while (p <= end) {
201 if ((p = (const char *)memchr(p, *needle, (end-p+1)))) {
202 if (ne == p[needle_len-1] && !memcmp(needle+1, p+1, needle_len-2)) {
203 return p;
204 }
205 } else {
206 return NULL;
207 }
208 p++;
209 }
210
211 return NULL;
212 } else {
213 return zend_memnstr_ex(haystack, needle, needle_len, end);
214 }
215}
216
217static zend_always_inline const void *zend_memrchr(const void *s, int c, size_t n)
218{
219#if defined(HAVE_MEMRCHR) && !defined(i386)
220 /* On x86 memrchr() doesn't use SSE/AVX, so inlined version is faster */
221 return (const void*)memrchr(s, c, n);
222#else
223 const unsigned char *e;
224 if (0 == n) {
225 return NULL;
226 }
227
228 for (e = (const unsigned char *)s + n - 1; e >= (const unsigned char *)s; e--) {
229 if (*e == (unsigned char)c) {
230 return (const void *)e;
231 }
232 }
233 return NULL;
234#endif
235}
236
237
238static zend_always_inline const char *
239zend_memnrstr(const char *haystack, const char *needle, size_t needle_len, const char *end)
240{
241 const char *p = end;
242 ptrdiff_t off_p;
243 size_t off_s;
244
245 if (needle_len == 0) {
246 return p;
247 }
248
249 if (needle_len == 1) {
250 return (const char *)zend_memrchr(haystack, *needle, (p - haystack));
251 }
252
253 off_p = end - haystack;
254 off_s = (off_p > 0) ? (size_t)off_p : 0;
255
256 if (needle_len > off_s) {
257 return NULL;
258 }
259
260 if (EXPECTED(off_s < 1024 || needle_len < 3)) {
261 const char ne = needle[needle_len-1];
262 p -= needle_len;
263
264 do {
265 p = (const char *)zend_memrchr(haystack, *needle, (p - haystack) + 1);
266 if (!p) {
267 return NULL;
268 }
269 if (ne == p[needle_len-1] && !memcmp(needle + 1, p + 1, needle_len - 2)) {
270 return p;
271 }
272 } while (p-- >= haystack);
273
274 return NULL;
275 } else {
276 return zend_memnrstr_ex(haystack, needle, needle_len, end);
277 }
278}
279
280static zend_always_inline size_t zend_strnlen(const char* s, size_t maxlen)
281{
282#if defined(HAVE_STRNLEN)
283 return strnlen(s, maxlen);
284#else
285 const char *p = (const char *)memchr(s, '\0', maxlen);
286 return p ? p-s : maxlen;
287#endif
288}
289
290static zend_always_inline void *zend_mempcpy(void *dest, const void *src, size_t n)
291{
292#if defined(HAVE_MEMPCPY)
293 return mempcpy(dest, src, n);
294#else
295 return (char *)memcpy(dest, src, n) + n;
296#endif
297}
298
301
310
311ZEND_API zend_long ZEND_FASTCALL zval_get_long_func(const zval *op, bool is_strict);
312ZEND_API zend_long ZEND_FASTCALL zval_try_get_long(const zval *op, bool *failed);
316
317static zend_always_inline zend_long zval_get_long(const zval *op) {
318 return EXPECTED(Z_TYPE_P(op) == IS_LONG) ? Z_LVAL_P(op) : zval_get_long_func(op, false);
319}
320static zend_always_inline zend_long zval_get_long_ex(const zval *op, bool is_strict) {
321 return EXPECTED(Z_TYPE_P(op) == IS_LONG) ? Z_LVAL_P(op) : zval_get_long_func(op, is_strict);
322}
323static zend_always_inline double zval_get_double(const zval *op) {
324 return EXPECTED(Z_TYPE_P(op) == IS_DOUBLE) ? Z_DVAL_P(op) : zval_get_double_func(op);
325}
326static zend_always_inline zend_string *zval_get_string(zval *op) {
327 return EXPECTED(Z_TYPE_P(op) == IS_STRING) ? zend_string_copy(Z_STR_P(op)) : zval_get_string_func(op);
328}
329
330static zend_always_inline zend_string *zval_get_tmp_string(zval *op, zend_string **tmp) {
331 if (EXPECTED(Z_TYPE_P(op) == IS_STRING)) {
332 *tmp = NULL;
333 return Z_STR_P(op);
334 } else {
335 return *tmp = zval_get_string_func(op);
336 }
337}
338static zend_always_inline void zend_tmp_string_release(zend_string *tmp) {
339 if (UNEXPECTED(tmp)) {
341 }
342}
343
344/* Like zval_get_string, but returns NULL if the conversion fails with an exception. */
345static zend_always_inline zend_string *zval_try_get_string(zval *op) {
346 if (EXPECTED(Z_TYPE_P(op) == IS_STRING)) {
347 zend_string *ret = zend_string_copy(Z_STR_P(op));
348 ZEND_ASSUME(ret != NULL);
349 return ret;
350 } else {
351 return zval_try_get_string_func(op);
352 }
353}
354
355/* Like zval_get_tmp_string, but returns NULL if the conversion fails with an exception. */
356static zend_always_inline zend_string *zval_try_get_tmp_string(zval *op, zend_string **tmp) {
357 if (EXPECTED(Z_TYPE_P(op) == IS_STRING)) {
358 zend_string *ret = Z_STR_P(op);
359 *tmp = NULL;
360 ZEND_ASSUME(ret != NULL);
361 return ret;
362 } else {
363 return *tmp = zval_try_get_string_func(op);
364 }
365}
366
367/* Like convert_to_string(), but returns whether the conversion succeeded and does not modify the
368 * zval in-place if it fails. */
370static zend_always_inline bool try_convert_to_string(zval *op) {
371 if (Z_TYPE_P(op) == IS_STRING) {
372 return 1;
373 }
374 return _try_convert_to_string(op);
375}
376
377/* Compatibility macros for 7.2 and below */
378#define _zval_get_long(op) zval_get_long(op)
379#define _zval_get_double(op) zval_get_double(op)
380#define _zval_get_string(op) zval_get_string(op)
381#define _zval_get_long_func(op) zval_get_long_func(op)
382#define _zval_get_double_func(op) zval_get_double_func(op)
383#define _zval_get_string_func(op) zval_get_string_func(op)
384
385#define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op)); }
386
387
390
391#define zval_is_true(op) \
392 zend_is_true(op)
393
394static zend_always_inline bool i_zend_is_true(const zval *op)
395{
396 bool result = 0;
397
398again:
399 switch (Z_TYPE_P(op)) {
400 case IS_TRUE:
401 result = 1;
402 break;
403 case IS_LONG:
404 if (Z_LVAL_P(op)) {
405 result = 1;
406 }
407 break;
408 case IS_DOUBLE:
409 if (Z_DVAL_P(op)) {
410 result = 1;
411 }
412 break;
413 case IS_STRING:
414 if (Z_STRLEN_P(op) > 1 || (Z_STRLEN_P(op) && Z_STRVAL_P(op)[0] != '0')) {
415 result = 1;
416 }
417 break;
418 case IS_ARRAY:
419 if (zend_hash_num_elements(Z_ARRVAL_P(op))) {
420 result = 1;
421 }
422 break;
423 case IS_OBJECT:
424 if (EXPECTED(Z_OBJ_HT_P(op)->cast_object == zend_std_cast_object_tostring)) {
425 result = 1;
426 } else {
428 }
429 break;
430 case IS_RESOURCE:
431 if (EXPECTED(Z_RES_HANDLE_P(op))) {
432 result = 1;
433 }
434 break;
435 case IS_REFERENCE:
436 op = Z_REFVAL_P(op);
437 goto again;
438 break;
439 default:
440 break;
441 }
442 return result;
443}
444
445/* Indicate that two values cannot be compared. This value should be returned for both orderings
446 * of the operands. This implies that all of ==, <, <= and >, >= will return false, because we
447 * canonicalize >/>= to </<= with swapped operands. */
448// TODO: Use a different value to allow an actual distinction here.
449#define ZEND_UNCOMPARABLE 1
450
452
454
456ZEND_API int ZEND_FASTCALL string_compare_function_ex(zval *op1, zval *op2, bool case_insensitive);
460
461ZEND_API extern const unsigned char zend_tolower_map[256];
462ZEND_API extern const unsigned char zend_toupper_map[256];
463
464#define zend_tolower_ascii(c) (zend_tolower_map[(unsigned char)(c)])
465#define zend_toupper_ascii(c) (zend_toupper_map[(unsigned char)(c)])
466
467ZEND_API void ZEND_FASTCALL zend_str_tolower(char *str, size_t length);
468ZEND_API void ZEND_FASTCALL zend_str_toupper(char *str, size_t length);
469ZEND_API char* ZEND_FASTCALL zend_str_tolower_copy(char *dest, const char *source, size_t length);
470ZEND_API char* ZEND_FASTCALL zend_str_toupper_copy(char *dest, const char *source, size_t length);
471ZEND_API char* ZEND_FASTCALL zend_str_tolower_dup(const char *source, size_t length);
472ZEND_API char* ZEND_FASTCALL zend_str_toupper_dup(const char *source, size_t length);
473ZEND_API char* ZEND_FASTCALL zend_str_tolower_dup_ex(const char *source, size_t length);
474ZEND_API char* ZEND_FASTCALL zend_str_toupper_dup_ex(const char *source, size_t length);
477
478static zend_always_inline zend_string* zend_string_tolower(zend_string *str) {
479 return zend_string_tolower_ex(str, false);
480}
481static zend_always_inline zend_string* zend_string_toupper(zend_string *str) {
482 return zend_string_toupper_ex(str, false);
483}
484
487ZEND_API int ZEND_FASTCALL zend_binary_strcmp(const char *s1, size_t len1, const char *s2, size_t len2);
488ZEND_API int ZEND_FASTCALL zend_binary_strncmp(const char *s1, size_t len1, const char *s2, size_t len2, size_t length);
489ZEND_API int ZEND_FASTCALL zend_binary_strcasecmp(const char *s1, size_t len1, const char *s2, size_t len2);
490ZEND_API int ZEND_FASTCALL zend_binary_strncasecmp(const char *s1, size_t len1, const char *s2, size_t len2, size_t length);
491ZEND_API int ZEND_FASTCALL zend_binary_strcasecmp_l(const char *s1, size_t len1, const char *s2, size_t len2);
492ZEND_API int ZEND_FASTCALL zend_binary_strncasecmp_l(const char *s1, size_t len1, const char *s2, size_t len2, size_t length);
493
499
501ZEND_ATTRIBUTE_DEPRECATED ZEND_API int ZEND_FASTCALL zend_atoi(const char *str, size_t str_len);
502
505
506#define convert_to_null_ex(zv) convert_to_null(zv)
507#define convert_to_boolean_ex(zv) convert_to_boolean(zv)
508#define convert_to_long_ex(zv) convert_to_long(zv)
509#define convert_to_double_ex(zv) convert_to_double(zv)
510#define convert_to_string_ex(zv) convert_to_string(zv)
511#define convert_to_array_ex(zv) convert_to_array(zv)
512#define convert_to_object_ex(zv) convert_to_object(zv)
513#define convert_scalar_to_number_ex(zv) convert_scalar_to_number(zv)
514
516
518
519/* The offset in bytes between the value and type fields of a zval */
520#define ZVAL_OFFSETOF_TYPE \
521 (offsetof(zval, u1.type_info) - offsetof(zval, value))
522
523#if defined(HAVE_ASM_GOTO) && !__has_feature(memory_sanitizer)
524# define ZEND_USE_ASM_ARITHMETIC 1
525#else
526# define ZEND_USE_ASM_ARITHMETIC 0
527#endif
528
529static zend_always_inline void fast_long_increment_function(zval *op1)
530{
531#if ZEND_USE_ASM_ARITHMETIC && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
532 __asm__ goto(
533 "addl $1,(%0)\n\t"
534 "jo %l1\n"
535 :
536 : "r"(&op1->value)
537 : "cc", "memory"
538 : overflow);
539 return;
541 ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0);
542#elif ZEND_USE_ASM_ARITHMETIC && defined(__x86_64__)
543 __asm__ goto(
544 "addq $1,(%0)\n\t"
545 "jo %l1\n"
546 :
547 : "r"(&op1->value)
548 : "cc", "memory"
549 : overflow);
550 return;
552 ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0);
553#elif ZEND_USE_ASM_ARITHMETIC && defined(__aarch64__)
554 __asm__ goto (
555 "ldr x5, [%0]\n\t"
556 "adds x5, x5, 1\n\t"
557 "bvs %l1\n"
558 "str x5, [%0]"
559 :
560 : "r"(&op1->value)
561 : "x5", "cc", "memory"
562 : overflow);
563 return;
565 ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0);
566#elif defined(PHP_HAVE_BUILTIN_SADDL_OVERFLOW) && SIZEOF_LONG == SIZEOF_ZEND_LONG
567 long lresult;
568 if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), 1, &lresult))) {
569 /* switch to double */
570 ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0);
571 } else {
572 Z_LVAL_P(op1) = lresult;
573 }
574#elif defined(PHP_HAVE_BUILTIN_SADDLL_OVERFLOW) && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG
575 long long llresult;
576 if (UNEXPECTED(__builtin_saddll_overflow(Z_LVAL_P(op1), 1, &llresult))) {
577 /* switch to double */
578 ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0);
579 } else {
580 Z_LVAL_P(op1) = llresult;
581 }
582#else
584 /* switch to double */
585 ZVAL_DOUBLE(op1, (double)ZEND_LONG_MAX + 1.0);
586 } else {
587 Z_LVAL_P(op1)++;
588 }
589#endif
590}
591
592static zend_always_inline void fast_long_decrement_function(zval *op1)
593{
594#if ZEND_USE_ASM_ARITHMETIC && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
595 __asm__ goto(
596 "subl $1,(%0)\n\t"
597 "jo %l1\n"
598 :
599 : "r"(&op1->value)
600 : "cc", "memory"
601 : overflow);
602 return;
604 ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0);
605#elif ZEND_USE_ASM_ARITHMETIC && defined(__x86_64__)
606 __asm__ goto(
607 "subq $1,(%0)\n\t"
608 "jo %l1\n"
609 :
610 : "r"(&op1->value)
611 : "cc", "memory"
612 : overflow);
613 return;
615 ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0);
616#elif ZEND_USE_ASM_ARITHMETIC && defined(__aarch64__)
617 __asm__ goto (
618 "ldr x5, [%0]\n\t"
619 "subs x5 ,x5, 1\n\t"
620 "bvs %l1\n"
621 "str x5, [%0]"
622 :
623 : "r"(&op1->value)
624 : "x5", "cc", "memory"
625 : overflow);
626 return;
628 ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0);
629#elif defined(PHP_HAVE_BUILTIN_SSUBL_OVERFLOW) && SIZEOF_LONG == SIZEOF_ZEND_LONG
630 long lresult;
631 if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), 1, &lresult))) {
632 /* switch to double */
633 ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0);
634 } else {
635 Z_LVAL_P(op1) = lresult;
636 }
637#elif defined(PHP_HAVE_BUILTIN_SSUBLL_OVERFLOW) && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG
638 long long llresult;
639 if (UNEXPECTED(__builtin_ssubll_overflow(Z_LVAL_P(op1), 1, &llresult))) {
640 /* switch to double */
641 ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0);
642 } else {
643 Z_LVAL_P(op1) = llresult;
644 }
645#else
647 /* switch to double */
648 ZVAL_DOUBLE(op1, (double)ZEND_LONG_MIN - 1.0);
649 } else {
650 Z_LVAL_P(op1)--;
651 }
652#endif
653}
654
655static zend_always_inline void fast_long_add_function(zval *result, zval *op1, zval *op2)
656{
657#if ZEND_USE_ASM_ARITHMETIC && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
658 __asm__ goto(
659 "movl (%1), %%eax\n\t"
660 "addl (%2), %%eax\n\t"
661 "jo %l5\n\t"
662 "movl %%eax, (%0)\n\t"
663 "movl %3, %c4(%0)\n"
664 :
665 : "r"(&result->value),
666 "r"(&op1->value),
667 "r"(&op2->value),
668 "n"(IS_LONG),
670 : "eax","cc", "memory"
671 : overflow);
672 return;
674 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2));
675#elif ZEND_USE_ASM_ARITHMETIC && defined(__x86_64__)
676 __asm__ goto(
677 "movq (%1), %%rax\n\t"
678 "addq (%2), %%rax\n\t"
679 "jo %l5\n\t"
680 "movq %%rax, (%0)\n\t"
681 "movl %3, %c4(%0)\n"
682 :
683 : "r"(&result->value),
684 "r"(&op1->value),
685 "r"(&op2->value),
686 "n"(IS_LONG),
688 : "rax","cc", "memory"
689 : overflow);
690 return;
692 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2));
693#elif ZEND_USE_ASM_ARITHMETIC && defined(__aarch64__)
694 __asm__ goto(
695 "ldr x5, [%1]\n\t"
696 "ldr x6, [%2]\n\t"
697 "adds x5, x5, x6\n\t"
698 "bvs %l5\n\t"
699 "mov w6, %3\n\t"
700 "str x5, [%0]\n\t"
701 "str w6, [%0, %c4]\n"
702 :
703 : "r"(&result->value),
704 "r"(&op1->value),
705 "r"(&op2->value),
706 "n"(IS_LONG),
708 : "x5", "x6", "cc", "memory"
709 : overflow);
710 return;
712 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2));
713#elif defined(PHP_HAVE_BUILTIN_SADDL_OVERFLOW) && SIZEOF_LONG == SIZEOF_ZEND_LONG
714 long lresult;
715 if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) {
716 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2));
717 } else {
718 ZVAL_LONG(result, lresult);
719 }
720#elif defined(PHP_HAVE_BUILTIN_SADDLL_OVERFLOW) && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG
721 long long llresult;
722 if (UNEXPECTED(__builtin_saddll_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &llresult))) {
723 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2));
724 } else {
725 ZVAL_LONG(result, llresult);
726 }
727#else
728 /*
729 * 'result' may alias with op1 or op2, so we need to
730 * ensure that 'result' is not updated until after we
731 * have read the values of op1 and op2.
732 */
733
735
737 && (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (sum & LONG_SIGN_MASK))) {
738 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2));
739 } else {
740 ZVAL_LONG(result, sum);
741 }
742#endif
743}
744
745static zend_always_inline void fast_long_sub_function(zval *result, zval *op1, zval *op2)
746{
747#if ZEND_USE_ASM_ARITHMETIC && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
748 __asm__ goto(
749 "movl (%1), %%eax\n\t"
750 "subl (%2), %%eax\n\t"
751 "jo %l5\n\t"
752 "movl %%eax, (%0)\n\t"
753 "movl %3, %c4(%0)\n"
754 :
755 : "r"(&result->value),
756 "r"(&op1->value),
757 "r"(&op2->value),
758 "n"(IS_LONG),
760 : "eax","cc", "memory"
761 : overflow);
762 return;
764 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2));
765#elif ZEND_USE_ASM_ARITHMETIC && defined(__x86_64__)
766 __asm__ goto(
767 "movq (%1), %%rax\n\t"
768 "subq (%2), %%rax\n\t"
769 "jo %l5\n\t"
770 "movq %%rax, (%0)\n\t"
771 "movl %3, %c4(%0)\n"
772 :
773 : "r"(&result->value),
774 "r"(&op1->value),
775 "r"(&op2->value),
776 "n"(IS_LONG),
778 : "rax","cc", "memory"
779 : overflow);
780 return;
782 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2));
783#elif ZEND_USE_ASM_ARITHMETIC && defined(__aarch64__)
784 __asm__ goto(
785 "ldr x5, [%1]\n\t"
786 "ldr x6, [%2]\n\t"
787 "subs x5, x5, x6\n\t"
788 "bvs %l5\n\t"
789 "mov w6, %3\n\t"
790 "str x5, [%0]\n\t"
791 "str w6, [%0, %c4]\n"
792 :
793 : "r"(&result->value),
794 "r"(&op1->value),
795 "r"(&op2->value),
796 "n"(IS_LONG),
798 : "x5", "x6", "cc", "memory"
799 : overflow);
800 return;
802 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2));
803#elif defined(PHP_HAVE_BUILTIN_SSUBL_OVERFLOW) && SIZEOF_LONG == SIZEOF_ZEND_LONG
804 long lresult;
805 if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) {
806 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2));
807 } else {
808 ZVAL_LONG(result, lresult);
809 }
810#elif defined(PHP_HAVE_BUILTIN_SSUBLL_OVERFLOW) && SIZEOF_LONG_LONG == SIZEOF_ZEND_LONG
811 long long llresult;
812 if (UNEXPECTED(__builtin_ssubll_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &llresult))) {
813 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2));
814 } else {
815 ZVAL_LONG(result, llresult);
816 }
817#else
818 /*
819 * 'result' may alias with op1 or op2, so we need to
820 * ensure that 'result' is not updated until after we
821 * have read the values of op1 and op2.
822 */
823
825
827 && (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (sub & LONG_SIGN_MASK))) {
828 ZVAL_DOUBLE(result, (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2));
829 } else {
830 ZVAL_LONG(result, sub);
831 }
832#endif
833}
834
835static zend_always_inline bool zend_fast_equal_strings(zend_string *s1, zend_string *s2)
836{
837 if (s1 == s2) {
838 return 1;
839 } else if (ZSTR_VAL(s1)[0] > '9' || ZSTR_VAL(s2)[0] > '9') {
840 return zend_string_equal_content(s1, s2);
841 } else {
842 return zendi_smart_streq(s1, s2);
843 }
844}
845
846static zend_always_inline bool fast_equal_check_function(zval *op1, zval *op2)
847{
848 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
849 if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
850 return Z_LVAL_P(op1) == Z_LVAL_P(op2);
851 } else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
852 return ((double)Z_LVAL_P(op1)) == Z_DVAL_P(op2);
853 }
854 } else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
855 if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
856 return Z_DVAL_P(op1) == Z_DVAL_P(op2);
857 } else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
858 return Z_DVAL_P(op1) == ((double)Z_LVAL_P(op2));
859 }
860 } else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
861 if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
862 return zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
863 }
864 }
865 return zend_compare(op1, op2) == 0;
866}
867
868static zend_always_inline bool fast_equal_check_long(zval *op1, zval *op2)
869{
870 if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
871 return Z_LVAL_P(op1) == Z_LVAL_P(op2);
872 }
873 return zend_compare(op1, op2) == 0;
874}
875
876static zend_always_inline bool fast_equal_check_string(zval *op1, zval *op2)
877{
878 if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
879 return zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
880 }
881 return zend_compare(op1, op2) == 0;
882}
883
884static zend_always_inline bool fast_is_identical_function(zval *op1, zval *op2)
885{
886 if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) {
887 return 0;
888 } else if (Z_TYPE_P(op1) <= IS_TRUE) {
889 return 1;
890 }
891 return zend_is_identical(op1, op2);
892}
893
894static zend_always_inline bool fast_is_not_identical_function(zval *op1, zval *op2)
895{
896 if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) {
897 return 1;
898 } else if (Z_TYPE_P(op1) <= IS_TRUE) {
899 return 0;
900 }
901 return !zend_is_identical(op1, op2);
902}
903
904/* buf points to the END of the buffer */
905static zend_always_inline char *zend_print_ulong_to_buf(char *buf, zend_ulong num) {
906 *buf = '\0';
907 do {
908 *--buf = (char) (num % 10) + '0';
909 num /= 10;
910 } while (num > 0);
911 return buf;
912}
913
914/* buf points to the END of the buffer */
915static zend_always_inline char *zend_print_long_to_buf(char *buf, zend_long num) {
916 if (num < 0) {
917 char *result = zend_print_ulong_to_buf(buf, ~((zend_ulong) num) + 1);
918 *--result = '-';
919 return result;
920 } else {
921 return zend_print_ulong_to_buf(buf, num);
922 }
923}
924
930
931static zend_always_inline void zend_unwrap_reference(zval *op) /* {{{ */
932{
933 if (Z_REFCOUNT_P(op) == 1) {
934 ZVAL_UNREF(op);
935 } else {
936 Z_DELREF_P(op);
937 ZVAL_COPY(op, Z_REFVAL_P(op));
938 }
939}
940/* }}} */
941
942static zend_always_inline bool zend_strnieq(const char *ptr1, const char *ptr2, size_t num)
943{
944 const char *end = ptr1 + num;
945 while (ptr1 < end) {
947 return 0;
948 }
949 }
950 return 1;
951}
952
953static zend_always_inline const char *
954zend_memnistr(const char *haystack, const char *needle, size_t needle_len, const char *end)
955{
956 ZEND_ASSERT(end >= haystack);
957
958 if (UNEXPECTED(needle_len == 0)) {
959 return haystack;
960 }
961
962 if (UNEXPECTED(needle_len > (size_t)(end - haystack))) {
963 return NULL;
964 }
965
966 const char first_lower = zend_tolower_ascii(*needle);
967 const char first_upper = zend_toupper_ascii(*needle);
968 const char *p_lower = (const char *)memchr(haystack, first_lower, end - haystack);
969 const char *p_upper = NULL;
970 if (first_lower != first_upper) {
971 // If the needle length is 1 we don't need to look beyond p_lower as it is a guaranteed match
972 size_t upper_search_length = needle_len == 1 && p_lower != NULL ? p_lower - haystack : end - haystack;
973 p_upper = (const char *)memchr(haystack, first_upper, upper_search_length);
974 }
975 const char *p = !p_upper || (p_lower && p_lower < p_upper) ? p_lower : p_upper;
976
977 if (needle_len == 1) {
978 return p;
979 }
980
981 const char needle_end_lower = zend_tolower_ascii(needle[needle_len - 1]);
982 const char needle_end_upper = zend_toupper_ascii(needle[needle_len - 1]);
983 end -= needle_len;
984
985 while (p && p <= end) {
986 if (needle_end_lower == p[needle_len - 1] || needle_end_upper == p[needle_len - 1]) {
987 if (zend_strnieq(needle + 1, p + 1, needle_len - 2)) {
988 return p;
989 }
990 }
991 if (p_lower == p) {
992 p_lower = (const char *)memchr(p_lower + 1, first_lower, end - p_lower);
993 }
994 if (p_upper == p) {
995 p_upper = (const char *)memchr(p_upper + 1, first_upper, end - p_upper);
996 }
997 p = !p_upper || (p_lower && p_lower < p_upper) ? p_lower : p_upper;
998 }
999
1000 return NULL;
1001}
1002
1003
1005
1006#endif
char s[4]
Definition cdf.c:77
zend_long ptrdiff_t
zend_long n
Definition ffi.c:4979
void * ptr1
Definition ffi.c:4449
void * ptr2
Definition ffi.c:4449
memcpy(ptr1, ptr2, size)
ffi persistent
Definition ffi.c:3633
zend_ffi_ctype_name_buf buf
Definition ffi.c:4685
zend_long maxlen
#define NULL
Definition gdcache.h:45
unsigned const char * end
Definition php_ffi.h:51
p
Definition session.c:1105
struct _zval_struct zval
zend_string_release_ex(func->internal_function.function_name, 0)
#define ZEND_API
int32_t zend_long
Definition zend_long.h:42
#define ZEND_LONG_MIN
Definition zend_long.h:46
uint32_t zend_ulong
Definition zend_long.h:43
#define ZEND_LONG_MAX
Definition zend_long.h:45
struct _zend_string zend_string
ZEND_API zend_result zend_std_cast_object_tostring(zend_object *readobj, zval *writeobj, int type)
ZEND_API const unsigned char zend_tolower_map[256]
ZEND_API bool ZEND_FASTCALL zend_is_identical(const zval *op1, const zval *op2)
ZEND_API const unsigned char zend_toupper_map[256]
ZEND_API zend_result ZEND_FASTCALL boolean_not_function(zval *result, zval *op1)
ZEND_API zend_result ZEND_FASTCALL is_not_identical_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL shift_right_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL boolean_xor_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL bitwise_not_function(zval *result, zval *op1)
ZEND_API zend_result ZEND_FASTCALL mod_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL mul_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL shift_left_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL is_equal_function(zval *result, zval *op1, zval *op2)
ZEND_API bool ZEND_FASTCALL instanceof_function_slow(const zend_class_entry *instance_ce, const zend_class_entry *ce)
ZEND_API zend_result ZEND_FASTCALL is_not_equal_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_long ZEND_FASTCALL zval_get_long_func(const zval *op, bool is_strict)
ZEND_API zend_result ZEND_FASTCALL bitwise_xor_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL bitwise_and_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL bitwise_or_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL add_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL sub_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL is_smaller_function(zval *result, zval *op1, zval *op2)
ZEND_API double ZEND_FASTCALL zval_get_double_func(const zval *op)
ZEND_API zend_string *ZEND_FASTCALL zval_get_string_func(zval *op)
ZEND_API zend_result ZEND_FASTCALL is_identical_function(zval *result, zval *op1, zval *op2)
ZEND_API bool ZEND_FASTCALL zend_class_implements_interface(const zend_class_entry *class_ce, const zend_class_entry *interface_ce)
ZEND_API zend_result ZEND_FASTCALL is_smaller_or_equal_function(zval *result, zval *op1, zval *op2)
ZEND_API zend_result ZEND_FASTCALL decrement_function(zval *op2)
ZEND_API int ZEND_FASTCALL zend_compare_arrays(zval *a1, zval *a2)
ZEND_API int ZEND_FASTCALL numeric_compare_function(zval *op1, zval *op2)
#define zend_toupper_ascii(c)
ZEND_API void zend_incompatible_string_to_long_error(const zend_string *s)
#define LONG_SIGN_MASK
ZEND_API zend_result ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2)
ZEND_API bool ZEND_FASTCALL zend_is_identical(const zval *op1, const zval *op2)
ZEND_API int ZEND_FASTCALL string_locale_compare_function(zval *op1, zval *op2)
ZEND_API int ZEND_FASTCALL string_compare_function_ex(zval *op1, zval *op2, bool case_insensitive)
ZEND_API int ZEND_FASTCALL zend_binary_strcasecmp(const char *s1, size_t len1, const char *s2, size_t len2)
ZEND_API zend_string *ZEND_FASTCALL zend_long_to_str(zend_long num)
ZEND_ATTRIBUTE_DEPRECATED ZEND_API zend_long ZEND_FASTCALL zend_atol(const char *str, size_t str_len)
ZEND_API const char *ZEND_FASTCALL zend_memnstr_ex(const char *haystack, const char *needle, size_t needle_len, const char *end)
#define ZVAL_OFFSETOF_TYPE
ZEND_API char *ZEND_FASTCALL zend_str_toupper_dup_ex(const char *source, size_t length)
ZEND_API bool ZEND_FASTCALL zend_object_is_true(const zval *op)
ZEND_API int ZEND_FASTCALL zend_binary_strncmp(const char *s1, size_t len1, const char *s2, size_t len2, size_t length)
ZEND_API void ZEND_FASTCALL convert_to_boolean(zval *op)
ZEND_API void ZEND_FASTCALL _convert_to_string(zval *op)
ZEND_API void ZEND_FASTCALL zend_str_toupper(char *str, size_t length)
ZEND_API int ZEND_FASTCALL zend_binary_strcmp(const char *s1, size_t len1, const char *s2, size_t len2)
ZEND_API bool zend_string_only_has_ascii_alphanumeric(const zend_string *str)
ZEND_API void ZEND_FASTCALL convert_to_array(zval *op)
ZEND_API char *ZEND_FASTCALL zend_str_tolower_copy(char *dest, const char *source, size_t length)
ZEND_API int ZEND_FASTCALL zend_compare(zval *op1, zval *op2)
ZEND_API zend_string *ZEND_FASTCALL zval_try_get_string_func(zval *op)
ZEND_API bool ZEND_FASTCALL _try_convert_to_string(zval *op)
ZEND_API bool ZEND_FASTCALL instanceof_function_slow(const zend_class_entry *instance_ce, const zend_class_entry *ce)
ZEND_API zend_long ZEND_FASTCALL zend_dval_to_lval_slow(double d)
ZEND_API int ZEND_FASTCALL zendi_smart_strcmp(zend_string *s1, zend_string *s2)
ZEND_API zend_string *ZEND_FASTCALL zend_u64_to_str(uint64_t num)
ZEND_API int ZEND_FASTCALL zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3)
ZEND_API char *ZEND_FASTCALL zend_str_tolower_dup_ex(const char *source, size_t length)
ZEND_API zend_string *ZEND_FASTCALL zend_string_tolower_ex(zend_string *str, bool persistent)
ZEND_API zend_string *ZEND_FASTCALL zend_i64_to_str(int64_t num)
ZEND_API zend_long ZEND_FASTCALL zval_get_long_func(const zval *op, bool is_strict)
ZEND_API const char *ZEND_FASTCALL zend_memnrstr_ex(const char *haystack, const char *needle, size_t needle_len, const char *end)
ZEND_API uint8_t ZEND_FASTCALL _is_numeric_string_ex(const char *str, size_t length, zend_long *lval, double *dval, bool allow_errors, int *oflow_info, bool *trailing_data)
ZEND_API void ZEND_FASTCALL convert_to_double(zval *op)
ZEND_API bool ZEND_FASTCALL zendi_smart_streq(zend_string *s1, zend_string *s2)
ZEND_ATTRIBUTE_DEPRECATED ZEND_API int ZEND_FASTCALL zend_atoi(const char *str, size_t str_len)
#define zend_tolower_ascii(c)
ZEND_API bool ZEND_FASTCALL zend_is_true(const zval *op)
ZEND_API void zend_incompatible_double_to_long_error(double d)
ZEND_API void ZEND_FASTCALL convert_to_object(zval *op)
ZEND_API zend_result ZEND_FASTCALL increment_function(zval *op1)
ZEND_API char *ZEND_FASTCALL zend_str_tolower_dup(const char *source, size_t length)
ZEND_API int ZEND_FASTCALL zend_compare_symbol_tables(HashTable *ht1, HashTable *ht2)
ZEND_API int ZEND_FASTCALL zend_binary_strncasecmp_l(const char *s1, size_t len1, const char *s2, size_t len2, size_t length)
ZEND_API int ZEND_FASTCALL zend_binary_zval_strcmp(zval *s1, zval *s2)
ZEND_API uint8_t ZEND_FASTCALL is_numeric_str_function(const zend_string *str, zend_long *lval, double *dval)
ZEND_API char *ZEND_FASTCALL zend_str_toupper_copy(char *dest, const char *source, size_t length)
ZEND_API void zend_reset_lc_ctype_locale(void)
ZEND_API int ZEND_FASTCALL string_compare_function(zval *op1, zval *op2)
ZEND_API int ZEND_FASTCALL string_case_compare_function(zval *op1, zval *op2)
ZEND_API zend_long ZEND_FASTCALL zval_try_get_long(const zval *op, bool *failed)
ZEND_API void zend_update_current_locale(void)
ZEND_API void ZEND_FASTCALL zend_str_tolower(char *str, size_t length)
ZEND_API double ZEND_FASTCALL zval_get_double_func(const zval *op)
ZEND_API zend_string *ZEND_FASTCALL zval_get_string_func(zval *op)
ZEND_API void ZEND_FASTCALL convert_to_null(zval *op)
#define ZEND_DOUBLE_FITS_LONG(d)
ZEND_API void ZEND_FASTCALL convert_scalar_to_number(zval *op)
ZEND_API zend_string *ZEND_FASTCALL zend_ulong_to_str(zend_ulong num)
ZEND_API zend_string *ZEND_FASTCALL zend_string_toupper_ex(zend_string *str, bool persistent)
ZEND_API void ZEND_FASTCALL convert_to_long(zval *op)
ZEND_API int ZEND_FASTCALL zend_compare_objects(zval *o1, zval *o2)
ZEND_API zend_string *ZEND_FASTCALL zend_double_to_str(double num)
ZEND_API int ZEND_FASTCALL zend_binary_strncasecmp(const char *s1, size_t len1, const char *s2, size_t len2, size_t length)
ZEND_API int ZEND_FASTCALL zend_binary_strcasecmp_l(const char *s1, size_t len1, const char *s2, size_t len2)
ZEND_API char *ZEND_FASTCALL zend_str_toupper_dup(const char *source, size_t length)
#define END_EXTERN_C()
#define ZEND_ATTRIBUTE_DEPRECATED
#define zend_finite(a)
#define EXPECTED(condition)
#define zend_always_inline
#define ZEND_FASTCALL
#define ZEND_ASSERT(c)
#define ZEND_ATTRIBUTE_COLD_LABEL
#define zend_isnan(a)
#define UNEXPECTED(condition)
#define BEGIN_EXTERN_C()
#define ZEND_ASSUME(c)
struct _zend_class_entry zend_class_entry
#define ZSTR_VAL(zstr)
Definition zend_string.h:68
#define dval(x)
#define Z_TYPE_P(zval_p)
Definition zend_types.h:660
#define IS_TRUE
Definition zend_types.h:603
#define Z_REFVAL_P(zval_p)
#define Z_STRVAL_P(zval_p)
Definition zend_types.h:975
#define Z_ARRVAL_P(zval_p)
Definition zend_types.h:987
#define ZVAL_LONG(z, l)
#define IS_STRING
Definition zend_types.h:606
struct _zend_array HashTable
Definition zend_types.h:386
#define IS_RESOURCE
Definition zend_types.h:609
#define IS_ARRAY
Definition zend_types.h:607
#define Z_OBJ_HT_P(zval_p)
Definition zend_types.h:993
#define IS_DOUBLE
Definition zend_types.h:605
#define Z_STR_P(zval_p)
Definition zend_types.h:972
#define Z_STRLEN_P(zval_p)
Definition zend_types.h:978
#define ZVAL_UNREF(z)
#define IS_OBJECT
Definition zend_types.h:608
#define IS_LONG
Definition zend_types.h:604
#define Z_DELREF_P(pz)
#define IS_REFERENCE
Definition zend_types.h:610
#define Z_RES_HANDLE_P(zval_p)
#define ZVAL_COPY(z, v)
#define ZVAL_DOUBLE(z, d)
#define Z_REFCOUNT_P(pz)
ZEND_RESULT_CODE zend_result
Definition zend_types.h:64
#define Z_DVAL_P(zval_p)
Definition zend_types.h:969
#define Z_LVAL_P(zval_p)
Definition zend_types.h:966
bool result
op2
op1
zval * ret