History log of /PHP-7.4/ext/opcache/Optimizer/zend_func_info.c (Results 1 – 25 of 104)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 5acab7eb 28-Apr-2021 Nikita Popov

filter_var_array() may return array_of_ref

This function preserves references in the input array.


# 67c4d1f5 28-Apr-2021 Nikita Popov

fetch_assoc may return array_key_long

If the column name is a number (which is possible at least via
AS clauses), then symtable canonicalization will convert it into
an integer key.


# c340f97a 28-Apr-2021 Nikita Popov

password_get_info() may return array_of_null

The algo key is set to null if the algorithm can't be detected.


# c7387ab9 28-Apr-2021 Nikita Popov

getdate() may return array_key_long

This function mostly uses string keys, but the timestamp is
returned at key 0 (why???)


# a1fdfa70 12-Apr-2021 Nikita Popov

Fixed bug #80950

Function info for curl_exec() incorrect specified that the
function cannot return true. This is already fixed in PHP 8,
as the func info entry was removed there.


Revision tags: php-7.3.13RC1, php-7.2.26RC1
# c8e9aa85 30-Nov-2019 Tyson Andre

Fix print_r return types in opcache

https://www.php.net/print_r

> When the return parameter is TRUE, this function will return a string.
> Otherwise, the return value is TRUE.


Revision tags: 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
# 52499938 25-Oct-2019 Nikita Popov

Fixed bug #78747


Revision tags: 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
# 29bced95 13-Sep-2019 Tyson Andre

Fix opcache return type for get_headers in zend_func_info

https://www.php.net/manual/en/function.get-headers.php#refsect1-function.get-headers-examples
shows that it will return string k

Fix opcache return type for get_headers in zend_func_info

https://www.php.net/manual/en/function.get-headers.php#refsect1-function.get-headers-examples
shows that it will return string keys when the second argument is
non-zero. I've verified that this is the case.

This bug was there since the initial commit in c88ffa9a567.

Closes GH-4702.

show more ...


Revision tags: php-7.2.23RC1, php-7.3.10RC1
# 3e89e9a6 09-Sep-2019 Tyson Andre

Add opcache return type for random_int()

random_int() will throw for incorrect argument counts, types (e.g. float
that can't cast to int), or having min > max.

See ext/standard/

Add opcache return type for random_int()

random_int() will throw for incorrect argument counts, types (e.g. float
that can't cast to int), or having min > max.

See ext/standard/random.c

show more ...


# 45e529d6 08-Sep-2019 Tyson Andre

Fix opcache zend_func_info for microtime/gettimeofday

microtime() doesn't return an array,
and gettimeofday() doesn't return a string.
See _php_gettimeofday in microtime.c (mode is n

Fix opcache zend_func_info for microtime/gettimeofday

microtime() doesn't return an array,
and gettimeofday() doesn't return a string.
See _php_gettimeofday in microtime.c (mode is non-zero for gettimeofday)

show more ...


Revision tags: php-7.4.0RC1
# 94e2f25f 03-Sep-2019 Tyson Andre

Add missing opcache return types for functions in spl

(excluding spl_autoload)

spl_object_id() is of the most interest to me,
since I frequently call it in an application.

Add missing opcache return types for functions in spl

(excluding spl_autoload)

spl_object_id() is of the most interest to me,
since I frequently call it in an application.

This includes false/null types caused by wrong argument types and wrong argument
counts.

I can't rule out iterator_to_array returning null in spl_iterator_apply,
so leave MAY_BE_NULL in.

With review comments by nikic:
Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>

show more ...


# 4de8503c 03-Sep-2019 Tyson Andre

Add missing opcache return info for ext/standard.

array_key_first/last returns null for invalid args,
wrong argument counts, and empty arrays.

random_bytes returns a string or t

Add missing opcache return info for ext/standard.

array_key_first/last returns null for invalid args,
wrong argument counts, and empty arrays.

random_bytes returns a string or throws.

show more ...


# 1a905bcb 03-Sep-2019 Tyson Andre

Add new missing functions from ext/hash


# 9c3b7ccd 03-Sep-2019 Tyson Andre

Fix opcache return type for hash_update_stream

It can return false if the resource type is wrong.

```
php > var_export(hash_update_stream(hash_init('md5'),
imagecrea

Fix opcache return type for hash_update_stream

It can return false if the resource type is wrong.

```
php > var_export(hash_update_stream(hash_init('md5'),
imagecreate(1,1)));

Warning: hash_update_stream(): supplied resource is not a valid stream
resource in php shell code on line 1
false
```

The return types were initially added in
c88ffa9a5673cb3141660626ba1921671f0b84d6

show more ...


Revision tags: php-7.1.32, php-7.2.22, php-7.3.9
# 1e82a2d6 25-Aug-2019 Tyson Andre

Also fix signature for passthru

Backported from a1a8d144854acb1c891cf0c21abb0f612b1d8de7
https://www.php.net/manual/en/function.passthru.php#refsect1-function.passthru-returnvalues

Also fix signature for passthru

Backported from a1a8d144854acb1c891cf0c21abb0f612b1d8de7
https://www.php.net/manual/en/function.passthru.php#refsect1-function.passthru-returnvalues

`passthru()` is false with invalid args
`passthru('command')` is null.

show more ...


# f5bccc0e 25-Aug-2019 Tyson Andre

Fix opcache optimizer info for time_nanosleep

This can also return an array. See
https://www.php.net/manual/en/function.time-nanosleep.php#refsect1-function.time-nanosleep-returnvalues

Fix opcache optimizer info for time_nanosleep

This can also return an array. See
https://www.php.net/manual/en/function.time-nanosleep.php#refsect1-function.time-nanosleep-returnvalues

> If the delay was interrupted by a signal, an associative array will be
returned with the components:
>
> - seconds - number of seconds remaining in the delay
> - nanoseconds - number of nanoseconds remaining in the delay

Sending a SIGUSR1 to the below program would trigger this behavior.

```
pcntl_signal(\SIGUSR1, function ($signo, $signinfo) {
echo "Handling a signal $signo\n";
});
echo "Sleeping for 100 seconds\n";
var_export(time_nanosleep(100, 0));
```

The incomplete signature existed since c88ffa9a5.
No phpt tests existed for time_nanosleep returning an array

show more ...


Revision tags: 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
# 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, php-7.3.7RC2, php-7.2.20RC2, php-7.4.0alpha1, php-7.3.7RC1, php-7.2.20RC1
# 5d3e3a62 09-Jun-2019 Tyson Andre

Be more precise about possible types for mysqli methods

mysqli has an uncommon approach to 64-bit compatibility:
it will convert numbers that can't be represented on 32-bit
platforms

Be more precise about possible types for mysqli methods

mysqli has an uncommon approach to 64-bit compatibility:
it will convert numbers that can't be represented on 32-bit
platforms to a string.
This is documented at
https://www.php.net/manual/en/mysqli-stmt.affected-rows.php#refsect1-mysqli-stmt.affected-rows-returnvalues

So if there's a query to a remote mysqli server that affects
more than 2.2 billion rows, then the opcache inference might be
incorrect.

(It's possible to add a MAY_BE_STRING_ON_32_BIT_PLATFORM bitflag macro to
account for this, but I don't think there's a need or want to?)

Patches 3162285b86871fb22a85a50ce9bc30823da64b6a

This is based on the list of php 7.4 functions using
MYSQLI_RETURN_LONG_INT in mysqli_api.c

show more ...


# 07c63c6f 09-Jun-2019 Tyson Andre

Fix opcache signatures for mysqli_stat

See mysqli_api.c and https://www.php.net/manual/en/mysqli.stat.php


# 7350e808 09-Jun-2019 Tyson Andre

Fix bug in opcache flags for mysqli_get_charset

https://www.php.net/manual/en/mysqli.get-charset.php
tests/mysqli_field_seek.phpt has a test of this returning an object.

Looking

Fix bug in opcache flags for mysqli_get_charset

https://www.php.net/manual/en/mysqli.get-charset.php
tests/mysqli_field_seek.phpt has a test of this returning an object.

Looking at the source in ext/mysqli/mysqli_nonapi.c,
this should be object|null, not array|null

This might actually cause bugs in opcache's inferences,
(no proof of this)
so it might make sense to pull this patch into an earlier minor version.

show more ...


Revision tags: php-7.2.19, php-7.3.6, php-7.1.30, php-7.2.19RC1
# eecd8961 14-May-2019 Nikita Popov

Add get_mangled_object_vars() function


# 5c8b702e 09-Jun-2019 Tyson Andre

Fix typo in opcache function flag info (mage->image)

ext/gd/gd.c seems to return null for wrong parameter count, false for
error, and long otherwise. See https://php.net/imagecoloralloca

Fix typo in opcache function flag info (mage->image)

ext/gd/gd.c seems to return null for wrong parameter count, false for
error, and long otherwise. See https://php.net/imagecolorallocate

In php 8.0, the MAY_BE_NULL can probably be removed.

show more ...


# b921564a 09-Jun-2019 Tyson Andre

Clean up opcache func flags for set_socket_blocking

It was removed in php 7.0. See https://php.net/set_socket_blocking


# 98b487e2 09-Jun-2019 Tyson Andre

Fix a typo in opcache func info for "get_parrent_class"

This should only have one r.
http://php.net/get_parent_class mentions that it returns string|false

Also, I'm not 100% sur

Fix a typo in opcache func info for "get_parrent_class"

This should only have one r.
http://php.net/get_parent_class mentions that it returns string|false

Also, I'm not 100% sure if this is right - should this include
MAY_BE_NULL to handle the case of too many parameters?
(then again, get_called_class() also returns null in the global scope)

```
php > var_export(get_parent_class(2,3));
Warning: get_parent_class() expects at most 1 parameter, 2 given in php
shell code on line 1
NULL
```

show more ...


# 31ce1cbb 27-May-2019 Nikita Popov

Func info: Fix calls to zero-arg varargs

The num_args does not include variadics, so a "zero-arg" function
may accept additional arguments through that. No functions seem
to be affec

Func info: Fix calls to zero-arg varargs

The num_args does not include variadics, so a "zero-arg" function
may accept additional arguments through that. No functions seem
to be affected right now, but they will be after #4175.

show more ...


12345