Commit graph

200 commits

Author SHA1 Message Date
Michael Voříšek
5239f9fc86 Remove CTE flag from array_diff_ukey(), which was added by mistake
This was accidentally added in GH-7780, but since it takes a callable
argument, this flag is useless on this function.

Closes GH-10859.
2023-03-15 21:40:11 +01:00
Michael Voříšek
411cd04541 Re-add some CTE functions that were removed from being CTE by a mistake
These functions were accidentally removed from being CTE in GH-7780.
This patch brings them back.

Closes GH-10768.
2023-03-07 20:30:11 +01:00
Máté Kocsis
3227d04fa9
Declare ext/standard constants in stubs - part 7 (#9505) 2022-09-08 13:57:07 +02:00
Máté Kocsis
c547fc183c
Add support for validation of missing class synopses (#9472) 2022-09-05 14:21:15 +02:00
Máté Kocsis
e733ebf30e
Add parenthesis around preprocessor conditions in stubs
gen_stub.php concatenates nested #ifs into one #if so let's make sure the semantics remain the same.
2022-09-02 16:21:28 +02:00
Máté Kocsis
cfa72ff3af
Declare ext/standard constants in stubs - part 6
Closes GH-9467
2022-09-02 16:07:25 +02:00
Máté Kocsis
6f2f228e4a
Declare ext/standard constants in stubs - part 5
Closes GH-9466
2022-09-02 15:04:49 +02:00
Máté Kocsis
64b962b241
Declare ext/standard constants in stubs - part 4
Closes GH-9465
2022-09-02 12:41:51 +02:00
Tim Düsterhus
c77bbf6fe5
Mark crypt()'s $string parameter as #[\SensitiveParameter] 2022-08-30 20:02:28 +02:00
Máté Kocsis
adb45a63c0
Fix GH-9186 @strict-properties can be bypassed using unserialization (#9354)
* Emit deprecation warnings when adding dynamic properties to classes during unserialization - this will become an Error in php 9.0.
  (Adding dynamic properties in other contexts was already a deprecation warning - the use case of unserialization was overlooked)
* Throw an error when attempting to add a dynamic property to a `readonly` class when unserializing
* Add new serialization methods `__serialize`/`__unserialize` for SplFixedArray to avoid creating deprecated dynamic
  properties that would then be added to the backing fixed-size array
* Don't add named dynamic/declared properties (e.g. $obj->foo) of SplFixedArray to the backing array when unserializing
* Update tests to declare properties or to expect the deprecation warning
* Add news entry

Co-authored-by: Tyson Andre <tysonandre775@hotmail.com>
2022-08-30 07:46:32 -04:00
Máté Kocsis
ef72d53397
Declare ext/standard constants in stubs - part 3 (#9427) 2022-08-26 14:47:34 +02:00
Máté Kocsis
bc4c012611
Declare ext/standard constants in stubs - part 1 (#9404) 2022-08-24 16:09:48 +02:00
Ilija Tovilo
98bdb7f99b
Make pestr[n]dup infallible (#9295)
Fixes GH-9128
Closes GH-9295
2022-08-12 12:21:14 +02:00
Michael Voříšek
b0c0a2cfb4
Use -1 "precision" in gen_stub.php
Closes GH-8734.
2022-07-23 12:09:37 +02:00
Máté Kocsis
e328c68305
Rename @cname to @cvalue in stubs (#9043)
@cname currently refers to the constant name in C. However, it is not always a (constant) name, but sometimes a function invocation, so naming it as @cvalue would be more appropriate.
2022-07-19 15:11:42 +02:00
Go Kudo
4d8dd8d258
Implement Random Extension
https://wiki.php.net/rfc/rng_extension
https://wiki.php.net/rfc/random_extension_improvement
2022-07-19 10:27:38 +01:00
Ilija Tovilo
63912b5ecd
Fix RC func info of str_split (#9016)
Introduced in GH-8945

With RETURN_EMPTY_ARRAY this function can now return an interned array which
has refcount 2.
2022-07-15 11:23:55 +02:00
Tim Düsterhus
342e18f105
Support the actual #[\SensitiveParameter] attribute in stubs (#8836) 2022-07-12 12:43:44 +02:00
Dennis Snell
492af9f88e
Add ini_parse_quantity function to convert ini quantities shorthand notation to int (#8454) 2022-07-10 14:48:52 +02:00
Máté Kocsis
49d3dde211
Declare true return types (#8759) 2022-06-18 22:06:50 +02:00
Tim Düsterhus
13758965b2 Mark parameter in ext/standard as sensitive
No changes to the stubs required, password_hash and password_verify were added
to the initial version of the stub support.
2022-06-13 11:09:12 +02:00
Rowan Tommins
d9f3ca705c
Add deprecation notices to utf8_encode and utf8_decode
Implements initial stage of accepted RFC to remove them:
https://wiki.php.net/rfc/remove_utf8_decode_and_utf8_encode

Tests relating to SOAP and htmlspecialchars seem to have been
using this entirely unnecessarily, so have been fixed.

Closes GH-8726.
2022-06-12 13:37:23 +02:00
Máté Kocsis
debd38f851 Add support for sensitive parameters in stubs 2022-06-04 18:15:05 +02:00
Máté Kocsis
14da1cb909
Add support for class constants in stubs (#7434) 2022-05-22 22:27:23 +02:00
George Peter Banyard
8649cb8a96
Improve and fix stub return types (#8368) 2022-04-14 18:38:00 +01:00
Christoph M. Becker
53c6619bda
Restore memory_reset_peak_usage() declaration
Cf. <https://github.com/php/php-src/pull/8151/files#r819605725>.
2022-04-01 18:13:22 +02:00
George Peter Banyard
083b64efb5 Add missing #endif in stubs
This slipped away during the rebase of 5171cb435a
2022-04-01 16:26:38 +01:00
George Peter Banyard
5171cb435a Fix [-Wundef] warnings in standard extension 2022-04-01 15:48:41 +01:00
Nikita Popov
c4334fc616 Remove special chr/count handling in sccp function evaluation
These can be handled by the generic code. Worth noting that count
will usually go through ZEND_COUNT, and chr on constants is
evaluated in the compiler, so these are not particularly compile-time
sensitive either.
2021-12-26 09:55:18 +01:00
Christoph M. Becker
5ddf191da2
Merge branch 'PHP-8.1'
* PHP-8.1:
  $context parameter of get_headers() is nullable
2021-12-23 11:50:53 +01:00
Christoph M. Becker
ccd7d410f1
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  $context parameter of get_headers() is nullable
2021-12-23 11:49:33 +01:00
Christoph M. Becker
c5f4ee50ab
$context parameter of get_headers() is nullable
Closes GH-7813.
2021-12-23 11:47:20 +01:00
Tyson Andre
32e2d97a26
Allow internal functions to declare if they support compile-time evaluation, add functions. (#7780)
https://wiki.php.net/rfc/strtolower-ascii means that these functions no longer
depend on the current locale in php 8.2. Before that, this was unsafe to
evaluate at compile time.

Followup to GH-7506

Add strcmp/strcasecmp/strtolower/strtoupper functions

Add bin2hex/hex2bin and related functions

Update test of garbage collection using strtolower to use something else to create a refcounted string
2021-12-20 09:27:06 -05:00
Máté Kocsis
220f0f55cf
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix the return type of imagecolorexactalpha()
  String default values are enclosed in quotes rather than apostrophes
2021-10-12 09:53:30 +02:00
Máté Kocsis
2127b49c65
String default values are enclosed in quotes rather than apostrophes 2021-10-12 09:51:20 +02:00
Craig Francis
2b25ac6f3c Update stub to show default of ENT_HTML401 (for documentation)
Closes GH-7514.
2021-09-29 12:14:29 +02:00
Máté Kocsis
c19e4b9997
Generate optimizer func info from stubs for ext/standard - part 3 (#7426) 2021-08-30 15:56:47 +02:00
Nikita Popov
0f7e0cf34b str_replace() can return the original string 2021-08-30 10:23:09 +02:00
Máté Kocsis
b49d340f74
Generate optimizer func info from stubs for ext/standard - part 2 (#7414) 2021-08-27 16:54:04 +02:00
Máté Kocsis
1ce81b6bcd
Generate optimizer func info from stubs for ext/standard - part 1 (#7413) 2021-08-27 13:11:57 +02:00
Máté Kocsis
b1822899fc
Add support for generating optimizer function info from stubs (#7367) 2021-08-24 16:35:33 +02:00
Máté Kocsis
b4b980e6ad
Merge branch 'PHP-8.0'
* PHP-8.0:
  Declare a few missing function return types
2021-08-24 11:43:31 +02:00
Máté Kocsis
c58a9f2a57
Declare a few missing function return types
Closes GH-7395
2021-08-24 11:38:50 +02:00
Nikita Popov
bed7139375 Deprecate strptime()
Use date_parse_from_format() or IntlDateFormatter::parse() instead.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-09 10:03:45 +02:00
Joe Watkins
ec9ce49c8e
Merge branch 'PHP-8.0'
* PHP-8.0:
  fix bad refactor of #7136
2021-06-11 09:34:03 +02:00
Joe Watkins
b10bcb4faa
fix bad refactor of #7136 2021-06-11 09:33:55 +02:00
Joe Watkins
9068b27974
Merge branch 'PHP-8.0'
* PHP-8.0:
  Enable net_get_interfaces on IBM i PASE
2021-06-11 09:14:17 +02:00
Calvin Buckley
4f51a11a84
Enable net_get_interfaces on IBM i PASE
On IBM i, getifaddrs is available renamed as Qp2getifaddrs; freeifaddrs
and struct ifaddr follow a similar fate. I assume this is in case AIX
decides to add it (as if). As such, just use the same implementation,
but rename the standard ones to the IBM i definitions and include its
header.
2021-06-11 09:12:49 +02:00
Máté Kocsis
b4b848bfa7
Fix the signature of ini_alter()
It should be the same as ini_set()
2021-05-26 12:32:38 +02:00
Nikita Popov
e8ef923dd6 Merge branch 'PHP-8.0'
* PHP-8.0:
  Remove assert_options() return value info
2021-04-28 11:06:54 +02:00