mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Add ZEND_TRY_ASSIGN_BOOL API
This commit is contained in:
parent
8578c54e14
commit
706ba151d2
1 changed files with 14 additions and 0 deletions
|
@ -712,6 +712,20 @@ ZEND_API int zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, ze
|
|||
ZVAL_TRUE(_zv); \
|
||||
} while (0)
|
||||
|
||||
#define ZEND_TRY_ASSIGN_BOOL(zv, bval) do { \
|
||||
zval *_zv = zv; \
|
||||
if (EXPECTED(Z_ISREF_P(_zv))) { \
|
||||
zend_reference *ref = Z_REF_P(_zv); \
|
||||
if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(ref))) { \
|
||||
zend_try_assign_typed_ref_bool(ref, 1); \
|
||||
break; \
|
||||
} \
|
||||
_zv = &ref->val; \
|
||||
} \
|
||||
zval_ptr_dtor(_zv); \
|
||||
ZVAL_BOOL(_zv, bval); \
|
||||
} while (0)
|
||||
|
||||
#define ZEND_TRY_ASSIGN_LONG(zv, lval) do { \
|
||||
zval *_zv = zv; \
|
||||
if (EXPECTED(Z_ISREF_P(_zv))) { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue