Gregor Harlan
a6e3ce4fd6
datetime: new format "p", same as "P" but returning "Z" for UTC
2020-08-03 10:44:48 +02:00
Nikita Popov
bb8b95be63
Fix bug #79925
...
If the expected return type of a magic method is "object", we also
need to allow class types and "static" to comply with covariance.
2020-08-03 10:35:26 +02:00
Nikita Popov
5d4659c25c
Enforce __set_state() parameter type
...
This fixes one of the issues reported in bug #79925 . The parameter
type check for this particular method was missed.
2020-08-03 10:23:06 +02:00
Nikita Popov
a4c015b4b2
Fix handling of nullsafe method in empty()
...
Fixes oss-fuzz #24627 .
2020-08-03 10:16:38 +02:00
Christoph M. Becker
05c5c93705
Fix #79877 : getimagesize function silently truncates after a null byte
...
We have to check for NUL bytes if `getimagesize()` has been called.
2020-08-03 01:10:24 -07:00
Christoph M. Becker
775385df0e
Fix #79797 : Use of freed hash key in the phar_parse_zipfile function
...
We must not use heap memory after we freed it.
2020-08-03 01:10:22 -07:00
Christoph M. Becker
24495ba778
Merge branch 'PHP-7.4' into master
...
* PHP-7.4:
Enable libxml entity loader test case on Windows
2020-08-03 09:15:50 +02:00
Christoph M. Becker
d4b32e82c8
Enable libxml entity loader test case on Windows
2020-08-03 09:13:30 +02:00
tangl163
7d4ae7fa23
Drop the unneeded pointer casting
...
The standard says that "A pointer to void may be converted to or from a
pointer to any object type". So the casting is unneeded.
REF:
* c11: http://port70.net/~nsz/c/c11/n1570.html#6.3.2.3p1
* c99: http://port70.net/~nsz/c/c99/n1256.html
Closes GH-5916
2020-08-03 02:05:14 +01:00
Derick Rethans
90434d7fe3
Fixed bug #60302 : DateTime::createFromFormat should new static(), not new self()
...
Also fixes similar issues for DateTimeImmutable::createFromFormat,
DateTime::createFromImmmutable, DateTime::createFromInterface,
DateTimeImmutable::createFromMutable, and
DateTimeImmutable::createFromInterface.
2020-08-03 00:43:41 +01:00
Máté Kocsis
6b7e2f0d15
Fix stub hash of ext/ldap
2020-08-03 01:06:21 +02:00
Máté Kocsis
79981a394e
Add a bunch of missing argument types to stubs
2020-08-03 00:45:51 +02:00
Máté Kocsis
6ba24e9615
Improve a few parameter names in ext/spl
...
Use the same names which are used by zend functions.
2020-08-03 00:45:12 +02:00
Máté Kocsis
156c1806db
Convert the $ttl parameter of ldap_exop_refresh() to int
2020-08-03 00:38:59 +02:00
Nikita Popov
00743f3fae
Bump timeouts, again
...
Now that we're testing an additional JIT configuration in nightly
builds, the jobs are running close to an hour.
[ci skip]
2020-08-02 10:11:33 +02:00
Gabriel Caruso
e3d06fc79d
Ensure correct signatures for magic methods
2020-08-02 01:29:56 +02:00
Tyson Andre
650801ce45
[skip ci] Fix grammar/typo nits in docs
...
The PHP error message says "well-formed", not "well formed"
Fixes GH-5920
2020-08-01 18:03:45 -04:00
Máté Kocsis
bdacd2ae8f
Add a few missing types to stubs
2020-08-01 23:55:08 +02:00
Nikita Popov
c10a406500
Bump timeout again
2020-08-01 23:50:56 +02:00
Máté Kocsis
9f44eca6b6
Convert resources to objects in ext/openssl
...
Closes GH-5860
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com >
2020-08-01 22:47:20 +02:00
Tyson Andre
97f10fc341
Allow overriding completion in auto_prepend_file
...
Currently, it's possible to override `php -a`s completion
functionality to provide an alternative to the C implementation,
with `readline_completion_function()`.
However, that surprisingly gets overridden when called from
`auto_prepend_file`, because those scripts get run before the interactive shell
is started. I believe that not overriding it would be more consistent
with what happens when you override the completion function **after** the
interactive shell.
CLI is the only built-in API that uses this (See discussion in GH-5872).
I believe MINIT and RINIT will only run once when invoked with `php -a`.
Add documentation about the architecture of how php uses readline/libedit
Closes GH-5872
2020-08-01 11:39:08 -04:00
Máté Kocsis
ec22e5aa38
Get rid of empty function entries
...
Closes GH-5917
2020-08-01 10:07:05 +02:00
Nikita Popov
d92229d8c7
Implement named parameters
...
From an engine perspective, named parameters mainly add three
concepts:
* The SEND_* opcodes now accept a CONST op2, which is the
argument name. For now, it is looked up by linear scan and
runtime cached.
* This may leave UNDEF arguments on the stack. To avoid having
to deal with them in other places, a CHECK_UNDEF_ARGS opcode
is used to either replace them with defaults, or error.
* For variadic functions, EX(extra_named_params) are collected
and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS.
RFC: https://wiki.php.net/rfc/named_params
Closes GH-5357.
2020-07-31 15:53:36 +02:00
George Peter Banyard
9a71d47d73
Throw ValueError on empty tag in enchant_broker_request_dict()
2020-07-31 14:35:14 +01:00
George Peter Banyard
0ba31e19c6
Change leftover RETURN_FALSE to RETURN_THROWS() from 4095c0a
2020-07-31 14:11:10 +01:00
George Peter Banyard
4095c0a28d
Promote empty filename to ValueError in BZ2 extension
2020-07-31 14:01:05 +01:00
George Peter Banyard
c3105a1f8d
ValueError for empty path in stream code
...
Closes GH-5902
2020-07-31 13:39:58 +01:00
George Peter Banyard
f78a091014
Warning to ValueError promotion in Intl extension Part 1
...
Affects:
- IntlCalendar
- IntlGregorianCalendar
- IntlBreakIterator
Closes GH-5669
2020-07-31 13:27:22 +01:00
Nikita Popov
d3a9e1503f
Update i386 job to Ubuntu 20.04
2020-07-31 12:52:40 +02:00
Nikita Popov
91a1747ef7
Also run function jit tests on macos
2020-07-31 12:51:58 +02:00
Nikita Popov
a6e63b42c3
Make check in RECV_VARIADIC more precise
...
Fetch arg_info only once (it's always the same one...) and check
ZEND_TYPE_IS_SET on it, rather than checking if *any* parameter
has a type.
2020-07-31 12:02:28 +02:00
Dmitry Stogov
b3e12325f6
Fixed JIT when result of ASSIGN is in register, but the original variable might need to be destroyed
2020-07-31 12:31:46 +03:00
Christoph M. Becker
8c4f7d668e
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Fix #79919 : Stack use-after-scope in define()
2020-07-31 10:59:17 +02:00
Christoph M. Becker
fce8061ede
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix #79919 : Stack use-after-scope in define()
2020-07-31 10:57:02 +02:00
Christoph M. Becker
1e0bc6e30f
Fix #79919 : Stack use-after-scope in define()
...
Instead of the temporary `rv`, we use the `val_free` which is there for
this purpose.
2020-07-31 10:54:41 +02:00
Máté Kocsis
02b03df91a
Document the signature change of zend_get_closure_method_def()
2020-07-31 10:04:49 +02:00
Máté Kocsis
d94d426f60
Fix the default value handling of imagegif()
2020-07-31 10:01:08 +02:00
Nikita Popov
47e4001976
Remove more unused func_info fields
2020-07-30 18:50:12 +02:00
Dmitry Stogov
8ea9e1ae4c
We check result type guard in FETCH_DIM_R/IS only if index is long or string.
2020-07-30 19:19:10 +03:00
Nikita Popov
9dacc85251
Add type inference support for RECV_VARIADIC
2020-07-30 17:14:34 +02:00
Nikita Popov
104b7addc4
Remove unused recv_arg_info from func_info
2020-07-30 17:04:56 +02:00
Nikita Popov
ce22cf5198
Remove some dead code in RECV type inference
...
We must always have arg_info corresponding to RECV.
2020-07-30 16:55:21 +02:00
Dmitry Stogov
28eaad0969
Clear result type for exit point caused by JMPZ_EX/NZ_EX
2020-07-30 17:01:08 +03:00
Dmitry Stogov
8b43976483
Fixed memory leaks caused by incorrect AVOID_REFCOUNTING flag
2020-07-30 16:59:41 +03:00
Máté Kocsis
5f25618f83
Add missing RETURN_THROWS()
2020-07-30 14:55:13 +02:00
Máté Kocsis
0d330e1a02
Add a few missing parameter types in stubs
...
Related to GH-5627
2020-07-30 14:26:45 +02:00
Dmitry Stogov
41de27ecc2
Skip tests leaking because of preloading failure.
2020-07-30 14:04:14 +03:00
Deus Kane
f475edc2f1
Fixed bug #79897 : Promoted constructor params with attribs cause crash
...
This was caused by the attribute AST being used twice, and was fixed by
creating a temporary copy of it (and destroying said copy) when neccesary.
2020-07-30 11:08:31 +02:00
Nikita Popov
3690a805c1
Check non-zero in is_power_of_two()
...
And assert non-zero in floor_log2().
Fixes DASM_S_RANGE_I in ext/simplexml/tests/021.phpt.
2020-07-30 10:17:37 +02:00
Nikita Popov
849c7415b5
Increase timeout on asan job
...
We now also run tests with function JIT here, which makes this
slower.
Probably, this job should be split up into asan and ubsan, and
possibly run with optimization.
[ci skip]
2020-07-30 09:59:08 +02:00