1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 11:42:17 +02:00
Commit Graph

119287 Commits

Author SHA1 Message Date
Nikita Popov
315ea609da Remove restriction on method call inlining
In PHP 8, we are guaranteed that $this exists, so we no longer have
to forbid this case.
2020-06-29 09:54:31 +02:00
Nikita Popov
bc62acf874 Merge branch 'PHP-7.4'
* PHP-7.4:
  Don't inline static call to instance method
2020-06-29 09:53:09 +02:00
Nikita Popov
fabcd9f14e Don't inline static call to instance method
Fixes the failure in bug79740.phpt with opcache.
2020-06-29 09:52:37 +02:00
George Peter Banyard
562ceae7bc Drop non-well formed numeric strings from math function tests 2020-06-28 19:32:11 +02:00
George Peter Banyard
892b32d839 Drop non-well numeric string in Intl test 2020-06-28 19:30:07 +02:00
George Peter Banyard
a9625f8b35 Drop non-well formed numeric strings in array function tests 2020-06-28 19:29:37 +02:00
George Peter Banyard
76643cd4f3 Drop non-well formed numeric strings in strings function tests 2020-06-28 19:29:14 +02:00
Nikita Popov
956dde0bc0 Simplify and fix php-cgi detection
Make it work for installed PHP binaries.
2020-06-26 14:17:56 +02:00
Nikita Popov
f930978b70 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79741
2020-06-26 12:29:43 +02:00
Nikita Popov
978cdb736a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79741
2020-06-26 12:29:23 +02:00
Nikita Popov
43cd3f6814 Fixed bug #79741 2020-06-26 12:28:39 +02:00
David Carlier
1cbb62e82d Haiku proc_open build fix, *pty api resides on the BSD library
Closes GH-5770.
2020-06-26 12:06:21 +02:00
Nikita Popov
f89d84d622 Better leak fix for cgi -s / -w
We also need to go through request shutdown. The naming is a bit
confusing, but it's fine to go through fastcgi_request_done even
if not using fastcgi. Whether we loop or not is checked separately.
2020-06-26 11:07:55 +02:00
Nikita Popov
1314ccbf8c Cache __unserialize() instead of unserialize()
We should use these cache slots for the new object serialization
mechanism rather than the old one.
2020-06-26 10:54:40 +02:00
Nikita Popov
b6deace022 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79740
2020-06-26 10:33:12 +02:00
Nikita Popov
c5caa05171 Fixed bug #79740 2020-06-26 10:31:55 +02:00
Dmitry Stogov
9617c2a2f6 Use cheaper zend_hash_find_ex() to handle IS_CONST index 2020-06-26 11:18:04 +03:00
Nikita Popov
bcd7352b0c Fix uninitialized reads in min/max
We need to use the unstable comparison function here, the fallback
order is not initialized in this context.
2020-06-26 09:36:17 +02:00
Nikita Popov
afafe5443c Clear last error before shutting down memory manager
The last error is allocated using ZMM, make sure it's cleared
beforehand.

It would probably be better to allocate it persistently outside
of requests.
2020-06-26 09:30:08 +02:00
Ayesh Karunaratne
d114812faf [ci skip] Various typo fixes in stub comments and CHANGES file 2020-06-25 23:32:40 +02:00
Dmitry Stogov
7e940823d5 Fixed incorrect type guard 2020-06-25 21:59:48 +03:00
Dmitry Stogov
4e7cac810f Move exception check to cold path. 2020-06-25 20:11:23 +03:00
Dmitry Stogov
037bfabd75 Optimization for +/- int(0) 2020-06-25 19:09:54 +03:00
Dmitry Stogov
50af4de0fe Improve tracing JIT for FETCH_THIS + FETCH_OBJ_* 2020-06-25 17:33:53 +03:00
Nikita Popov
a1c6a7a3f2 Fix leaks in cgi strip/highlight mode 2020-06-25 16:06:33 +02:00
Nikita Popov
785497c8ba Fix leaks in Phar::webPhar() 2020-06-25 15:42:56 +02:00
Nikita Popov
c9bc7dd110 Don't throw warning if exception thrown during dom validation 2020-06-25 15:24:35 +02:00
Nikita Popov
049467d365 Avoid warning on exception in xsl ext 2020-06-25 15:07:38 +02:00
Remi Collet
5c37715dfd ensure all files have same date in official archives 2020-06-25 14:59:10 +02:00
Dmitry Stogov
94b637de5b Avoid $this check 2020-06-25 14:08:21 +03:00
Dmitry Stogov
1434983ad1 Cheaper exception checks 2020-06-25 13:23:43 +03:00
Nikita Popov
47cf18ba4e Don't include trailing newline in comment token
Don't include a trailing newline in T_COMMENT tokens, instead leave
it for a following T_WHITESPACE token. The newline does not belong
to the comment logically, and this makes for an ugly special case,
as other tokens do not include trailing newlines.

Whitespace-sensitive tooling will want to either forward or backward
emulate this change.

Closes GH-5182.
2020-06-25 11:25:22 +02:00
Nikita Popov
e12b9df05d Make sorting stable
Make user-exposed sorts stable, by storing the position of elements
in the original array, and using those positions as a fallback
comparison criterion. The base sort is still hybrid q/insert.

The use of true/false comparison functions is deprecated (but still
supported) and should be replaced by -1/0/1 comparison functions,
driven by the <=> operator.

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

Closes GH-5236.
2020-06-25 10:49:34 +02:00
Nikita Popov
f9462fe6e4 Increase timeout on sanitizer job
This is starting to hit the limit. Let it run for 3:30 hours.
2020-06-25 10:36:19 +02:00
Nikita Popov
f37138d2c5 Don't use iterator_funcs_ptr if it is null
This avoids ubsan warnings. Alternatively we could always initialize
iterator_funcs_ptr for aggregates, instead of doing so only for
non-internal ones.
2020-06-25 10:30:40 +02:00
Alex Dowad
47fae8425f Remove useless prototype for spl_heap_get_iterator 2020-06-24 22:29:07 +02:00
Alex Dowad
c4f716a20d Fix {{{ comment to match function name for php_replace_controlchars_ex 2020-06-24 22:26:00 +02:00
Alex Dowad
e673c63989 Correct comment in plain_wrapper.c (refers to microseconds, not milliseconds) 2020-06-24 22:26:00 +02:00
Alex Dowad
7b4179e8da Update UPGRADING.INTERNALS re: removed --disable-inline-optimization switch
This build configuration switch was removed in 3a19726bce.
2020-06-24 20:25:11 +02:00
Nikita Popov
4c8ba98751 Sort extensions alphabetically
This makes it easier to compare mime data from different sources.
2020-06-24 16:59:42 +02:00
Nikita Popov
5889c41c76 Generate tabs in generate_mime_type_map.php
The PHP file is space indented, but we need the C file to be tab
indented.
2020-06-24 16:31:46 +02:00
Nikita Popov
ff19ec2df3 Introduce InternalIterator
Userland classes that implement Traversable must do so either
through Iterator or IteratorAggregate. The same requirement does
not exist for internal classes: They can implement the internal
get_iterator mechanism, without exposing either the Iterator or
IteratorAggregate APIs. This makes them usable in get_iterator(),
but incompatible with any Iterator based APIs.

A lot of internal classes do this, because exposing the userland
APIs is simply a lot of work. This patch alleviates this issue by
providing a generic InternalIterator class, which acts as an
adapater between get_iterator and Iterator, and can be easily
used by many internal classes. At the same time, we extend the
requirement that Traversable implies Iterator or IteratorAggregate
to internal classes as well.

Closes GH-5216.
2020-06-24 15:31:41 +02:00
Nikita Popov
4730b06f1d Make SimpleXMLElement a RecursiveIterator
Context: https://externals.io/message/108789

This essentially moves the functionality of SimpleXMLIterator into
SimpleXMLElement, and makes SimpleXMLIterator a no-op extension.

Ideally SimpleXMLElement would be an IteratorAggregate, whose
getIterator() method returns SimpleXMLIterator. However, because
SimpleXMLIterator extends SimpleXMLElement (and code depends on
this in non-trivial ways), this is not possible.

The only way to not keep SimpleXMLElement as a magic Traversable
(that implements neither Iterator nor IteratorAggregate) is to
move the SimpleXMLIterator functionality into it.

Closes GH-5234.
2020-06-24 15:09:21 +02:00
Máté Kocsis
bcb9658b87 Add the ZEND_ACC_NO_DYNAMIC_PROPERTIES flag to Shmop 2020-06-24 14:56:06 +02:00
Nikita Popov
1af78bc8a4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79030 Use usec from apache request time
2020-06-24 14:43:13 +02:00
Nikita Popov
5435a4a9d4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79030 Use usec from apache request time
2020-06-24 14:43:02 +02:00
Herbert256
4a26628b29 Fixed bug #79030 Use usec from apache request time
Don't unnecessarily truncate to milliseconds.

Closes GH-5760.
2020-06-24 14:41:50 +02:00
Christoph M. Becker
18f58080dc Convert shmop resources to opaque objects
We make `shmop_close()` a NOP, and deprecate the function right away;
detaching from SHM now happens when the wrapper object is freed.
2020-06-24 13:59:29 +02:00
Alex Dowad
19d3e29bf5 Clean house in cryptographic hashing code
- Remove dead code from php_crypt_r.c

  This code has been commented out since the file was added in 2008. It's safe to say
  that no-one is ever going to use it.

- Fix typo in comment in php_crypt_r.c

- Remove redundant Windows-only implementation of php_md5_crypt_r

  There is a portable implementation in the same file, which is selected if not
  building for Windows. But why should Windows have its own special implementation
  of this function at all? There doesn't seem to be any good reason.

  Better to use the portable implementation on all platforms.

- Don't define useless __CONST macro in php_crypt_r.h

  This preprocessor macro is not used anywhere.

- Add comment on functions for encoding data as Base64

- Remove dead code from crypt_blowfish.h

- Remove unneeded junk comments from crypt_freesec.c

- Remove dead code from crypt_blowfish.c

  This function has been commented out since 2011.
2020-06-24 13:40:27 +02:00
Alex Dowad
e94afec700 Fix typos in test cases for crypt_sha{256,512} 2020-06-24 13:37:26 +02:00