History log of /php-src/Zend/zend_operators.h (Results 1 – 25 of 379)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 5feb29ea 17-Sep-2024 David Carlier

Fix ubsan build on freebsd regarding float.

due to the system header machine/ieeefp.h proceeding to a bitshift
operation.

close GH-15935


# ea297654 24-Sep-2024 DanielEScherzer

Zend/*: fix a bunch of typos (GH-16017)

* Zend/*: fix a bunch of typos

* Zend/tests/try/try_catch_finally_005.phpt: update string length


# 9e94d2b0 08-Jul-2024 Peter Kokot

Autotools: Refactor builtin checks (#14835)

This creates a single M4 macro PHP_CHECK_BUILTIN and removes other
PHP_CHECK_BUILTIN_* macros. Checks are wrapped in AC_CACHE_CHECK and
PH

Autotools: Refactor builtin checks (#14835)

This creates a single M4 macro PHP_CHECK_BUILTIN and removes other
PHP_CHECK_BUILTIN_* macros. Checks are wrapped in AC_CACHE_CHECK and
PHP_HAVE_BUILTIN_* CPP macro definitions are defined to 1 if builtin
is found and undefined if not.

This also changes all PHP_HAVE_BUILTIN_ symbols to be either undefined
or defined (to value 1) and syncs all #if/ifdef/defined usages of them
in the php-src code. This way it is simpler to use them because they
don't need to be defined to value 0 on Windows, for example. This is
done as previous usages in php-src were mixed and on many places they
were only checked with ifdef.

show more ...


# c461b600 24-May-2024 Levi Morrison

refactor: change `zend_is_true` to return `bool` (#14301)

Previously this returned `int`. Many functions actually take advantage
of the fact this returns exactly 0 or 1. For instance,

refactor: change `zend_is_true` to return `bool` (#14301)

Previously this returned `int`. Many functions actually take advantage
of the fact this returns exactly 0 or 1. For instance,
`main/streams/xp_socket.c` does:

sockopts |= STREAM_SOCKOP_IPV6_V6ONLY_ENABLED * zend_is_true(tmpzval);

And `Zend/zend_compile.c` does:

child = &ast->child[2 - zend_is_true(zend_ast_get_zval(ast->child[0]))];

I changed a few places trivially from `int` to `bool`, but there are
still many places such as the object handlers which return `int` that
should eventually be `bool`.

show more ...


# a2068ef4 22-Dec-2023 David Carlier

Fix GH-12999: zend_strnlen build fix when platform misses strnlen support.

fix from @rainerjung


# 927adfb1 20-Dec-2023 Cristian Rodríguez

Use a single version of mempcpy(3) (#12257)

While __php_mempcpy is only used by ext/standard/crypt_sha*, the
mempcpy "pattern" is used everywhere.

This commit removes __php_memp

Use a single version of mempcpy(3) (#12257)

While __php_mempcpy is only used by ext/standard/crypt_sha*, the
mempcpy "pattern" is used everywhere.

This commit removes __php_mempcpy, adds zend_mempcpy and transforms
open-coded parts into function calls.

show more ...


# 736032fe 17-Oct-2023 SakiTakamachi

Fixed a bug in zend_memnistr with single character needle

Fixes GH-12457
Closes GH-12458


# 782ffd76 22-Aug-2023 Cristian Rodríguez

Use a single version of strnlen (#12015)

* Zend: Make zend_strnlen available for use outside zend_compile

* exif: remove local php_strnlen, use zend_strnlen instead

* main

Use a single version of strnlen (#12015)

* Zend: Make zend_strnlen available for use outside zend_compile

* exif: remove local php_strnlen, use zend_strnlen instead

* main: remove local strnlen, use zend_strnlen instead

* phar: remove local strnlen, use zend_strnlen

show more ...


# d8696f92 17-Jul-2023 George Peter Banyard

[RFC] Path to Saner Increment/Decrement operators (#10358)

* Add behavioural tests for incdec operators

* Add support to ++/-- for objects castable to _IS_NUMBER

* Add str_

[RFC] Path to Saner Increment/Decrement operators (#10358)

* Add behavioural tests for incdec operators

* Add support to ++/-- for objects castable to _IS_NUMBER

* Add str_increment() function

* Add str_decrement() function

RFC: https://wiki.php.net/rfc/saner-inc-dec-operators

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>

show more ...


# ea8f934f 19-Jun-2023 George Peter Banyard

Zend: Expose zendi_try_get_long() function via a public API (#10175)


# 706a9b2a 04-Apr-2023 Dmitry Stogov

Revert "Zend/zend_types.h: move `zend_result` to separate header (#10609)"

This reverts commit 3bce11606937de8227dac6512d2abf163dc0e8fa.


# 3b066188 07-Mar-2023 George Peter Banyard

RFC: Saner array_(sum|product)() (#10161)

RFC: https://wiki.php.net/rfc/saner-array-sum-product

Moreover, the internal fast_add_function() function was removed.


# d5c649b3 23-Feb-2023 Max Kellermann

zend_compiler, ...: use `uint8_t` instead of `zend_uchar` (#10621)

`zend_uchar` suggests that the value is an ASCII character, but here,
it's about very small integers. This is misleadi

zend_compiler, ...: use `uint8_t` instead of `zend_uchar` (#10621)

`zend_uchar` suggests that the value is an ASCII character, but here,
it's about very small integers. This is misleading, so let's use a
C99 integer instead.

On all architectures currently supported by PHP, `zend_uchar` and
`uint8_t` are identical. This change is only about code readability.

show more ...


# 49c1e6eb 20-Feb-2023 Max Kellermann

Make various pointers const in Zend/ (#10608)

* Zend/zend_operators: pass const pointers to zend_is_identical()

* Zend/zend_operators: pass const pointers to zend_get_{long,double}(

Make various pointers const in Zend/ (#10608)

* Zend/zend_operators: pass const pointers to zend_is_identical()

* Zend/zend_operators: pass const pointers to zend_get_{long,double}()

* Zend/Optimizer/sccp: make pointers const

* Zend/Optimizer/scdf: make pointers const

* Zend/Optimizer/zend_worklist: make pointers const

* Zend/Optimizer/zend_optimizer: make pointers const

* Zend/zend_compile: make pointers const

show more ...


# 3bce1160 20-Feb-2023 Max Kellermann

Zend/zend_types.h: move `zend_result` to separate header (#10609)

Many sources need just `zend_result`, and with this new header, they
only need to include `zend_result.h` instead of `ze

Zend/zend_types.h: move `zend_result` to separate header (#10609)

Many sources need just `zend_result`, and with this new header, they
only need to include `zend_result.h` instead of `zend_types.h`; the
latter is large and has fat dependencies, which slows down the build.

show more ...


# c8955c07 16-Jan-2023 Christoph M. Becker

Revert GH-10220

Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit ecc880f491d66081298a16634629f149459706a9.
This reverts commit 588a07

Revert GH-10220

Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit ecc880f491d66081298a16634629f149459706a9.
This reverts commit 588a07f7371ee2b5fac17de147926780e427fae6.
This reverts commit f377e15751d3aa48b69cd9bcc366ede7803d511f.
This reverts commit b4ba16fe189b109144aff669e11d81365160104b.
This reverts commit 694ec1deea36e366b28b6349a52be49824e1a1a8.
This reverts commit 6b34de8eba9f66882ae16e6073af28783670ac53.
This reverts commit aa1cd02a4367834026ea2205ea13a2f904455aa1.
This reverts commit 308fd311ea6fcf3094b448df7f2b264f08e4fe4f.
This reverts commit 16203b53e1822a37b6ba6f2ab198bb435d05fdad.
This reverts commit 738fb5ca5412f5e833a7fab82b11519e635a3357.
This reverts commit 9fdbefacd3c382d731aa175b7bdc002ec9cb2b30.
This reverts commit cd4a7c1d90562ebb5f89caf94d00d579631b9fbe.
This reverts commit 928685eba2b2f0ded90e7f78fd806ea164002f6e.
This reverts commit 01e5ffc85cd4357fd7b5b7ceefa29f2d10ca26b7.

show more ...


# 694ec1de 04-Jan-2023 Max Kellermann

Zend/zend_{operators,variables}: include cleanup


# a8eb399c 03-Jan-2023 Max Kellermann

Zend/zend_operators: make several pointers const


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

# faa83f2f 04-Aug-2022 George Peter Banyard

Convert some macros to zend_always_inline functions (#8288)

This doesn't have an effect really, but humans and IDEs can struggle to see through the macro soup when they first interact with P

Convert some macros to zend_always_inline functions (#8288)

This doesn't have an effect really, but humans and IDEs can struggle to see through the macro soup when they first interact with PHP's source code.

Moreover, this reduces some of the macro expansion hell when they appear in compiler warnings.

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

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
# 7b90ebeb 05-Feb-2022 Tyson Andre

Fix `-Werror=sign-compare` warning in `zend_memnistr` (#8042)

`error: comparison of integer expressions of different signedness: ‘size_t’ {aka
‘long unsigned int’} and ‘long int’ [-Werro

Fix `-Werror=sign-compare` warning in `zend_memnistr` (#8042)

`error: comparison of integer expressions of different signedness: ‘size_t’ {aka
‘long unsigned int’} and ‘long int’ [-Werror=sign-compare]`

This is asserting `end >= haystack` as a precondition for callers (in debug
builds) and existing callers are correct.

An alternate option is to cast the left side to `int64_t`, but that may be
slightly inefficient for 32-bit builds.

show more ...

Revision tags: php-8.1.3RC1, php-8.0.16RC1, php-8.1.2, php-8.0.15, php-8.1.2RC1, php-8.0.15RC1
# 2f529569 29-Dec-2021 Ilija Tovilo

Optimize stripos/stristr

Closes GH-7847
Closes GH-7852

Previously stripos/stristr would lowercase both the haystack and the
needle to reuse strpos. The approach in this PR i

Optimize stripos/stristr

Closes GH-7847
Closes GH-7852

Previously stripos/stristr would lowercase both the haystack and the
needle to reuse strpos. The approach in this PR is similar to strpos.
memchr is highly optimized so we're using it to search for the first
character of the needle in the haystack. If we find it we compare the
remaining characters of the needle manually.

The new implementation seems to perform about half as well as strpos (as
two memchr calls are necessary to find the next candidate).

show more ...

12345678910>>...16