<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/php-git.git/tests/basic, branch php-8.0.0beta1</title>
<subtitle>git.php.net: repository/php-src.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/php-git.git/'/>
<entry>
<title>Fix #78236: convert error on receiving variables when duplicate [</title>
<updated>2020-07-23T13:48:09+00:00</updated>
<author>
<name>Christoph M. Becker</name>
<email>cmbecker69@gmx.de</email>
</author>
<published>2020-07-23T09:10:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/php-git.git/commit/?id=fc4d462e947828fdbeac6020ac8f34704a218834'/>
<id>fc4d462e947828fdbeac6020ac8f34704a218834</id>
<content type='text'>
When an input variable name contains a non matched open bracket, we not
only have to replace that with an underscore, but also all following
forbidden characters.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When an input variable name contains a non matched open bracket, we not
only have to replace that with an underscore, but also all following
forbidden characters.
</pre>
</div>
</content>
</entry>
<entry>
<title>Honor script time limit when calling shutdown functions</title>
<updated>2020-05-13T10:47:12+00:00</updated>
<author>
<name>Alex Dowad</name>
<email>alexinbeijing@gmail.com</email>
</author>
<published>2020-05-06T20:02:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/php-git.git/commit/?id=555489dd83132d9c8ba28ad9cde1edf4c5823358'/>
<id>555489dd83132d9c8ba28ad9cde1edf4c5823358</id>
<content type='text'>
A time limit can be set on PHP script execution via `set_time_limit` (or .ini file).
When the time limit is reached, the OS will notify PHP and `timed_out` and `vm_interrupt`
flags are set. While these flags are regularly checked when executing PHP code, once the
end of the script is reached, they are not checked while invoking shutdown functions
(registered via `register_shutdown_function`).

Of course, if the shutdown functions are implemented *in* PHP, then the interrupt flag
will be checked while the VM is running PHP bytecode and the timeout will take effect.
But if the shutdown functions are built-in (implemented in C), it will not.

Since the shutdown functions are invoked through `zend_call_function`, add a check of the
`vm_interrupt` flag there. Then, the script time limit will be respected when *entering*
each shutdown function. The fact still remains that if a shutdown function is built-in and
runs for a long time, script execution will not time out until it finishes and the
interpreter tries to invoke the next one.

Still, the behavior of scripts with execution time limits will be more consistent after
this patch. To make the execution time-out feature work even more precisely, it would
be necessary to scrutinize all the built-in functions and add checks of the `vm_interrupt`
flag in any which can run for a long time. That might not be worth the effort, though.

It should be mentioned that this patch does not solely affect shutdown functions, neither
does it solely allow for interruption of running code due to script execution timeout.
Anything else which causes `vm_interrupt` to be set, such as the PHP interpreter receiving
a signal, will take effect when exiting from an internal function. And not just internal
functions which are called because they were registered to run at shutdown; there are
other cases where a series of internal functions might run in the midst of a script. In
all such cases, it will be possible to interrupt the interpreter now.

Closes GH-5543.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A time limit can be set on PHP script execution via `set_time_limit` (or .ini file).
When the time limit is reached, the OS will notify PHP and `timed_out` and `vm_interrupt`
flags are set. While these flags are regularly checked when executing PHP code, once the
end of the script is reached, they are not checked while invoking shutdown functions
(registered via `register_shutdown_function`).

Of course, if the shutdown functions are implemented *in* PHP, then the interrupt flag
will be checked while the VM is running PHP bytecode and the timeout will take effect.
But if the shutdown functions are built-in (implemented in C), it will not.

Since the shutdown functions are invoked through `zend_call_function`, add a check of the
`vm_interrupt` flag there. Then, the script time limit will be respected when *entering*
each shutdown function. The fact still remains that if a shutdown function is built-in and
runs for a long time, script execution will not time out until it finishes and the
interpreter tries to invoke the next one.

Still, the behavior of scripts with execution time limits will be more consistent after
this patch. To make the execution time-out feature work even more precisely, it would
be necessary to scrutinize all the built-in functions and add checks of the `vm_interrupt`
flag in any which can run for a long time. That might not be worth the effort, though.

It should be mentioned that this patch does not solely affect shutdown functions, neither
does it solely allow for interruption of running code due to script execution timeout.
Anything else which causes `vm_interrupt` to be set, such as the PHP interpreter receiving
a signal, will take effect when exiting from an internal function. And not just internal
functions which are called because they were registered to run at shutdown; there are
other cases where a series of internal functions might run in the midst of a script. In
all such cases, it will be possible to interrupt the interpreter now.

Closes GH-5543.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make float to string casts locale-independent</title>
<updated>2020-05-08T08:52:23+00:00</updated>
<author>
<name>Máté Kocsis</name>
<email>kocsismate@woohoolabs.com</email>
</author>
<published>2020-02-29T21:47:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/php-git.git/commit/?id=4a816584a4d483722485e5163396ea1bb2a6aee7'/>
<id>4a816584a4d483722485e5163396ea1bb2a6aee7</id>
<content type='text'>
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 &lt;girgias@php.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;girgias@php.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Completely remove disabled functions from function table</title>
<updated>2020-04-30T07:53:57+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>nikita.ppv@gmail.com</email>
</author>
<published>2020-04-27T11:17:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/php-git.git/commit/?id=53eee290b6f5ca531aef19885a392c939013ce36'/>
<id>53eee290b6f5ca531aef19885a392c939013ce36</id>
<content type='text'>
Currently, disabling a function only replaces the internal
function handler with one that throws a warning, and a few
places in the engine special-case such functions, such as
function_exists. This leaves us with a Schrödinger's function,
which both does not exist (function_exists returns false) and
does exist (you cannot define a function with the same name).
In particular, this prevents the implementation of robust
polyfills, as reported in https://bugs.php.net/bug.php?id=79382:

    if (!function_exists('getallheaders')) {
        function getallheaders(...) { ... }
    }

If getallheaders() is a disabled function, this code will break.

This patch changes disable_functions to remove the functions from
the function table completely. For all intents and purposes, it
will look like the function does not exist.

This also renders two bits of PHP functionality obsolete and thus
deprecated:

 * ReflectionFunction::isDisabled(), as it will no longer be
   possible to construct the ReflectionFunction of a disabled
   function in the first place.
 * get_defined_functions() with $exclude_disabled=false, as
   get_defined_functions() now never returns disabled functions.

Fixed bug #79382.

Closes GH-5473.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, disabling a function only replaces the internal
function handler with one that throws a warning, and a few
places in the engine special-case such functions, such as
function_exists. This leaves us with a Schrödinger's function,
which both does not exist (function_exists returns false) and
does exist (you cannot define a function with the same name).
In particular, this prevents the implementation of robust
polyfills, as reported in https://bugs.php.net/bug.php?id=79382:

    if (!function_exists('getallheaders')) {
        function getallheaders(...) { ... }
    }

If getallheaders() is a disabled function, this code will break.

This patch changes disable_functions to remove the functions from
the function table completely. For all intents and purposes, it
will look like the function does not exist.

This also renders two bits of PHP functionality obsolete and thus
deprecated:

 * ReflectionFunction::isDisabled(), as it will no longer be
   possible to construct the ReflectionFunction of a disabled
   function in the first place.
 * get_defined_functions() with $exclude_disabled=false, as
   get_defined_functions() now never returns disabled functions.

Fixed bug #79382.

Closes GH-5473.
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve undefined variable error messages</title>
<updated>2020-03-31T11:02:32+00:00</updated>
<author>
<name>Máté Kocsis</name>
<email>kocsismate@woohoolabs.com</email>
</author>
<published>2020-03-30T15:23:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/php-git.git/commit/?id=36935e42eac054a422b7edade69923db7727f268'/>
<id>36935e42eac054a422b7edade69923db7727f268</id>
<content type='text'>
Closes GH-5312
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes GH-5312
</pre>
</div>
</content>
</entry>
<entry>
<title>Reindent phpt files</title>
<updated>2020-02-03T21:52:20+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>nikita.ppv@gmail.com</email>
</author>
<published>2020-02-03T21:52:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/php-git.git/commit/?id=f8d795820e780a6322e054c26c581570613c14f0'/>
<id>f8d795820e780a6322e054c26c581570613c14f0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'PHP-7.4'</title>
<updated>2019-12-12T13:22:32+00:00</updated>
<author>
<name>Christoph M. Becker</name>
<email>cmbecker69@gmx.de</email>
</author>
<published>2019-12-12T13:22:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/php-git.git/commit/?id=4c5a178df86f338325cf801ae36beca741238739'/>
<id>4c5a178df86f338325cf801ae36beca741238739</id>
<content type='text'>
* PHP-7.4:
  Fix #78929: plus signs in cookie values are converted to spaces
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* PHP-7.4:
  Fix #78929: plus signs in cookie values are converted to spaces
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix #78929: plus signs in cookie values are converted to spaces</title>
<updated>2019-12-12T13:21:46+00:00</updated>
<author>
<name>Kachalin Alexey</name>
<email>kachalin.alexey@gmail.com</email>
</author>
<published>2019-12-12T10:49:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/php-git.git/commit/?id=79376ab209f61be03bbf8c1b6177c18261767da8'/>
<id>79376ab209f61be03bbf8c1b6177c18261767da8</id>
<content type='text'>
We switch the cookie value parsing function from `php_url_decode()` to
`php_raw_url_decode()`, so that cookie values are now parsed according
to RFC 6265, section 4.1.1.  We also refactor to remove duplicate code
without changing the execution flow.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We switch the cookie value parsing function from `php_url_decode()` to
`php_raw_url_decode()`, so that cookie values are now parsed according
to RFC 6265, section 4.1.1.  We also refactor to remove duplicate code
without changing the execution flow.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'PHP-7.4'</title>
<updated>2019-12-05T10:19:27+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>nikita.ppv@gmail.com</email>
</author>
<published>2019-12-05T10:19:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/php-git.git/commit/?id=cec7bd58f80c970543ff17144c73b4998631ca7e'/>
<id>cec7bd58f80c970543ff17144c73b4998631ca7e</id>
<content type='text'>
* PHP-7.4:
  Fix timeout tests
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* PHP-7.4:
  Fix timeout tests
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix timeout tests</title>
<updated>2019-12-05T10:19:23+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>nikita.ppv@gmail.com</email>
</author>
<published>2019-12-05T08:13:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/php-git.git/commit/?id=e760d94f4bb4d0802e89af0927cecfb479cba024'/>
<id>e760d94f4bb4d0802e89af0927cecfb479cba024</id>
<content type='text'>
After taking a more detailed look at our commonly failing timeout
tests... turns out that most of them are useless as written and
don't test what they're supposed to.

This PR has a couple of changes:

* Tests for timeout in while/for/foreach should just have the loop
as an infinite loop. Calling into something like busy_wait means
that we just end up always testing whatever busy_wait does.
* Tests for timeouts in calls need to be based on something like
sleep, otherwise we'd have to introduce a loop, and we'd end up
testing timeout of the looping structure instead. Using sleep only
works on Windows, because that's the only system where sleep counts
towards the timeout. As such, many of those tests are now Windows only.
* Removed some tests where I don't see a good way to test what they're
supposed to test. E.g. how can we test a timeout in eval() specifically?

The shutdown function tests are marked as XFAIL, as we are currently
missing a timeout check in call_user_function. I believe that's a
legitimate issue.

Closes GH-4969.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After taking a more detailed look at our commonly failing timeout
tests... turns out that most of them are useless as written and
don't test what they're supposed to.

This PR has a couple of changes:

* Tests for timeout in while/for/foreach should just have the loop
as an infinite loop. Calling into something like busy_wait means
that we just end up always testing whatever busy_wait does.
* Tests for timeouts in calls need to be based on something like
sleep, otherwise we'd have to introduce a loop, and we'd end up
testing timeout of the looping structure instead. Using sleep only
works on Windows, because that's the only system where sleep counts
towards the timeout. As such, many of those tests are now Windows only.
* Removed some tests where I don't see a good way to test what they're
supposed to test. E.g. how can we test a timeout in eval() specifically?

The shutdown function tests are marked as XFAIL, as we are currently
missing a timeout check in call_user_function. I believe that's a
legitimate issue.

Closes GH-4969.
</pre>
</div>
</content>
</entry>
</feed>
