Commit Graph

5350 Commits

Author SHA1 Message Date
Christoph M. Becker
864fb0ec23 Implement #47074: phpinfo() reports "On" as 1 for the some extensions
What is modified as boolean, should also be displayed as boolean.
2020-06-04 11:25:45 +02:00
Nikita Popov
698bd59fb5 Fix typo in skipif section
Merge mistake...
2020-06-03 14:50:35 +02:00
Nikita Popov
180b9af58a Merge branch 'PHP-7.4'
* PHP-7.4:
  Skip new watch point test under asan
2020-06-03 10:02:31 +02:00
Nikita Popov
2a7d628adc Skip new watch point test under asan 2020-06-03 10:01:57 +02:00
Christoph M. Becker
86057f5f44 Skip new test case on Windows when JIT is enabled
Cf. <http://git.php.net/?p=php-src.git;a=commit;h=c5cf0af8a98cbc574fd315bf9d78033b896886f3>.
2020-06-02 17:12:34 +02:00
Christoph M. Becker
486b8b1cd1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #73927: phpdbg fails with windows error prompt at "watch array"
2020-06-02 15:19:32 +02:00
Christoph M. Becker
af4a9bf1bf Fix #73927: phpdbg fails with windows error prompt at "watch array"
We expect zvals, so we should request zvals.

We also suppress spurious watchpoint removal notices.
2020-06-02 15:17:40 +02:00
Christoph M. Becker
520a403fcd Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79650: php-win.exe 100% cpu lockup
2020-06-01 13:25:58 +02:00
Christoph M. Becker
b26ad33001 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79650: php-win.exe 100% cpu lockup
2020-06-01 13:24:32 +02:00
Christoph M. Becker
923c45bdca Fix #79650: php-win.exe 100% cpu lockup
As of PHP 7.3.0, `sapi_cli_single_write()` is supposed to return `< 0`
on failure, but `fwrite()` returns a `size_t`, and signals error by
setting the stream's error indicator.  We have to cater to that.
2020-06-01 13:22:44 +02:00
Nikita Popov
7562679b45 Remove json checks in fuzzer SAPI
JSON is now always enabled
2020-05-29 12:08:45 +02:00
Nikita Popov
5716fa7f49 Make Exception::$previous a typed property
Exception::$previous is a private property, so we can add a type:

    private ?Throwable $previous = null;
2020-05-28 14:01:29 +02:00
Nikita Popov
aaae77f7f1 Make Exception::$trace typed array property
This is a private property, so we are allowed to add a type.
The new declaration of the property is:

    private array $trace = [];

This ensures that Exception::getTrace() does indeed return an array.

Userland code that was modifying the property through refleciton
may have to be adjusted to assign an array (instead of null,
for example).

Closes GH-5636.
2020-05-28 13:55:38 +02:00
Christoph M. Becker
c5cf0af8a9 Mark several phpdbg tests as xfail
Apparently, breakpoints and watchpoints are practically disabled if
run with OPcache JIT under Windows, so we mark the affected tests as
xfail in that case for the time being.
2020-05-27 11:39:15 +02:00
Máté Kocsis
fbe30592d6
Improve type error messages when an object is given
From now on, we always display the given object's type instead of just reporting "object".
Additionally, make the format of return type errors match the format of argument errors.

Closes GH-5625
2020-05-26 19:06:19 +02:00
Christoph M. Becker
d2508ef947 Merge branch 'PHP-7.4'
* PHP-7.4:
  Enable phpdbg tests on AppVeyor
  Make phpdbg test portable
  Fix several mostly Windows related phpdbg bugs
  Fix #73926: phpdbg will not accept input on restart execution
2020-05-26 17:46:56 +02:00
Christoph M. Becker
9d5dafe040 Make phpdbg test portable 2020-05-26 17:45:35 +02:00
Christoph M. Becker
8483a21f29 Fix several mostly Windows related phpdbg bugs
* Properly initialize PHPDBG_G(watch_tmp)

  Otherwise that may cause segfaults in ZTS builds.

* Deactivate potentially remaining watchpoints after REPL

  Otherwise the memory could still be protected, resulting in segfaults
  during shutdown.

* NULL zend_handlers_table after freeing

  As of commit 4130fe4[1], the `zend_handlers_table` is explicitly
  freed in the `zend_vm_dtor()`.  Since phpdbg (and maybe some other
  SAPIs) may restart the engine afterwards, we have to make sure that
  the table is also NULLed.

* Only set context option if there is a context

  In other words, we must not follow the null pointer.

* Cater to file handles without attached console

  File handles do not necessarily have an attached console (for
  instance, pipes do not), in which case `GetConsoleScreenBufferInfo()`
  fails.  In this case we set a default value (`40`) for lines like on
  other systems.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=4130fe437a5db7ead1444d3748bd0fbad9829cb2>
2020-05-26 17:45:25 +02:00
Christoph M. Becker
e483761a1e Fix #73926: phpdbg will not accept input on restart execution
We are more liberal, and accept Windows line endings (CRLF) as well.
2020-05-26 17:44:39 +02:00
Nikita Popov
0374cf08c7 Add --file-cache-prime/use options to run-tests
--file-cache-prime populates the file cache,
--file-cache-use uses the file cache.

And fix a number of tests to run under file cache or disabled
timestamp validation.
2020-05-20 15:29:32 +02:00
Christoph M. Becker
5211ddce0e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix INI setting member name
2020-05-19 16:01:48 +02:00
Christoph M. Becker
6a9db9573e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix INI setting member name
2020-05-19 16:00:19 +02:00
Christoph M. Becker
85ac5643ff Fix INI setting member name
Since the member is not used in `OnUpdateEol()` that's not really an
issue, but still it's confusing to apparently have two INI settings
targeting the same member.
2020-05-19 15:59:21 +02:00
Nikita Popov
c3bbcff5e6 Fix phpdbg test with JIT
With JIT one extra cache slot is allocated, so the extended_value
needs one more character, and the output ends up having one space
less...
2020-05-18 15:25:24 +02:00
George Peter Banyard
f717ec608d Adjust bogus checks in FPM as HAVE_FPM_LQ is always defined
Drop checks for FPM status as per review

Closes GH-5530
2020-05-17 22:04:35 +02:00
Nikita Popov
406c95758d Remove some uses of zend_inline_hash_func
There's no need to force-inline the hashing for all of these.
2020-05-15 10:14:22 +02:00
Máté Kocsis
68527a7834
Add stubs for some SAPIs
For apache2handler, fpm, litespeed, phpdbg, specifically.
Partially implements GH-5295
2020-05-14 13:35:12 +02:00
George Peter Banyard
c0997130ec Fix [-Wundef] warning in PHPDBG SAPI 2020-05-12 22:02:51 +02:00
George Peter Banyard
56698afb6d Fix [-Wundef] warning in CLI SAPI 2020-05-12 22:02:12 +02:00
George Peter Banyard
f87743de9f Fix [-Wundef] warning in FPM SAPI 2020-05-12 22:02:03 +02:00
Christoph M. Becker
9dcf494e36 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79489: .user.ini does not inherit
2020-05-12 11:49:04 +02:00
Christoph M. Becker
4b0d5e0faf Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79489: .user.ini does not inherit
2020-05-12 11:48:36 +02:00
Christoph M. Becker
bdba0cd3d2 Fix #79489: .user.ini does not inherit
On Windows, PATH_TRANSLATED may contain backslashes as well as slashes,
so we must not only check for `DEFAULT_SLASH`.
2020-05-12 11:47:47 +02:00
Nikita Popov
c50cfc4d3d Add quiet parameter to internal HTML entities API
In some places, we need to make sure that no warnings are thrown
due to unknown encoding. The error reporting code tried to avoid
this by determining a "safe charset", but this introduces subtle
discrepancies in which charset is picked (normally
internal_encoding takes precedence). Avoid this by suppressing
the warning in the first place.

While here, use the fallback logic to print error messages with
substitution characters more consistently, to avoid skipping
parts of the error message entirely.
2020-05-07 15:46:08 +02:00
Alex Dowad
8ddaf13ed3 Code tweaks: Remove unneeded semicolons 2020-04-29 23:17:40 +02:00
Máté Kocsis
33c3691c33
Generate method entries from stubs for Zend classes
Closes GH-5459
2020-04-26 11:13:14 +02:00
George Peter Banyard
f91f72607b Drop unnecessary stdint and inttypes header checks
These are always available as of C99.

Closes GH-5323

Co-authored-by: "Christoph M. Becker" <cmbecker69@gmx.de>
2020-04-22 20:18:19 +02:00
Máté Kocsis
6111d64cda
Improve a last couple of argument error messages
Closes GH-5404
2020-04-20 13:09:00 +02:00
Christoph M. Becker
193cb97a0e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79491: Search for .user.ini extends up to root dir
2020-04-20 11:00:01 +02:00
Christoph M. Becker
18ad38a7b2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79491: Search for .user.ini extends up to root dir
2020-04-20 10:58:33 +02:00
Christoph M. Becker
fa10abd6d7 Fix #79491: Search for .user.ini extends up to root dir
The `start` parameter of `php_cgi_ini_activate_user_config` is supposed
to hold the byte offset of the doc root in the given `path`.  However,
the current expression which fixes a potential type incompatibility
will ever only evaluate to zero or one, because it uses the *logical*
and operator (`&&`).  Furthermore we notice that subtracting one from
`doc_root_len` is not necessary, so there is even no need for the
`start` parameter at all.
2020-04-20 10:56:36 +02:00
Nikita Popov
ae5d7e4e96 Merge branch 'PHP-7.4'
* PHP-7.4:
  Apply doc root fix for FPM
2020-04-20 10:48:20 +02:00
Nikita Popov
721ca87e56 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Apply doc root fix for FPM
2020-04-20 10:48:05 +02:00
Nikita Popov
f62571c121 Apply doc root fix for FPM
This is the change from GH-5417 but for FPM. This was stripping the
last character from the doc_root. Given how it is used, this should
be harmless, but let's make it less confusing...
2020-04-20 10:47:54 +02:00
Nikita Popov
d68dfaf05e Remove return value from llist apply functions
Unlike the hash apply functions, these do not return int.
2020-04-15 11:01:12 +02:00
Máté Kocsis
3709e74b5e
Store default parameter values of internal functions in arg info
Closes GH-5353. From now on, PHP will have reflection information
about default values of parameters of internal functions.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-04-08 18:37:51 +02:00
Nikita Popov
b0d8f012f9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add php_cli_server_connect() helper
2020-04-08 17:11:50 +02:00
Nikita Popov
1327491224 Add php_cli_server_connect() helper
To encapsulate the repeated fsockopen() code.

This gives us a chance to control the timeout in one place:
Raise it to one second.
2020-04-08 17:10:20 +02:00
Christoph M. Becker
6a67067c21 Merge branch 'PHP-7.4'
* PHP-7.4:
  Relax overly strict test expectation
2020-04-08 11:35:28 +02:00
Christoph M. Becker
73a0719f45 Relax overly strict test expectation
There is no reason to expect a `1` after the PID; neither the session
ID nor the memory usage are required to contain one.  Actually, we just
want to verify here, that the process with the $child_pid is running,
and is a php.exe process.
2020-04-08 11:34:18 +02:00