History log of /PHP-8.0/Zend/zend_operators.c (Results 1 – 25 of 631)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 3725717d 04-Aug-2022 Go Kudo

Remove ZEND_DVAL_TO_LVAL_CAST_OK (#9215)

* Remove ZEND_DVAL_TO_LVAL_CAST_OK
As far as I can see, this operation should always use the _slow method, and the results seem to be wrong when

Remove ZEND_DVAL_TO_LVAL_CAST_OK (#9215)

* Remove ZEND_DVAL_TO_LVAL_CAST_OK
As far as I can see, this operation should always use the _slow method, and the results seem to be wrong when ZEND_DVAL_TO_LVAL_CAST_OK is enabled.

* update NEWS

show more ...


# 464e725b 28-Jan-2022 Dmitry Stogov

Fix typo (wrong string length)

Fixes oss-fuzz #44110


# 7e67366a 04-Nov-2021 Nikita Popov

Remove unnecessary assertion

zend_class_implements_interface works fine if the "class" is an
interface, so simply drop this assertion. This avoids the need to
special case this situa

Remove unnecessary assertion

zend_class_implements_interface works fine if the "class" is an
interface, so simply drop this assertion. This avoids the need to
special case this situation.

show more ...


# 760ff841 21-Jul-2021 Christoph M. Becker

Fix #74960: Heap buffer overflow via str_repeat

Trying to allocate a `zend_string` with a length only slighty smaller
than `SIZE_MAX` causes an integer overflow, so callers may need to

Fix #74960: Heap buffer overflow via str_repeat

Trying to allocate a `zend_string` with a length only slighty smaller
than `SIZE_MAX` causes an integer overflow, so callers may need to
check that explicitly. To make that easy in a portable way, we
introduce `ZSTR_MAX_LEN`.

Closes GH-7294.

show more ...


# 62ecf54f 07-Jul-2021 Nikita Popov

Fix use after free on compound division by zero

We can't destroy the result operand early, because the division
might fail, in which case we need to preserve the original value.
Plac

Fix use after free on compound division by zero

We can't destroy the result operand early, because the division
might fail, in which case we need to preserve the original value.
Place the division result in a temporary zval, and only copy it
on success.

Fixes oss-fuzz #35876.

show more ...


# 540fed1b 01-Jul-2021 Nikita Popov

Fix leak on div by zero compound assignment with coercion

The result == op1 check did not work properly here, because op1
was &op1_copy at this point. Move the division by zero reporting

Fix leak on div by zero compound assignment with coercion

The result == op1 check did not work properly here, because op1
was &op1_copy at this point. Move the division by zero reporting
out of the _base function, so it can check the original op1.

show more ...


Revision tags: php-8.0.0, php-7.3.25, php-7.4.13, php-8.0.0RC5, php-7.4.13RC1, php-8.0.0RC4, php-7.3.25RC1, php-7.4.12, php-8.0.0RC3, php-7.3.24, php-8.0.0RC2, php-7.4.12RC1, php-7.3.24RC1
# 3c4dd73c 12-Oct-2020 Nikita Popov

Detect self-addition of array more accurately

While the zvals may be different, they may still point to the
same array.

Fixes oss-fuzz #26245.


# ae77c7b0 02-Oct-2020 Nikita Popov

Return correct result code for division by zero

Turns out we do need to return FAILURE here on div by zero
exception. Use a three-way return value from div_function_base.

Fixes

Return correct result code for division by zero

Turns out we do need to return FAILURE here on div by zero
exception. Use a three-way return value from div_function_base.

Fixes oss-fuzz #25975.

show more ...


Revision tags: php-7.2.34, php-8.0.0rc1, php-7.4.11, php-7.3.23
# fb4554e4 21-Sep-2020 Nikita Popov

Throw warning for failed object to int/float conversion

We previously couldn't increase the error level here because it
was coupled to comparison handling. This is no longer the case

Throw warning for failed object to int/float conversion

We previously couldn't increase the error level here because it
was coupled to comparison handling. This is no longer the case
in PHP 8.

show more ...


Revision tags: php-8.0.0beta4, php-7.4.11RC1, php-7.3.23RC1
# 31ef94cd 12-Sep-2020 George Peter Banyard

Convert Division by 0 warnings to Error per the Engine Warning RFC

Closes GH-6125


Revision tags: php-8.0.0beta3, php-7.4.10, php-7.3.22
# 3e800e99 24-Aug-2020 Máté Kocsis

Move custom type checks to ZPP

Closes GH-6034


# cd2afd99 31-Aug-2020 Nikita Popov

Fix leak on assign concat of array and empty string


# fa8d9b11 28-Aug-2020 George Peter Banyard

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functio

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics

Closes GH-6002

show more ...


Revision tags: php-8.0.0beta2, php-7.3.22RC1, php-7.4.10RC1, php-8.0.0beta1, php-7.4.9, php-7.2.33, php-7.3.21
# b2248789 29-Jul-2020 George Peter Banyard

Implement 'Saner Numeric Strings' RFC:

RFC: https://wiki.php.net/rfc/saner-numeric-strings

This removes the -1 allow_error mode from is_numeric_string functions and replaces it by

Implement 'Saner Numeric Strings' RFC:

RFC: https://wiki.php.net/rfc/saner-numeric-strings

This removes the -1 allow_error mode from is_numeric_string functions and replaces it by
a trailing boolean out argument to preserve BC in a couple of places.

Most of the changes can be resumed to "numeric" strings which emitted a E_NOTICE now emit
a E_WARNING and "numeric" strings which emitted a E_WARNING now throw a TypeError.

This mostly affects:
- String offsets
- Arithmetic operations
- Bitwise operations

Closes GH-5762

show more ...


Revision tags: php-8.0.0alpha3, php-7.4.9RC1, php-7.3.21RC1, php-7.4.8, php-7.2.32, php-8.0.0alpha2, php-7.3.20
# f7599365 24-Jun-2020 Andrea Faulds

Permit trailing whitespace in numeric strings

This is part 1 of the 'Saner Numeric Strings' RFC:
https://wiki.php.net/rfc/saner-numeric-strings


Revision tags: php-8.0.0alpha1, php-7.4.8RC1, php-7.3.20RC1, php-7.4.7, php-7.3.19, php-7.4.7RC1, php-7.3.19RC1, php-7.4.6, php-7.2.31, php-7.4.6RC1, php-7.3.18RC1, php-7.2.30, php-7.4.5, php-7.3.17, php-7.4.5RC1, php-7.3.17RC1, php-7.3.18, php-7.4.4, php-7.2.29, php-7.3.16, php-7.4.4RC1, php-7.3.16RC1, php-7.4.3, php-7.2.28, php-7.3.15RC1, php-7.4.3RC1, php-7.3.15, php-7.2.27, php-7.4.2, php-7.3.14, php-7.3.14RC1, php-7.4.2RC1, php-7.4.1, php-7.2.26, php-7.3.13, php-7.4.1RC1, php-7.3.13RC1, php-7.2.26RC1, php-7.4.0, php-7.2.25, php-7.3.12, php-7.4.0RC6, php-7.3.12RC1, php-7.2.25RC1, php-7.4.0RC5, php-7.1.33, php-7.2.24, php-7.3.11, php-7.4.0RC4, php-7.3.11RC1, php-7.2.24RC1, php-7.4.0RC3, php-7.2.23, php-7.3.10, php-7.4.0RC2, php-7.2.23RC1, php-7.3.10RC1, php-7.4.0RC1, php-7.1.32, php-7.2.22, php-7.3.9, php-7.4.0beta4, php-7.2.22RC1, php-7.3.9RC1, php-7.4.0beta2, php-7.1.31, php-7.2.21, php-7.3.8, php-7.4.0beta1, php-7.2.21RC1, php-7.3.8RC1, php-7.4.0alpha3, php-7.3.7, php-7.2.20, php-7.4.0alpha2, php-7.3.7RC3, php-7.3.7RC2, php-7.2.20RC2, php-7.4.0alpha1, php-7.3.7RC1, php-7.2.20RC1, php-7.2.19, php-7.3.6, php-7.1.30, php-7.2.19RC1, php-7.3.6RC1, php-7.1.29, php-7.2.18, php-7.3.5, php-7.2.18RC1, php-7.3.5RC1, php-7.2.17, php-7.3.4, php-7.1.28, php-7.3.4RC1, php-7.2.17RC1, php-7.1.27, php-7.3.3, php-7.2.16
# acbf7802 21-Feb-2019 Nikita Popov

Improved number to string comparison semantics

RFC: https://wiki.php.net/rfc/string_to_number_comparison

Closes GH-3886.


# 92c4b065 16-Jun-2020 Christoph M. Becker

Use ZEND_UNREACHABLE() instead of ZEND_ASSERT(0)

Instead of marking unreachable code with `ZEND_ASSERT(0)`, we introduce
`ZEND_UNREACHABLE()`, so that MSVC which does not consider `asser

Use ZEND_UNREACHABLE() instead of ZEND_ASSERT(0)

Instead of marking unreachable code with `ZEND_ASSERT(0)`, we introduce
`ZEND_UNREACHABLE()`, so that MSVC which does not consider `assert(0)`
to mark unreachable code does no longer trigger C4715[1] warnings in
debug builds. This may be useful for other compilers as well.

[1] <https://docs.microsoft.com/de-de/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4715?view=vs-2019>

show more ...


# 83a77015 08-Jun-2020 twosee

Add helper APIs for maybe-interned string creation

Add ZVAL_CHAR/RETVAL_CHAR/RETURN_CHAR as a shortcut for using
ZVAL_INTERNED_STRING and ZSTR_CHAR.

Add zend_string_init_fast()

Add helper APIs for maybe-interned string creation

Add ZVAL_CHAR/RETVAL_CHAR/RETURN_CHAR as a shortcut for using
ZVAL_INTERNED_STRING and ZSTR_CHAR.

Add zend_string_init_fast() as a helper for the empty string /
one char interned string / zend_string_init() pattern.

Also add corresponding ZVAL_STRINGL_FAST etc macros.

Closes GH-5684.

show more ...


# c6a6ca07 13-May-2020 Nikita Popov

Use zend_zval_type_name() API where possible

Rather than zend_get_type_by_const(Z_TYPE_P()).


# 25acc4a6 12-May-2020 George Peter Banyard

Fix [-Wundef] warning in Zend folder


# 53f5cfd9 12-May-2020 Nikita Popov

Drop multi_convert_* APIs

These are no longer used internally, and I'd rather they weren't
used externally either.


# 4a816584 29-Feb-2020 Máté Kocsis

Make float to string casts locale-independent

From now on, float to string casting will always behave locale-independently.
RFC: https://wiki.php.net/rfc/locale_independent_float_to_stri

Make float to string casts locale-independent

From now on, float to string casting will always behave locale-independently.
RFC: https://wiki.php.net/rfc/locale_independent_float_to_string
Closes GH-5224

Co-authored-by: George Peter Banyard <girgias@php.net>

show more ...


# e41f764b 06-May-2020 Nikita Popov

Revert "Move declaration at top of the block"

This reverts commit b56f20385089703de7a3c9d89a9de4f9d14f56a3.

We use C99 now, this is not needed anymore.


# b56f2038 06-May-2020 Xinchen Hui

Move declaration at top of the block


# 5bc1e224 01-Apr-2020 Nikita Popov

Make numeric operations on resources, arrays and objects type errors

RFC: https://wiki.php.net/rfc/arithmetic_operator_type_checks

Closes GH-5331.


12345678910>>...26