History log of /PHP-8.0/Zend/zend_operators.h (Results 1 – 25 of 323)
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 ...


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, php-7.2.34, php-8.0.0rc1, php-7.4.11, php-7.3.23, php-8.0.0beta4, php-7.4.11RC1, php-7.3.23RC1, php-8.0.0beta3, php-7.4.10, php-7.3.22
# 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, 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
# 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.


Revision tags: 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
# 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 ...


# 9c0afc85 01-Apr-2020 Nikita Popov

Remove op_func from TRY_BINARY_OP1 macro

And move the operator overloading helpers into zend_operators.c,
there's no reason for them to be in the header.


# fb5bfcb7 31-Mar-2020 Nikita Popov

Add a ZEND_UNCOMPARABLE value

To explicitly indicate that objects are uncomparable. For now
this has no functional difference from the usual 1 return value,
but makes intent clearer.


Revision tags: 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
# 5a5680c2 29-Sep-2019 Nikita Popov

Don't use asm arithmetic under msan

Clang 9 supports asm goto, so these no longer get automatically
skipped.

(cherry picked from commit 33bf1495b215d555d45ec638376bd434d8a038b3)


# 98df5c97 30-Dec-2019 Christoph M. Becker

Avoid undefined behavior


# c858d17f 25-Oct-2019 Nikita Popov

Optimize instanceof_function

Split out the simple equality check into an inline function --
this is one of the common cases.

Replace instanceof_function_ex with zend_class_imple

Optimize instanceof_function

Split out the simple equality check into an inline function --
this is one of the common cases.

Replace instanceof_function_ex with zend_class_implements_interface.
There are a few more places where it may be used.

show more ...


# 435f2691 24-Oct-2019 Nikita Popov

Clean up and clarify instanceof_function_ex()

The instanceof_interface_only() function was dead code (always
returned zero).

Clarify that the last parameter indicates whether th

Clean up and clarify instanceof_function_ex()

The instanceof_interface_only() function was dead code (always
returned zero).

Clarify that the last parameter indicates whether the passed CE
is interface or class and rewrite the code in terms of assertions.

show more ...


# b02b8129 07-Oct-2019 Dmitry Stogov

Comparison cleanup:

- introduce zend_compare() that returns -1,0,1 dirctly (without intermediate zval)
- remove compare_objects() object handler, and keep only compare() handler


# 33bf1495 29-Sep-2019 Nikita Popov

Don't use asm arithmetic under msan

Clang 9 supports asm goto, so these no longer get automatically
skipped.


Revision tags: php-7.2.23, php-7.3.10, php-7.4.0RC2
# 2f6efd83 16-Sep-2019 Nikita Popov

Fixed bug #78545

By using an explicit (double) cast.


Revision tags: php-7.2.23RC1, php-7.3.10RC1, php-7.4.0RC1
# 937d5f65 28-Aug-2019 Nikita Popov

Compute needle end only after checking it's non-empty


Revision tags: php-7.1.32, php-7.2.22, php-7.3.9, php-7.4.0beta4
# 6d578482 18-Aug-2019 George Peter Banyard

Improve strpos and strstr function family implementation


Revision tags: 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
# 638c2176 23-Jun-2019 Peter Kokot

Remove HAVE_STRCOLL check

The strcoll function is defined in the C89 standard and should be
on today's systems always available via the <string.h> header.

https://port70.net/~ns

Remove HAVE_STRCOLL check

The strcoll function is defined in the C89 standard and should be
on today's systems always available via the <string.h> header.

https://port70.net/~nsz/c/c89/c89-draft.html#4.11.4.3

- Remove also SKIPIF strcoll check in test

show more ...


Revision tags: php-7.3.7RC3
# e4455c32 20-Jun-2019 Nikita Popov

Bail out earlier in zend_memnrstr

To avoid decrementing a null pointer lateron. As we need to check
for NULL here anayway, we should take the chance to bail out right
away.


Revision tags: php-7.3.7RC2, php-7.2.20RC2, php-7.4.0alpha1, php-7.3.7RC1, php-7.2.20RC1
# 741468d1 06-Jun-2019 Dmitry Stogov

Use ZEND_ASSUME() to perform the following check only on "slow" path.


# 90a2e4ba 05-Jun-2019 Dmitry Stogov

Fixed reference-counting


Revision tags: 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
# a31f4642 26-Feb-2019 Nikita Popov

Allow exceptions in __toString()

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

And convert some object to string conversion related recoverable
fatal errors into Error excep

Allow exceptions in __toString()

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

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.

show more ...


# 31a516cf 28-May-2019 Nikita Popov

Remove set() object handler


# 79a84e00 23-Apr-2019 Sebastian Pop

speed up increment and decrement operators with overflow detection

On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------

speed up increment and decrement operators with overflow detection

On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------
Benchmark Time CPU Iterations
--------------------------------------------------------
BM_inc_before 6.54 ns 6.54 ns 106985447
BM_dec_before 6.54 ns 6.54 ns 107011667
BM_inc_after 4.36 ns 4.36 ns 160525864
BM_dec_after 4.36 ns 4.36 ns 160524243

Before the patch:
fast_long_add_function:
ldr x0, [x1]
add x2, x0, 1
cmp x2, x0
blt .L11
str x2, [x1]
ret
.L11:
mov x0, 4890909195324358656
mov w2, 5
str x0, [x1]
str w2, [x1, 8]
ret

With the patch:
fast_long_add_function:
ldr x5, [x1]
adds x5,x5,1
bvs .L2
str x5, [x1]
ret
.L2:
mov x0, 4890909195324358656
mov w2, 5
str x0, [x1]
str w2, [x1, 8]
ret

php$ ./sapi/cli/php Zend/bench.php

Base: Patch:
simple 0.091 simple 0.091
simplecall 0.014 simplecall 0.014
simpleucall 0.041 simpleucall 0.041
simpleudcall 0.045 simpleudcall 0.045
mandel 0.193 mandel 0.193
mandel2 0.229 mandel2 0.229
ackermann(7) 0.044 ackermann(7) 0.044
ary(50000) 0.010 ary(50000) 0.010
ary2(50000) 0.008 ary2(50000) 0.008
ary3(2000) 0.096 ary3(2000) 0.102
fibo(30) 0.149 fibo(30) 0.148
hash1(50000) 0.016 hash1(50000) 0.016
hash2(500) 0.020 hash2(500) 0.020
heapsort(20000) 0.055 heapsort(20000) 0.055
matrix(20) 0.057 matrix(20) 0.057
nestedloop(12) 0.091 nestedloop(12) 0.091
sieve(30) 0.032 sieve(30) 0.032
strcat(200000) 0.010 strcat(200000) 0.010
------------------------ ------------------------
Total 1.199 Total 1.204

php$ ./sapi/cli/php Zend/micro_bench.php

Base: Patch:
empty_loop 0.051 empty_loop 0.050
func() 0.181 0.130 func() 0.181 0.131
undef_func() 0.186 0.135 undef_func() 0.186 0.136
int_func() 0.116 0.064 int_func() 0.116 0.065
$x = self::$x 0.235 0.183 $x = self::$x 0.229 0.179
self::$x = 0 0.198 0.147 self::$x = 0 0.199 0.148
isset(self::$x) 0.229 0.178 isset(self::$x) 0.225 0.174
empty(self::$x) 0.231 0.180 empty(self::$x) 0.227 0.177
$x = Foo::$x 0.144 0.093 $x = Foo::$x 0.142 0.092
Foo::$x = 0 0.107 0.056 Foo::$x = 0 0.105 0.054
isset(Foo::$x) 0.140 0.088 isset(Foo::$x) 0.140 0.089
empty(Foo::$x) 0.148 0.097 empty(Foo::$x) 0.144 0.094
self::f() 0.238 0.187 self::f() 0.240 0.190
Foo::f() 0.209 0.158 Foo::f() 0.201 0.150
$x = $this->x 0.123 0.072 $x = $this->x 0.120 0.070
$this->x = 0 0.124 0.073 $this->x = 0 0.124 0.074
$this->x += 2 0.151 0.099 $this->x += 2 0.151 0.101
++$this->x 0.137 0.086 ++$this->x 0.139 0.088
--$this->x 0.137 0.086 --$this->x 0.137 0.087
$this->x++ 0.170 0.119 $this->x++ 0.172 0.122
$this->x-- 0.171 0.119 $this->x-- 0.172 0.122
isset($this->x) 0.170 0.119 isset($this->x) 0.170 0.120
empty($this->x) 0.179 0.128 empty($this->x) 0.179 0.129
$this->f() 0.194 0.143 $this->f() 0.194 0.144
$x = Foo::TEST 0.188 0.137 $x = Foo::TEST 0.188 0.138
new Foo() 0.482 0.431 new Foo() 0.482 0.432
$x = TEST 0.109 0.058 $x = TEST 0.109 0.059
$x = $_GET 0.190 0.138 $x = $_GET 0.188 0.137
$x = $GLOBALS['v'] 0.242 0.191 $x = $GLOBALS['v'] 0.246 0.196
$x = $hash['v'] 0.196 0.145 $x = $hash['v'] 0.192 0.142
$x = $str[0] 0.146 0.094 $x = $str[0] 0.142 0.092
$x = $a ?: null 0.144 0.093 $x = $a ?: null 0.144 0.094
$x = $f ?: tmp 0.174 0.123 $x = $f ?: tmp 0.174 0.124
$x = $f ? $f : $a 0.153 0.101 $x = $f ? $f : $a 0.153 0.102
$x = $f ? $f : tmp 0.148 0.097 $x = $f ? $f : tmp 0.148 0.098
------------------------ ------------------------
Total 6.143 Total 6.108

show more ...


# adc3b720 25-Apr-2019 Sebastian Pop

speed up add and sub operators with overflow detection

On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------
Benchmark

speed up add and sub operators with overflow detection

On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------
Benchmark Time CPU Iterations
--------------------------------------------------------
BM_add_before 13.3 ns 13.3 ns 52626058
BM_sub_before 8.72 ns 8.72 ns 80259343
BM_add_after 4.80 ns 4.80 ns 145926004
BM_sub_after 4.80 ns 4.80 ns 145936496

Before the patch:
fast_long_add_function:
ldr x1, [x1]
ldr x2, [x2]
add x3, x1, x2
eor x4, x1, x2
tbz x4, #63, .L5
.L2:
mov w1, 4
str x3, [x0]
str w1, [x0, 8]
ret
.p2align 2
.L5:
eor x4, x1, x3
tbz x4, #63, .L2
scvtf d0, x1
scvtf d1, x2
mov w1, 5
str w1, [x0, 8]
fadd d0, d0, d1
str d0, [x0]
ret

With the patch:
fast_long_add_function:
ldr x5, [x1]
ldr x6, [x2]
adds x5, x5, x6
bvs .L2
mov w6, 4
str x5, [x0]
str w6, [x0, 8]
ret
.L2:
ldr x1, [x1]
mov w3, 5
ldr x2, [x2]
str w3, [x0, 8]
scvtf d0, x1
scvtf d1, x2
fadd d0, d0, d1
str d0, [x0]
ret

php$ ./sapi/cli/php Zend/bench.php

Base: Patch:
simple 0.091 simple 0.091
simplecall 0.014 simplecall 0.014
simpleucall 0.041 simpleucall 0.041
simpleudcall 0.045 simpleudcall 0.045
mandel 0.193 mandel 0.193
mandel2 0.229 mandel2 0.229
ackermann(7) 0.044 ackermann(7) 0.044
ary(50000) 0.010 ary(50000) 0.010
ary2(50000) 0.008 ary2(50000) 0.008
ary3(2000) 0.096 ary3(2000) 0.095
fibo(30) 0.149 fibo(30) 0.148
hash1(50000) 0.016 hash1(50000) 0.016
hash2(500) 0.020 hash2(500) 0.020
heapsort(20000) 0.055 heapsort(20000) 0.054
matrix(20) 0.057 matrix(20) 0.057
nestedloop(12) 0.091 nestedloop(12) 0.091
sieve(30) 0.032 sieve(30) 0.032
strcat(200000) 0.010 strcat(200000) 0.010
------------------------ ------------------------
Total 1.199 Total 1.197

php$ ./sapi/cli/php Zend/micro_bench.php

Base: Patch:
empty_loop 0.051 empty_loop 0.051
func() 0.181 0.130 func() 0.181 0.130
undef_func() 0.186 0.135 undef_func() 0.186 0.135
int_func() 0.116 0.064 int_func() 0.116 0.064
$x = self::$x 0.235 0.183 $x = self::$x 0.233 0.182
self::$x = 0 0.198 0.147 self::$x = 0 0.198 0.147
isset(self::$x) 0.229 0.178 isset(self::$x) 0.229 0.178
empty(self::$x) 0.231 0.180 empty(self::$x) 0.231 0.180
$x = Foo::$x 0.144 0.093 $x = Foo::$x 0.144 0.093
Foo::$x = 0 0.107 0.056 Foo::$x = 0 0.107 0.056
isset(Foo::$x) 0.140 0.088 isset(Foo::$x) 0.140 0.088
empty(Foo::$x) 0.148 0.097 empty(Foo::$x) 0.148 0.097
self::f() 0.238 0.187 self::f() 0.238 0.187
Foo::f() 0.209 0.158 Foo::f() 0.209 0.158
$x = $this->x 0.123 0.072 $x = $this->x 0.123 0.072
$this->x = 0 0.124 0.073 $this->x = 0 0.124 0.073
$this->x += 2 0.151 0.099 $this->x += 2 0.153 0.101
++$this->x 0.137 0.086 ++$this->x 0.138 0.086
--$this->x 0.137 0.086 --$this->x 0.138 0.086
$this->x++ 0.170 0.119 $this->x++ 0.172 0.121
$this->x-- 0.171 0.119 $this->x-- 0.172 0.121
isset($this->x) 0.170 0.119 isset($this->x) 0.170 0.119
empty($this->x) 0.179 0.128 empty($this->x) 0.179 0.128
$this->f() 0.194 0.143 $this->f() 0.194 0.143
$x = Foo::TEST 0.188 0.137 $x = Foo::TEST 0.188 0.136
new Foo() 0.482 0.431 new Foo() 0.479 0.427
$x = TEST 0.109 0.058 $x = TEST 0.109 0.058
$x = $_GET 0.190 0.138 $x = $_GET 0.190 0.139
$x = $GLOBALS['v'] 0.242 0.191 $x = $GLOBALS['v'] 0.242 0.191
$x = $hash['v'] 0.196 0.145 $x = $hash['v'] 0.196 0.145
$x = $str[0] 0.146 0.094 $x = $str[0] 0.145 0.094
$x = $a ?: null 0.144 0.093 $x = $a ?: null 0.144 0.093
$x = $f ?: tmp 0.174 0.123 $x = $f ?: tmp 0.174 0.123
$x = $f ? $f : $a 0.153 0.101 $x = $f ? $f : $a 0.153 0.101
$x = $f ? $f : tmp 0.148 0.097 $x = $f ? $f : tmp 0.148 0.097
------------------------ ------------------------
Total 6.143 Total 6.143

show more ...


12345678910>>...13