History log of /php-src/Zend/zend_operators.c (Results 26 – 50 of 722)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
Revision tags: php-8.2.0RC1, php-8.1.10, php-8.0.23, php-8.0.23RC1, php-8.1.10RC1, php-8.2.0beta3
# 30ed8fb3 04-Aug-2022 zeriyoshi

Merge remote-tracking branch 'upstream/PHP-8.1'


# 2d777466 04-Aug-2022 zeriyoshi

Merge remote-tracking branch 'upstream/PHP-8.0' into PHP-8.1


# 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 ...

Revision tags: php-8.2.0beta2, php-8.1.9, php-8.0.22, php-8.1.9RC1, php-8.2.0beta1, php-8.0.22RC1, php-8.0.21, php-8.1.8, php-8.2.0alpha3, php-8.1.8RC1, php-8.2.0alpha2, php-8.0.21RC1
# efc8f0eb 17-Jun-2022 Arnaud Le Blanc

Deprecate zend_atol() / add zend_ini_parse_quantity() (#7951)

Add zend_ini_parse_quantity() and deprecate zend_atol(), zend_atoi()

zend_atol() and zend_atoi() don't just do number p

Deprecate zend_atol() / add zend_ini_parse_quantity() (#7951)

Add zend_ini_parse_quantity() and deprecate zend_atol(), zend_atoi()

zend_atol() and zend_atoi() don't just do number parsing.
They also check for a 'K', 'M', or 'G' at the end of the string,
and multiply the parsed value out accordingly.

Unfortunately, they ignore any other non-numerics between the
numeric component and the last character in the string.
This means that numbers such as the following are both valid
and non-intuitive in their final output.

* "123KMG" is interpreted as "123G" -> 132070244352
* "123G " is interpreted as "123 " -> 123
* "123GB" is interpreted as "123B" -> 123
* "123 I like tacos." is also interpreted as "123." -> 123

Currently, in php-src these functions are used only for parsing ini values.

In this change we deprecate zend_atol(), zend_atoi(), and introduce a new
function with the same behavior, but with the ability to report invalid inputs
to the caller. The function's name also makes the behavior less unexpected:
zend_ini_parse_quantity().

Co-authored-by: Sara Golemon <pollita@php.net>

show more ...

# c1a06704 08-Jun-2022 Max Kellermann

Add ZEND_THREEWAY_COMPARE() macro to fix casting underflowed unsigned to signed (#8220)

Casting a huge unsigned value to signed is implementation-defined
behavior in C. By introducing t

Add ZEND_THREEWAY_COMPARE() macro to fix casting underflowed unsigned to signed (#8220)

Casting a huge unsigned value to signed is implementation-defined
behavior in C. By introducing the ZEND_THREEWAY_COMPARE() macro, we
can sidestep this integer overflow/underflow/casting problem.

show more ...

Revision tags: php-8.0.20, php-8.1.7, php-8.2.0alpha1, php-7.4.30, php-8.1.7RC1, php-8.0.20RC1, php-8.1.6, php-8.0.19, php-8.1.6RC1, php-8.0.19RC1, php-8.0.18, php-8.1.5, php-7.4.29, php-8.1.5RC1, php-8.0.18RC1, php-8.1.4, php-8.0.17, php-8.1.4RC1, php-8.0.17RC1, php-8.1.3, php-8.0.16, php-7.4.28, php-8.1.3RC1, php-8.0.16RC1
# e7c2e11c 28-Jan-2022 Dmitry Stogov

Merge branch 'PHP-8.1'

* PHP-8.1:
Fix typo (wrong string length)


# e7008640 28-Jan-2022 Dmitry Stogov

Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
Fix typo (wrong string length)


# 464e725b 28-Jan-2022 Dmitry Stogov

Fix typo (wrong string length)

Fixes oss-fuzz #44110

Revision tags: php-8.1.2, php-8.0.15, php-8.1.2RC1, php-8.0.15RC1, php-8.0.14
# 8eee0d61 15-Dec-2021 Tim Starling

Make strtolower() and strtoupper() do ASCII case conversion (#7506)

Implement RFC https://wiki.php.net/rfc/strtolower-ascii

Revision tags: php-8.1.1, php-7.4.27
# e32642c5 05-Dec-2021 Nikita Popov

Merge branch 'PHP-8.1'

* PHP-8.1:
Fix bug #81598: Use C.UTF-8 as LC_CTYPE locale by default


Revision tags: php-8.1.1RC1, php-8.0.14RC1, php-7.4.27RC1, php-8.1.0, php-8.0.13, php-7.4.26, php-7.3.33, php-8.1.0RC6
# 26e42446 09-Nov-2021 Nikita Popov

Fix bug #81598: Use C.UTF-8 as LC_CTYPE locale by default

Unfortunately, libedit is locale based and does not accept UTF-8
input when the C locale is used. This patch switches the defaul

Fix bug #81598: Use C.UTF-8 as LC_CTYPE locale by default

Unfortunately, libedit is locale based and does not accept UTF-8
input when the C locale is used. This patch switches the default
locale to C.UTF-8 instead (if it is available). This makes libedit
work and I believe it shouldn't affect behavior of single-byte
locale-dependent functions that PHP otherwise uses.

Closes GH-7635.

show more ...

# ce62a985 04-Nov-2021 Nikita Popov

Merge branch 'PHP-8.1'

* PHP-8.1:
Remove unnecessary assertion


# e291dcd8 04-Nov-2021 Nikita Popov

Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
Remove unnecessary assertion


# 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 ...

Revision tags: php-7.4.26RC1, php-8.0.13RC1, php-8.1.0RC5, php-7.3.32, php-7.4.25, php-8.0.12, php-8.1.0RC4, php-8.0.12RC1, php-7.4.25RC1
# da0c7050 29-Sep-2021 Tim Starling

Add upper case functions to zend_operators.c and use them (#7521)

Add a family of upper case conversion functions to zend_operators.c,
by analogy with the lower case functions.

Add upper case functions to zend_operators.c and use them (#7521)

Add a family of upper case conversion functions to zend_operators.c,
by analogy with the lower case functions.

Move the single-character conversion macros to the header so that they
can be used as a locale-independent replacement for tolower() and
toupper().

Factor out the ugly bits of the SSE2 case conversion so that the four
functions that use it are easy to read and processor-independent.

Use the new ASCII upper case functions in ext/xml, ext/pdo_dblib and as
an optimization for strtoupper() when the locale is "C".

show more ...

Revision tags: php-8.1.0RC3
# 49867405 24-Sep-2021 Nikita Popov

Remove zend_binary_zval_strcasecmp() APIs

These are thin wrappers ... around the wrong functions. They call
the "_l()" version of the underlying APIs. For clarify, just call
the wrap

Remove zend_binary_zval_strcasecmp() APIs

These are thin wrappers ... around the wrong functions. They call
the "_l()" version of the underlying APIs. For clarify, just call
the wrapped API directly.

show more ...

Revision tags: php-8.0.11, php-7.4.24, php-7.3.31, php-8.1.0RC2, php-7.4.24RC1, php-8.0.11RC1, php-8.1.0RC1, php-7.4.23, php-8.0.10, php-7.3.30, php-8.1.0beta3, php-8.0.10RC1, php-7.4.23RC1, php-8.1.0beta2
# 60484818 02-Aug-2021 Nikita Popov

Add additional double to string APIs

zend_double_to_str() converts a double to string in the way that
(string) would (using %.*H using precision).

smart_str_append_double() prov

Add additional double to string APIs

zend_double_to_str() converts a double to string in the way that
(string) would (using %.*H using precision).

smart_str_append_double() provides some more fine control over
the precision, and whether a zero fraction should be appeneded
for whole numbers.

A caveat here is that raw calls to zend_gcvt and going through
s*printf has slightly different behavior for the degenarate
precision=0 case. zend_gcvt will add a dummy E+0 in that case,
while s*printf convert this to precision=1 and will not. I'm
going with the s*printf behavior here, which is more common,
but does result in a minor change to the precision.phpt test.

show more ...

Revision tags: php-8.0.9, php-7.4.22
# 9f18bff6 21-Jul-2021 Christoph M. Becker

Merge branch 'PHP-8.0'

* PHP-8.0:
Fix #74960: Heap buffer overflow via str_repeat


# f03e7c84 21-Jul-2021 Christoph M. Becker

Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
Fix #74960: Heap buffer overflow via str_repeat


# 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 ...

Revision tags: php-8.1.0beta1
# a733b1ad 16-Jul-2021 Nikita Popov

Restore zend_atoi()

I dropped this in preparation for changes that I didn't end up
doing. Restore the function for now to avoid unnecessary churn for
extensions.

Revision tags: php-7.4.22RC1, php-8.0.9RC1
# 26e8a3ba 13-Jul-2021 Nikita Popov

Use unsigned arithmetic in zend_atol

To avoid UB on overflow. I'm not really sure what the correct
overflow behavior here would be.

# 1cba7764 13-Jul-2021 Nikita Popov

Remove zend_atoi() (#7232)

It's the same as (int) zend_atol() -- it doesn't try to do anything
integer size specific. Canonicalize to one function in preparation
for renaming zend_at

Remove zend_atoi() (#7232)

It's the same as (int) zend_atol() -- it doesn't try to do anything
integer size specific. Canonicalize to one function in preparation
for renaming zend_atol() to something less misleading.

FFI test is adjusted to use a zend_test function. It just calls
zend_atol() internally, but could really be anything.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

show more ...

# ce3846cd 07-Jul-2021 Nikita Popov

Merge branch 'PHP-8.0'

* PHP-8.0:
Fix use after free on compound division by zero


# 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 ...

12345678910>>...29