Commit Graph

279 Commits

Author SHA1 Message Date
Dmitry Stogov
b4a5bc4a62 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed error message
2021-09-15 15:01:08 +03:00
Dmitry Stogov
23327bf4b3 Fixed error message 2021-09-15 15:00:49 +03:00
Dmitry Stogov
6f65a1b263 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed error message
2021-09-15 14:59:14 +03:00
Dmitry Stogov
de20a89b06 Fixed error message 2021-09-15 14:58:55 +03:00
Dmitry Stogov
46c09a34d5 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed bug #79576 ("TYPE *" shows unhelpful message when type is not defined)
2021-09-15 14:53:00 +03:00
Dmitry Stogov
594cba7f8e Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #79576 ("TYPE *" shows unhelpful message when type is not defined)
2021-09-15 14:49:35 +03:00
Dmitry Stogov
0badc7de96 Fixed bug #79576 ("TYPE *" shows unhelpful message when type is not defined) 2021-09-15 14:48:33 +03:00
Bob Weinand
1440d15e00
Add missing zend_test requirement to ffi test for bug80847 2021-08-18 17:16:54 +02:00
Máté Kocsis
2378f35787
Use single line phpdoc in stubs where possible 2021-07-20 13:16:56 +02:00
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Máté Kocsis
b382883696
Indent stubs inside global namespace blocks (#7261) 2021-07-20 10:23:58 +02:00
Nikita Popov
02b803a5fd Rename getStructFieldOffset/Type() parameter
By convention, parameter names of camel case methods should also
be camel case, i.e. the name should be $fieldName rather than
$field_name.

However, following GH-7236, which changed $arg_index to just $index,
this also changes $field_name to just $name. The fact that it is
a field name is obvious from context.
2021-07-14 15:13:42 +02:00
Tyson Andre
efbdcb8e49
Rename FFI getFuncArg* to getFuncParameter*, $arg_index->$index (#7236)
PHP is already already using "Parameter" instead of "Argument" for reflection on types elsewhere.

Parameter is used to refer to the function declarations
(AST_PARAM internally in the AST, ReflectionFunctionAbstract->getParameters(),
etc.)
Argument is used to refer to expressions passed to the functions by the caller
(ArgumentCountError, etc.).
(Error messages were also changed in php 8.x to refer to passing too many arguments to a
function)

Other languages use similar definitions,
e.g. https://developer.mozilla.org/en-US/docs/Glossary/Parameter
2021-07-14 09:12:25 -04:00
Dmitry Stogov
a2845e32cb FFI::CType reflection API 2021-07-13 13:13:51 +03:00
Nikita Popov
1cba7764b4
Remove zend_atoi() (#7232)
It's the same as (int) zend_atol() -- it doesn't try to do anything
integer size specific. Canonicalize to one function in preparation
for renaming zend_atol() to something less misleading.

FFI test is adjusted to use a zend_test function. It just calls
zend_atol() internally, but could really be anything.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-07-13 09:22:31 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Nikita Popov
62cb7dc4f5 Disable FFI preload tests with opcache.preload_user 2021-05-19 10:36:55 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
George Peter Banyard
5caaf40b43
Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
Max Semenik
bd9f4fa676 Migrate skip checks to --EXTENSIONS--, p2
For rationale, see https://github.com/php/php-src/pull/6787

Make extension checks lowercase, add a special case for opcache
that has internal name not matching .so filename.

Extensions migrated in part 2:
* dom
* exif
* fileinfo
* ffi
2021-04-01 12:08:24 +01:00
Dmitry Stogov
6800f0a3c2 XFAIL on WIN64 because of problem in libffi
(cherry picked from commit 6689bedd17)
2021-03-24 13:57:31 +01:00
Dmitry Stogov
6689bedd17 XFAIL on WIN64 because of problem in libffi 2021-03-19 12:19:24 +03:00
Dmitry Stogov
c8a8c47f7e Merge branch 'PHP-8.0'
* PHP-8.0:
  Additional fix for bug #80847. On x86_64 part of structure may be passed in CPU registers.
2021-03-18 16:16:29 +03:00
Dmitry Stogov
465cfc499b Additional fix for bug #80847.
On x86_64 part of structure may be passed in CPU registers.
2021-03-18 16:13:42 +03:00
Dmitry Stogov
9373d159c2 "zend-test" was renamed to "zend_test" 2021-03-18 14:36:46 +03:00
Dmitry Stogov
1494e87bd0 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80847 (CData structs with fields of type struct can't be passed as C function argument)
2021-03-17 09:56:07 +03:00
Dmitry Stogov
38ebb55c7c Fixed bug #80847 (CData structs with fields of type struct can't be passed as C function argument) 2021-03-17 09:55:20 +03:00
Máté Kocsis
bf0f6aaf18
Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Máté Kocsis
45fa7596dc
Add missing classes to stubs 2021-02-09 22:38:06 +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
Máté Kocsis
98fb565c74
Generate class entries from stubs for another batch of extensions
Closes GH-6669
2021-02-08 19:53:55 +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
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Nikita Popov
1b2aba285d Remove Z_PARAM separate params where they don't make sense
Separation can only possibly make sense for array parameters
(or something that can contain arrays, like zval parameters). It
never makes sense to separate a bool.

The deref parameters are also of dubious utility, but leaving them
for now.
2021-01-14 11:58:08 +01:00
Nikita Popov
973138f39d Add support for union types for internal functions
This closes the last hole in the supported types for internal
function arginfo types. It's now possible to represent unions of
multiple classes. This is done by storing them as TypeA|TypeB and
PHP will then convert this into an appropriate union type list.

Closes GH-6581.
2021-01-12 10:14:41 +01:00
Christoph M. Becker
13f898b56a Fix ffi stubs
Closes GH-6543.
2020-12-28 19:04:47 +01:00
Máté Kocsis
ab4c5976d7
Fix the signature of FFI::typeof() and FFI::memcmp() 2020-12-24 11:45:32 +01:00
Máté Kocsis
c1d766171b
Add a few other RETURN_THROWS() 2020-12-24 11:44:15 +01:00
Máté Kocsis
ed19cb6518
Fix the signature of FFI::sizeof() and FFI::alignof() 2020-12-24 11:39:09 +01: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
Christoph M. Becker
d07f6753a0 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #79177: FFI doesn't handle well PHP exceptions within callback
2020-10-28 13:49:23 +01:00
Christoph M. Becker
f547412cba Fix #79177: FFI doesn't handle well PHP exceptions within callback
We have to error on unhandled exceptions in FFI callbacks, to avoid
passing back undefined values.

This has been discussed and agreed upon in a previous PR[1].

[1] <https://github.com/php/php-src/pull/5120>

Closes GH-6366.
2020-10-28 13:34:56 +01:00
Nikita Popov
623bf39e9c Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80186
2020-10-09 17:02:20 +02:00
Nikita Popov
15443f8af4 Fixed bug #80186
Early exit in FE_RESET if get_properties() returns empty array,
as we cannot add HT iterators to zend_empty_array.
2020-10-09 16:56:08 +02:00
Nikita Popov
22ab18c2aa Update ext/ffi parameter names
Closes GH-6282.
2020-10-07 12:29:50 +02: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
2d234d111a Declare FFI\CType in namespace
Now that it is supported, declare that CType is part of the FFI
namespace, not a freestanding class.
2020-10-02 17:54:34 +02:00
Dmitry Stogov
7299af0059 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed hex char parsing
2020-09-30 11:00:50 +03:00
Dmitry Stogov
583093844e Fixed hex char parsing 2020-09-30 11:00:25 +03:00