Commit Graph

631 Commits

Author SHA1 Message Date
Derick Rethans
78937c93ef Merge branch 'PHP-8.2' 2023-03-09 13:39:31 +00:00
Derick Rethans
a45bef0ac6 Merge branch 'PHP-8.1' into PHP-8.2 2023-03-09 13:37:19 +00:00
Derick Rethans
717335ec63 Fixed macro generation for variadics, which don't have a default value 2023-03-09 11:39:22 +00:00
Michael Orlitzky
fa65873502 */*.m4: update main() signatures.
The next generation of C compilers is going to enforce the C standard
more strictly:

  https://wiki.gentoo.org/wiki/Modern_C_porting

One warning that will soon become an error is -Wstrict-prototypes.
This is relatively easy to catch in most code (it will fail to
compile), but inside of autoconf tests it can go unnoticed because
many feature-test compilations fail by design. For example,

  $ export CFLAGS="$CFLAGS -Werror=strict-prototypes"
  $ ./configure
  ...
  checking if iconv supports errno... no
  configure: error: iconv does not support errno

(this is on a system where iconv *does* support errno). If errno
support were optional, that test would have "silently" disabled
it. The underlying issue here, from config.log, is

  conftest.c:211:5: error: function declaration isn't a prototype
  [-Werror=strict-prototypes]
    211 | int main() {

This commit goes through all of our autoconf tests, replacing main()
with main(void). Up to equivalent types and variable renamings, that's
one of the two valid signatures, and satisfies the compiler (gcc-12 in
this case).

Fixes GH-10751
2023-03-07 15:32:30 +00:00
Máté Kocsis
368febbf89
Remove unnecessary workaround for the true type 2023-03-07 09:08:16 +01:00
Bob Weinand
145602f38e Fix bug in zend_test assuming null not being the first type
(I agree that null should come last, but then it should rather throw with a proper message than emit an undefined key warning.)

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2023-02-28 12:01:41 +01:00
Bob Weinand
81abd8dc37 Allow gen_stub.php to parse and ignore extended docblock types
Extended docblock types, according to psalm or phpstan conventions may include array shapes, callable signatures etc.. These are now ignored by ignoring any nested parenthesized expression (followed by optional :type) at the end of the type.
2023-02-27 17:30:28 +01:00
Máté Kocsis
a981ad7ad2
Merge branch 'PHP-8.2'
* PHP-8.2:
  Add support for generating namespaced constant
2023-02-23 10:49:40 +01:00
SATO Kentaro
7fccdf72a4
Add support for generating namespaced constant
Closes GH-10552
2023-02-23 10:05:30 +01:00
Kévin Dunglas
c4c861b01a make clean: remove ext/opcache/minilua
Closes GH-10656.
2023-02-21 21:24:16 +00:00
Frank Du
a9437ceb6f
base64: add avx512 and vbmi version. (#6361)
1. Implementation based on https://github.com/WojciechMula/base64simd
2. Only runtime path is added to reduce the complexity of SIMD variants.
3. Expand test case to cover SIMD implementation.

Signed-off-by: Frank Du <frank.du@intel.com>
2023-02-13 03:30:47 +00:00
Derick Rethans
df853cb305 Bump minimum re2c version requirement to 1.0.3
The release VMs already enforced this, but PHP's configure script did
not.

re2c 0.13.5, which timelib's date/time parser requires is no longer
compatible with the current version of Zend/zend_language_scanner.l, as
it starts spinning in a loop.
2023-02-09 10:59:58 +00:00
Alex Dowad
c8ec2ed730 Add AVX2-accelerated UTF-16 decoding/encoding routines
As with other SIMD-accelerated functions in php-src, the new UTF-16
encoding and decoding routines can be compiled either with AVX2
acceleration "always on", "always off", or else with runtime detection
of AVX2 support.

With the new UTF-16 decoder/encoder, conversion of extremely short
strings (as in several bytes) has the same performance as before,
and conversion of medium-length (~100 character) strings is about 65%
faster, but conversion of long (~10,000 character) strings is around
6 times faster.

Many other mbstring functions will also be faster now when handling
UTF-16; for example, mb_strlen is almost 3 times faster on medium
strings, and almost 9 times faster on long strings. (Why does mb_strlen
benefit more from AVX2 acceleration than mb_convert_encoding? It's
because mb_strlen only needs to decode, but not re-encode, the input
string, and the UTF-16 decoder benefits much more from SIMD
acceleration than the UTF-16 encoder.)
2023-02-05 20:06:42 +02:00
Bob Weinand
cf1d21edbd Add a couple clarifying comments 2023-01-22 21:24:54 +01:00
Bob Weinand
1fbe855971 Honor constant expressions instead of just taking the last constant encountered in stubs
As an example:
should be translated to:
ZVAL_LONG(&attribute_Attribute_class_test_arg0, ZEND_ATTRIBUTE_TARGET_FUNCTION | ZEND_ATTRIBUTE_TARGET_METHOD);
2023-01-22 21:24:54 +01:00
Max Kellermann
7473b86f10
build/php.m4: remove test for integer types (#10304)
These are mandatory in C99, so it's a pointless waste of time to check
for them.

(Actually, the fixed-size integer types are not mandatory, but if they
are really not available on some theoretical system, PHP's fallbacks
won't work either, so nothing is gained from this check.)
2023-01-13 11:51:15 +00:00
Máté Kocsis
c90c944126
Merge branch 'PHP-8.2'
* PHP-8.2:
  Better document constructors
  Do not display non-existent constructors
  Do not list private constructors as inherited
2023-01-01 10:49:39 +01:00
Máté Kocsis
7b08fe9f2d Do not list private constructors as inherited 2023-01-01 10:47:16 +01:00
Máté Kocsis
38e138798d Do not display non-existent constructors 2023-01-01 10:47:16 +01:00
Máté Kocsis
eebf3bc0ba Better document constructors
Until https://github.com/php/php-src/pull/10098 default constructors were sometimes documented, sometimes omitted. The above PR made adding documentation for constructor of all non-abstract classes required. However, this is not desired when such a class inherits a constructor from its parent. The current PR fixes the behavior the following way:
- documents inherited constructors (along with destructors)
- makes it possible to generate/replace the methodsynopsis of implicit default constructors which don't have a stub counterpart
2023-01-01 10:47:16 +01:00
Arnaud Le Blanc
a11c8a3039
Limit stack size (#9104) 2022-12-16 17:44:26 +01:00
Máté Kocsis
dc54e04ed4
Merge branch 'PHP-8.2'
* PHP-8.2:
  Only include the default constructor for non-abstract class synopses
2022-12-16 17:03:22 +01:00
Máté Kocsis
d832125b8e
Only include the default constructor for non-abstract class synopses 2022-12-16 17:02:35 +01:00
Máté Kocsis
8afc55870e
Merge branch 'PHP-8.2'
* PHP-8.2:
  Replace another root XML element format to the "canonical" one
  Remove the superfluous closing parentheses from class synopsis page includes
  Always include the constructor on the class manual pages
  Backport methodsynopsis role attributes changes from master
2022-12-16 13:21:39 +01:00
Máté Kocsis
6aa5e58414 Backport methodsynopsis role attributes changes from master
Commits 93605f286d and d6651426f4
2022-12-16 13:18:12 +01:00
Máté Kocsis
0fc60fab72 Always include the constructor on the class manual pages 2022-12-16 13:18:12 +01:00
Máté Kocsis
b4df038cee Remove the superfluous closing parentheses from class synopsis page includes 2022-12-16 13:18:12 +01:00
Máté Kocsis
60cf9fbee0 Replace another root XML element format to the "canonical" one 2022-12-16 13:18:12 +01:00
Máté Kocsis
d6651426f4
Escape the role attribute of namespaced classes (#9952) 2022-11-15 18:13:29 +01:00
Máté Kocsis
93605f286d
Make the usage of the role attribute more clear (#9901)
Currently, the role attribute is mainly used to differentiate OO and procedural "aliases" when they are documented on the same page (e.g. https://www.php.net/manual/en/datetime.diff.php). However, these function-method counterparts are not always aliases in fact according to the stubs (#9491). That's why sometimes the usage of the role attribute is ambiguous, thus syncing the manual with the stubs results in false positive diffs.

This change fixes the problem by a very obtrusive way: by changing the value of all role="oop" attributes to the actual class name, like role="DateTime", and by getting rid of all role="procedural" attributes as they became unnecessary. This way, class synopsis pages can clearly reference methods, and skip functions. Additionally, gen_stub.php will be able to generate the correct methodsynopsis role even though a single page describes multiple methods, like `DateTime/DateTimeImmutable/DateTimeInterface::diff()`.
2022-11-10 08:35:46 +01:00
Máté Kocsis
a14e125baf
Merge branch 'PHP-8.2'
* PHP-8.2:
  Do not display the value of UNKNOWN constants in the manual (#9843)
2022-10-30 14:58:58 +01:00
Máté Kocsis
721e604a69
Do not display the value of UNKNOWN constants in the manual (#9843) 2022-10-30 14:58:16 +01:00
Máté Kocsis
aba11b670c
Merge branch 'PHP-8.2'
* PHP-8.2:
  Generate constant declarations with the CONST_CS flag for PHP 7.x
2022-10-10 11:13:00 +02:00
Máté Kocsis
69ef3247fd
Generate constant declarations with the CONST_CS flag for PHP 7.x 2022-10-10 11:12:20 +02:00
Máté Kocsis
c153ec877f
Merge branch 'PHP-8.2'
* PHP-8.2:
  Improve string class constant code generation
2022-09-26 23:13:31 +02:00
Máté Kocsis
e4f2376919
Improve string class constant code generation (#9577)
Using strlen() will make sure that non-constant values can also be used.
2022-09-26 23:12:34 +02:00
Máté Kocsis
ab6d449b3a
Merge branch 'PHP-8.2'
* PHP-8.2:
  Use PHP 7.4 syntax in gen_stub.php
2022-09-11 07:51:52 +02:00
Máté Kocsis
8b632749d7
Use PHP 7.4 syntax in gen_stub.php 2022-09-11 07:51:28 +02:00
Máté Kocsis
b2234a0f26
Merge branch 'PHP-8.2'
* PHP-8.2:
  Require PHP 7.4 at least for running the build system
2022-09-10 18:33:50 +02:00
Máté Kocsis
4af695e908
Require PHP 7.4 at least for running the build system (#9519) 2022-09-10 18:31:43 +02:00
Nikita Popov
36fdc6fdc0 Check that all preprocessor conditions are terminated 2022-09-10 18:17:51 +02:00
Máté Kocsis
6904019f13
Merge branch 'PHP-8.2'
* PHP-8.2:
  Validate if the refpurpose and the description is in sync (#9510)
2022-09-09 11:55:09 +02:00
Máté Kocsis
e0422979f6
Validate if the refpurpose and the description is in sync (#9510) 2022-09-09 11:54:38 +02:00
Ilija Tovilo
ecc3fc180f
Use PDEATHSIG to kill cli-server workers if parent exists
Closes GH-9476
2022-09-08 10:48:20 +02:00
Máté Kocsis
ce058273ba
Add support for validation of missing method synopses (#9491) 2022-09-07 17:40:36 +02:00
Máté Kocsis
05aa3b3e0a
Upgrade PHP parser to 4.15.1
It contains some useful fixes
2022-09-06 14:09:47 +02:00
Máté Kocsis
c547fc183c
Add support for validation of missing class synopses (#9472) 2022-09-05 14:21:15 +02:00
Andreas Braun
f7d42f646b
Update gen_stub to avoid compile errors on duplicate function names
Closes GH-9406
2022-08-30 11:33:45 +02:00
Máté Kocsis
b4ec3e9bc0
Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
Remi Collet
aa702c5459
add compat stuff for function attributes 2022-08-18 13:46:55 +02:00