Máté Kocsis
803779e84b
Add support for generating properties with union type of multiple classes
...
Closes GH-6701
2021-02-16 15:50:13 +01:00
Máté Kocsis
bf0f6aaf18
Improve class entry generation
...
Related to GH-6701
2021-02-16 13:09:56 +01:00
Máté Kocsis
99b08ac281
Implicitly enable function entry generation when class entry generation is enabled
...
Closes GH-6675
2021-02-09 13:37:24 +01:00
Tyson Andre
b4c6d5f799
Properly render 2+ namespaces functions in build/gen_stub.php
...
Affects both INIT_NS_CLASS_ENTRY and ZEND_NS_FE
Add test cases of the global function and namespaced values
Closes GH-6664
2021-02-06 14:09:25 -05:00
Nikita Popov
a53e360d98
Merge branch 'PHP-8.0'
...
* PHP-8.0:
XFAIL observer_error_05.phpt test
2021-02-01 10:24:18 +01:00
Nikita Popov
cab1ea46e7
XFAIL observer_error_05.phpt test
2021-02-01 10:24:00 +01:00
Nikita Popov
6971c720b0
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Observe fake closures
2021-01-28 10:05:51 +01:00
Sammy Kaye Powers
17142eab22
Observe fake closures
...
Closes GH-6607.
2021-01-28 10:03:41 +01:00
Dmitry Stogov
9948142e50
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Skip dummy frames allocated on CPU stack of zend_call_function(). (Usage of "current_observed_frame" varible looks unsafe to me).
2021-01-26 18:44:56 +03:00
Dmitry Stogov
094e1a8b2d
Skip dummy frames allocated on CPU stack of zend_call_function().
...
(Usage of "current_observed_frame" varible looks unsafe to me).
2021-01-26 18:41:26 +03:00
Máté Kocsis
1954e59758
Add support for generating class entries from stubs
...
Closes GH-6289
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com >
2021-01-26 11:50:36 +01:00
Nikita Popov
4846913946
Disable jit in observer opline test
...
This test fails in --repeat mode with tracing JIT.
2021-01-25 10:41:34 +01:00
Nikita Popov
dbe5725ff3
Rename zend-test to zend_test
...
The extension name should match the name of the ext/ directory,
otherwise it will not get picked up by run-tests. It would be possible
to remap this in run-tests, but I think it's better to rename the
extension to follow the standard format. Other extensions also
use underscore instead of hyphen (e.g. pdo_mysql and not pdo-mysql).
Of course, the ./configure option remains hyphenated.
Closes GH-6613.
2021-01-19 15:28:15 +01:00
Nikita Popov
f3415758d1
Fix observer tests on Windows
...
Use %e instead of a hardcoded forward slash.
2021-01-19 15:27:14 +01:00
Nikita Popov
dd7d829896
Disable opcache optimizations during some observer tests
...
Opcache inlines functions that only return a constant. Disable
optimizations to prevent differences in tests where such functions
are used (or rewrite the test to not depend on it).
2021-01-19 10:02:08 +01:00
Dmitry Stogov
d5a82e2c4e
Disable JIT with incompatible third-party extensions
2020-11-30 13:58:34 +03:00
Sammy Kaye Powers
58d41b8c4f
Provide unused retvals to observers
...
Make sure that the return value is available to observers, even if
it is not used by the caller.
Closes GH-6422.
2020-11-17 10:28:47 +01:00
Sammy Kaye Powers
0425a6697a
Fire open observer end handlers after a zend_bailout
...
Closes GH-6377
2020-11-16 15:12:57 -08:00
Dmitry Stogov
855d8fa68f
[Observer] Save opline before calling begin/end handlers
2020-11-11 13:06:55 +03:00
Christoph M. Becker
72d9d9b88f
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix bug79177.phpt wrt. JIT
2020-10-30 15:49:48 +01:00
Christoph M. Becker
0427dcb913
Fix bug79177.phpt wrt. JIT
...
JIT ignores that the `zend_write` callback is overwritten, so we define
our own callback and caller.
We also fix the "inconsistent DLL binding" warnings on Windows, by
introducing `PHP_ZEND_TEST_API`.
Closes GH-6391.
2020-10-30 15:47:18 +01:00
Sammy Kaye Powers
4a6932c076
Add missing observer tests
...
Closes GH-6378
2020-10-26 15:15:17 -07:00
Nikita Popov
c96d884d91
Avoid namespaced class symbol clashes in gen_stub
...
Add the namespace prefix (using underscores) to both the arginfo
name and the method declaration name.
2020-10-07 12:13:52 +02:00
Nikita Popov
9c710b1d11
Support "static" type in gen_stub
2020-10-07 11:34:14 +02:00
Nikita Popov
dfa6d1c22e
Support specifying linkage for generate-function-entries
...
The linkage can be specified as the argument to the
@generate-function-entries tag. Test this on zend_test.
2020-10-02 17:21:16 +02:00
Sammy Kaye Powers
e42abeafec
Pass zend_execute_data instead of zend_function to fcall init
...
The motivation for this change is to prevent extensions from having to check executor globals for the current execute_data during function call init. A previous implementation of the observer API initialized the function call from runtime cache initialization before execute_data was allocated which is why zend_function was passed in.
But now that the observer API is implemented via opcode specialization, it makes sense to pass in the execute_data. This also keeps the API a bit more consistent for existing extensions that already hook zend_execute_ex.
Closes GH-6209
2020-09-25 11:46:15 -07:00
Nikita Popov
c5401854fc
Run tidy
...
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00
Dmitry Stogov
d5d31ea3b3
Cleanup observer API and add JIT support
2020-09-18 12:55:58 +03:00
Máté Kocsis
c98d47696f
Consolidate new union type ZPP macro names
...
They will now follow the canonical order of types. Older macros are
left intact due to maintaining BC.
Closes GH-6112
2020-09-11 11:00:18 +02:00
Levi Morrison
94fd52dd09
Add Z_PARAM_ITERABLE and co
2020-09-03 07:03:12 -06:00
Benjamin Eberlei
8b37c1e993
Change Attribute Syntax from @@ to #[]
2020-09-02 20:26:50 +02:00
Levi Morrison
66c3e900e2
Add zend_observer API
...
Closes GH-5857.
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com >
Co-authored-by: Sammy Powers <sammyk@datadoghq.com >
2020-09-01 09:59:59 -06: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
Theodore Brown
470d1696d9
Implement Shorter Attribute Syntax
...
RFC: https://wiki.php.net/rfc/shorter_attribute_syntax
Closes GH-5796.
Co-authored-by: Martin Schröder <m.schroeder2007@gmail.com >
2020-07-28 15:28:57 +02:00
Nikita Popov
df2749da70
Tweak zend_test arginfo/zpp
2020-07-21 15:33:01 +02:00
Nikita Popov
6744ead1c9
Parse parameters in zend_test_void_return()
2020-07-17 15:43:40 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
...
Closes GH-5758
2020-07-06 21:13:34 +02:00
Máté Kocsis
b18b2c8fe5
Add string or object ZPP macros
...
Closes GH-5788
2020-07-06 12:42:02 +02:00
Martin Schröder
053ef28b8d
Implement Attribute Amendments.
...
RFC: https://wiki.php.net/rfc/attribute_amendments
Support for attribute grouping is left out, because the short
attribute syntax RFC will likely make it obsolete.
Closes GH-5751.
2020-06-29 10:45:51 +02:00
Nikita Popov
c9b9f525a9
Include stub hash in generated arginfo files
...
The hash is used to check whether the arginfo file needs to be
regenerated. PHP-Parser will only be downloaded if this is actually
necessary.
This ensures that release artifacts will never try to regenerate
stubs and thus fetch PHP-Parser, as long as you do not modify any
files.
Closes GH-5739.
2020-06-24 09:55:19 +02:00
Christoph M. Becker
5a04796f76
Fix MSVC level 1 (severe) warnings
...
We fix (hopefully) all instances of:
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005 >
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4024 >
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4028 >
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4047 >
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4087 >
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4090 >
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4273 >
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4312 >
`zend_llist_add_element()` and `zend_llist_prepend_element()` now
explicitly expect a *const* pointer.
We use the macro `ZEND_VOIDP()` instead of a `(void*)` cast to suppress
C4090; this should prevent accidential removal of the cast by
clarifying the intention, and makes it easier to remove the casts if
the issue[1] will be resolved sometime.
[1] <https://developercommunity.visualstudio.com/content/problem/390711/c-compiler-incorrect-propagation-of-const-qualifie.html >
2020-06-05 11:17:05 +02:00
Benjamin Eberlei
a7908c2d11
Add Attributes
...
Co-authored-by: Martin Schröder <m.schroeder2007@gmail.com >
2020-06-04 18:19:49 +02:00
Máté Kocsis
b3718430de
Annotate internal functions with the mixed type
...
Closes GH-5618
2020-05-25 17:30:57 +02:00
Christoph M. Becker
38ecfe0245
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Fix #79532 : sizeof off_t can be wrong
2020-04-29 10:43:35 +02:00
Christoph M. Becker
67f9b0b754
Fix #79532 : sizeof off_t can be wrong
...
We have to actually determine the proper `SIZEOF_OFF_T`.
Interestingly, it is `4` on Windows x64.
We also have to prevent the redefinition in pg_config.h. The clean
solution would likely be to not include pg_config.h at all, but that's
out of scope for BC reasons for now.
2020-04-29 10:40:59 +02:00
Máté Kocsis
3fe49d81f8
Generate method entries from stubs for a couple of extensions
...
Closes GH-5368
2020-04-11 13:28:53 +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
Máté Kocsis
610815c0ce
Improve gen_stub.php
...
Closes GH-5350
Add support for generating deprecated function entries, as well as forward declaration
of function aliases.
2020-04-04 23:52:33 +02:00
Nikita Popov
02a685ead3
Fix stub for zend_terminate_string()
2020-04-03 18:21:40 +02:00
Nikita Popov
2bcc4ab8f4
Verify that all stubs have a return type
2020-04-03 17:59:30 +02:00