ZEND_API void multi_convert_to_double_ex(int argc, ...);
ZEND_API void multi_convert_to_string_ex(int argc, ...);
-ZEND_API zend_long ZEND_FASTCALL _zval_get_long_func(zval *op);
-ZEND_API double ZEND_FASTCALL _zval_get_double_func(zval *op);
-ZEND_API zend_string* ZEND_FASTCALL _zval_get_string_func(zval *op);
+ZEND_API zend_long ZEND_FASTCALL zval_get_long_func(zval *op);
+ZEND_API double ZEND_FASTCALL zval_get_double_func(zval *op);
+ZEND_API zend_string* ZEND_FASTCALL zval_get_string_func(zval *op);
-static zend_always_inline zend_long _zval_get_long(zval *op) {
- return Z_TYPE_P(op) == IS_LONG ? Z_LVAL_P(op) : _zval_get_long_func(op);
+static zend_always_inline zend_long zval_get_long(zval *op) {
+ return EXPECTED(Z_TYPE_P(op) == IS_LONG) ? Z_LVAL_P(op) : zval_get_long_func(op);
}
-static zend_always_inline double _zval_get_double(zval *op) {
- return Z_TYPE_P(op) == IS_DOUBLE ? Z_DVAL_P(op) : _zval_get_double_func(op);
+static zend_always_inline double zval_get_double(zval *op) {
+ return EXPECTED(Z_TYPE_P(op) == IS_DOUBLE) ? Z_DVAL_P(op) : zval_get_double_func(op);
}
-static zend_always_inline zend_string *_zval_get_string(zval *op) {
- return Z_TYPE_P(op) == IS_STRING ? zend_string_copy(Z_STR_P(op)) : _zval_get_string_func(op);
+static zend_always_inline zend_string *zval_get_string(zval *op) {
+ return EXPECTED(Z_TYPE_P(op) == IS_STRING) ? zend_string_copy(Z_STR_P(op)) : zval_get_string_func(op);
}
-#define zval_get_long(op) _zval_get_long((op))
-#define zval_get_double(op) _zval_get_double((op))
-#define zval_get_string(op) _zval_get_string((op))
+/* Compatibility macros for 7.2 and below */
+#define _zval_get_long(op) zval_get_long(op)
+#define _zval_get_double(op) zval_get_double(op)
+#define _zval_get_string(op) zval_get_string(op)
+#define _zval_get_long_func(op) zval_get_long_func(op)
+#define _zval_get_double_func(op) zval_get_double_func(op)
+#define _zval_get_string_func(op) zval_get_string_func(op)
#define convert_to_cstring(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_cstring((op) ZEND_FILE_LINE_CC); }
#define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op) ZEND_FILE_LINE_CC); }
zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
}
} else {
- zend_string *str = _zval_get_string_func(z);
+ zend_string *str = zval_get_string_func(z);
if (ZSTR_LEN(str) != 0) {
zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
- op1_str = _zval_get_string_func(op1);
+ op1_str = zval_get_string_func(op1);
}
if (OP2_TYPE == IS_CONST) {
op2_str = Z_STR_P(op2);
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
- op2_str = _zval_get_string_func(op2);
+ op2_str = zval_get_string_func(op2);
}
do {
if (OP1_TYPE != IS_CONST) {
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(var, BP_VAR_R);
}
- rope[0] = _zval_get_string_func(var);
+ rope[0] = zval_get_string_func(var);
FREE_OP2();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(var, BP_VAR_R);
}
- rope[opline->extended_value] = _zval_get_string_func(var);
+ rope[opline->extended_value] = zval_get_string_func(var);
FREE_OP2();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(var, BP_VAR_R);
}
- rope[opline->extended_value] = _zval_get_string_func(var);
+ rope[opline->extended_value] = zval_get_string_func(var);
FREE_OP2();
if (UNEXPECTED(EG(exception))) {
for (i = 0; i <= opline->extended_value; i++) {
zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
}
} else {
- zend_string *str = _zval_get_string_func(z);
+ zend_string *str = zval_get_string_func(z);
if (ZSTR_LEN(str) != 0) {
zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
- op1_str = _zval_get_string_func(op1);
+ op1_str = zval_get_string_func(op1);
}
if (IS_CONST == IS_CONST) {
op2_str = Z_STR_P(op2);
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
- op2_str = _zval_get_string_func(op2);
+ op2_str = zval_get_string_func(op2);
}
do {
if (IS_CONST != IS_CONST) {
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
- op1_str = _zval_get_string_func(op1);
+ op1_str = zval_get_string_func(op1);
}
if (IS_CV == IS_CONST) {
op2_str = Z_STR_P(op2);
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
- op2_str = _zval_get_string_func(op2);
+ op2_str = zval_get_string_func(op2);
}
do {
if (IS_CONST != IS_CONST) {
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
- op1_str = _zval_get_string_func(op1);
+ op1_str = zval_get_string_func(op1);
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
op2_str = Z_STR_P(op2);
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
- op2_str = _zval_get_string_func(op2);
+ op2_str = zval_get_string_func(op2);
}
do {
if (IS_CONST != IS_CONST) {
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(var, BP_VAR_R);
}
- rope[opline->extended_value] = _zval_get_string_func(var);
+ rope[opline->extended_value] = zval_get_string_func(var);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(var, BP_VAR_R);
}
- rope[opline->extended_value] = _zval_get_string_func(var);
+ rope[opline->extended_value] = zval_get_string_func(var);
if (UNEXPECTED(EG(exception))) {
for (i = 0; i <= opline->extended_value; i++) {
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(var, BP_VAR_R);
}
- rope[opline->extended_value] = _zval_get_string_func(var);
+ rope[opline->extended_value] = zval_get_string_func(var);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(var, BP_VAR_R);
}
- rope[opline->extended_value] = _zval_get_string_func(var);
+ rope[opline->extended_value] = zval_get_string_func(var);
if (UNEXPECTED(EG(exception))) {
for (i = 0; i <= opline->extended_value; i++) {
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(var, BP_VAR_R);
}
- rope[opline->extended_value] = _zval_get_string_func(var);
+ rope[opline->extended_value] = zval_get_string_func(var);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(var, BP_VAR_R);
}
- rope[opline->extended_value] = _zval_get_string_func(var);
+ rope[opline->extended_value] = zval_get_string_func(var);
zval_ptr_dtor_nogc(free_op2);
if (UNEXPECTED(EG(exception))) {
for (i = 0; i <= opline->extended_value; i++) {
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(var, BP_VAR_R);
}
- rope[0] = _zval_get_string_func(var);
+ rope[0] = zval_get_string_func(var);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(var, BP_VAR_R);
}
- rope[0] = _zval_get_string_func(var);
+ rope[0] = zval_get_string_func(var);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(var) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(var, BP_VAR_R);
}
- rope[0] = _zval_get_string_func(var);
+ rope[0] = zval_get_string_func(var);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
}
} else {
- zend_string *str = _zval_get_string_func(z);
+ zend_string *str = zval_get_string_func(z);
if (ZSTR_LEN(str) != 0) {
zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
- op1_str = _zval_get_string_func(op1);
+ op1_str = zval_get_string_func(op1);
}
if (IS_CONST == IS_CONST) {
op2_str = Z_STR_P(op2);
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
- op2_str = _zval_get_string_func(op2);
+ op2_str = zval_get_string_func(op2);
}
do {
if (IS_CV != IS_CONST) {
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
- op1_str = _zval_get_string_func(op1);
+ op1_str = zval_get_string_func(op1);
}
if (IS_CV == IS_CONST) {
op2_str = Z_STR_P(op2);
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
- op2_str = _zval_get_string_func(op2);
+ op2_str = zval_get_string_func(op2);
}
do {
if (IS_CV != IS_CONST) {
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
- op1_str = _zval_get_string_func(op1);
+ op1_str = zval_get_string_func(op1);
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
op2_str = Z_STR_P(op2);
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
- op2_str = _zval_get_string_func(op2);
+ op2_str = zval_get_string_func(op2);
}
do {
if (IS_CV != IS_CONST) {
zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
}
} else {
- zend_string *str = _zval_get_string_func(z);
+ zend_string *str = zval_get_string_func(z);
if (ZSTR_LEN(str) != 0) {
zend_write(ZSTR_VAL(str), ZSTR_LEN(str));
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
- op1_str = _zval_get_string_func(op1);
+ op1_str = zval_get_string_func(op1);
}
if (IS_CONST == IS_CONST) {
op2_str = Z_STR_P(op2);
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
- op2_str = _zval_get_string_func(op2);
+ op2_str = zval_get_string_func(op2);
}
do {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
- op1_str = _zval_get_string_func(op1);
+ op1_str = zval_get_string_func(op1);
}
if (IS_CV == IS_CONST) {
op2_str = Z_STR_P(op2);
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
- op2_str = _zval_get_string_func(op2);
+ op2_str = zval_get_string_func(op2);
}
do {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
- op1_str = _zval_get_string_func(op1);
+ op1_str = zval_get_string_func(op1);
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
op2_str = Z_STR_P(op2);
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
- op2_str = _zval_get_string_func(op2);
+ op2_str = zval_get_string_func(op2);
}
do {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {