Commit Graph

582 Commits

Author SHA1 Message Date
Christoph M. Becker
dabc28d182 Fix #78880: Spelling error report
We fix the most often occuring typos according to a recent codespell
report[1] in tests, code comments and documentation.

[1] <https://fossies.org/linux/test/php-src-master-f8f48ce.191129.tar.gz/codespell.html>.
2019-12-21 11:58:00 +01:00
Dmitry Stogov
796d11c942 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78895 (Reflection detects abstract non-static class as abstract static. IS_IMPLICIT_ABSTRACT is not longer used)
2019-12-09 13:50:43 +03:00
Dmitry Stogov
42a2fb8411 Fixed bug #78895 (Reflection detects abstract non-static class as abstract static. IS_IMPLICIT_ABSTRACT is not longer used) 2019-12-09 13:49:12 +03:00
Nikita Popov
999e32b65a Implement union types
According to RFC: https://wiki.php.net/rfc/union_types_v2

The type representation now makes use of both the pointer payload
and the type mask at the same time. Additionall, zend_type_list is
introduced as a new kind of pointer payload, which is used to store
multiple class types. Each of the class types is a tagged pointer,
which may be either a class name or class entry. The latter is only
used for typed properties, while arguments/returns will instead use
cache slots. A type list can contain a mix of both names and CEs at
the same time, as not all classes may be resolvable.

One thing this is missing is support for union types in arginfo
and stubs, which I want to handle separately.

I've also dropped the special object code from the JIT implementation
for now -- I plan to add this back in a different form at a later time.
For now I did not want to include non-trivial JIT changes together
with large functional changes.

Another possible piece of follow-up work is to implement "iterable"
as an internal alias for "array|Traversable". I believe this will
eliminate quite a few special-cases that had to be implemented.

Closes GH-4838.
2019-11-08 15:15:48 +01:00
Fabien Villepinte
a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00
Fabien Villepinte
42692d45f5 Merge branch 'PHP-7.4' 2019-11-04 13:56:18 +01:00
Fabien Villepinte
6545f656be Add a test for ReflectionClass:getInterfaceNames()
The method was not tested against a class without interface.
2019-11-04 13:51:40 +01:00
Nikita Popov
7f9e7399d3 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78774
2019-11-04 11:04:11 +01:00
Nikita Popov
c9abfaec6b Fixed bug #78774
The string held by the zend_type may be released if the property
type gets resolved to a CE. I initially wanted to fix this by
storing a zend_type* instead (so the property type resolution
propagates to the ReflectionType), but decided against this in
light of upcoming union types support, where we also need to
represent parts of the union, and will not have a single zend_type*
we can reference.
2019-11-04 11:04:02 +01:00
Christoph M. Becker
de69a9d3eb Improve reflection arginfo stubs 2019-10-26 12:32:12 +02:00
Thomas Gerbet
c9fc076a75 Add stubs for ext-reflection 2019-10-26 12:32:12 +02:00
Nikita Popov
530a8a3854 Fix and undeprecate ReflectionType::__toString()
Add deprecated _ZendTestClass::__toString() method to preserve
an existing test.

ReflectionType::__toString() will now return a complete
representation of the type, as it should have originally. Users
that relied on nullability being absent should have been pushed
to ReflectionNamedType::getName() by the deprecation of
ReflectionType::__toString() in PHP 7.1 / PHP 7.4.
2019-10-22 11:26:02 +02:00
Fabien Villepinte
084d401beb Merge branch 'PHP-7.4' 2019-10-21 21:33:30 +02:00
Fabien Villepinte
7ce85c34ff Revert "Add tests for ReflectionZendExtension"
This reverts commit 4194e0415b.

There were already tests for this class.
2019-10-21 21:31:36 +02:00
Fabien Villepinte
95390972f1 Merge branch 'PHP-7.4' 2019-10-21 21:17:50 +02:00
Fabien Villepinte
4194e0415b Add tests for ReflectionZendExtension 2019-10-21 21:17:16 +02:00
Joe Watkins
174ab25fd4
Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #78697: inaccurate error message
2019-10-21 09:25:24 +02:00
Joe Watkins
1ac961bea8
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78697: inaccurate error message
2019-10-21 09:24:41 +02:00
Joe Watkins
1c9b62fbd4
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #78697: inaccurate error message
2019-10-21 09:23:26 +02:00
Fabien Villepinte
bea2ff88c9
Fix bug #78697: inaccurate error message 2019-10-21 09:22:09 +02:00
Nikita Popov
2f92957fd3 Convert some notices to warnings
Part of https://wiki.php.net/rfc/engine_warnings.
2019-10-02 10:34:08 +02:00
Nikita Popov
e441378b54 Update error messages in some more tests 2019-09-23 16:39:52 +02:00
Nikita Popov
8d7911ef56 Standardize type printing in reflection
Use ?T instead of "T or NULL".
2019-09-23 15:40:03 +02:00
Nikita Popov
d0f4ec4c31 Merge branch 'PHP-7.4' 2019-08-13 20:24:39 +02:00
Nikita Popov
d891b5f458 Fixed bug #78410 2019-08-13 20:23:56 +02:00
Nikita Popov
7a1540fa28 Merge branch 'PHP-7.4' 2019-07-22 17:00:17 +02:00
Nikita Popov
c817b8020c Special-case rc=1 self-referential arrays in ReflectionReference
New fix for bug #78263. This is special-cased elsewhere in the engine,
so we need to mirror it here.
2019-07-22 16:59:23 +02:00
Nikita Popov
19588a8f3b Revert "Add ReflectionReference::getRefcount()"
This reverts commit 428cfdd181.
2019-07-22 16:49:08 +02:00
Nikita Popov
36db71df47 Merge branch 'PHP-7.4' 2019-07-22 12:28:40 +02:00
Nikita Popov
3121b7174f Deprecate Reflection export() methods
And remove the Reflector::export() interface method.
2019-07-22 11:39:52 +02:00
Nikita Popov
1fe478d30c Merge branch 'PHP-7.4' 2019-07-08 16:54:22 +02:00
Nikita Popov
428cfdd181 Add ReflectionReference::getRefcount()
And don't return null for rc=1 references. Leave it to the user
to decide whether or not they want to consider these as references
or not.

Fixes bug #78263.
2019-07-08 16:54:03 +02:00
Nikita Popov
4d90848d68 Don't verify arginfo types for internal functions
To avoid duplicate type checks. In debug builds arginfo is still
checked and will generate an assertions if the function doesn't
subsequently throw an exception.

Some test results change due to differences in zpp and arginfo
error messages.
2019-06-17 11:46:28 +02:00
Nikita Popov
cc286e5bd5 Merge branch 'PHP-7.4' 2019-06-05 15:34:56 +02:00
Nikita Popov
b964298c19 Deprecate ReflectionType::__toString()
We weren't able to do this in 7.1 because the deprecation notice
may be converted to an exception and __toString() can't throw,
which means that it ultimately become a fatal error. This issue
is resolved now, so we can mark the method as deprecated.
2019-06-05 15:33:52 +02:00
Nikita Popov
7686b0b889 Merge branch 'PHP-7.4' 2019-06-05 14:53:50 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Nikita Popov
9f87831470 Merge branch 'PHP-7.4' 2019-05-09 12:36:33 +02:00
Nikita Popov
4b40a46bf1 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-09 12:36:20 +02:00
Nikita Popov
90318fbcbe Merge branch 'PHP-7.2' into PHP-7.3 2019-05-09 12:35:11 +02:00
Nikita Popov
35c80583f0 Fixed bug #75186 2019-05-09 12:33:53 +02:00
Nikita Popov
969f238808 Merge branch 'PHP-7.4' 2019-05-09 12:03:29 +02:00
Nikita Popov
54be40113d Fixed bug #77951
Treat singleton references as non-references in ReflectionReference
and return null for them.
2019-05-09 12:02:16 +02:00
Nikita Popov
2e186aa9dc Merge branch 'PHP-7.4' 2019-04-15 10:25:27 +02:00
Nikita Popov
b2ec07e64c Merge branch 'PHP-7.3' into PHP-7.4 2019-04-15 10:25:20 +02:00
Nikita Popov
14047b50b4 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-15 10:25:11 +02:00
Nikita Popov
e9c0367fdc Fixed bug #77882 2019-04-15 10:22:40 +02:00
Nikita Popov
787ecb6d56 Merge branch 'PHP-7.4' 2019-03-22 12:41:39 +01:00
Nikita Popov
9457cfca37 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-22 12:41:34 +01:00
Nikita Popov
620a753185 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-22 12:41:02 +01:00
Nikita Popov
da35fa2cb8 Fixed bug #77772 2019-03-22 12:39:27 +01:00
Nikita Popov
852485d8ec Adjust tests for zpp TypeError change 2019-03-11 11:32:20 +01:00
Gabriel Caruso
726919e4b5 Merge branch 'PHP-7.4'
* PHP-7.4:
  Use EXPECT when possible
  Fix tests filenames
2019-03-11 00:07:32 -03:00
Gabriel Caruso
6c4e2079c0 Use EXPECT when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2019-03-11 00:05:44 -03:00
Nikita Popov
17fb7241e4 Merge branch 'PHP-7.4' 2019-03-06 13:45:13 +01:00
Nikita Popov
8c62c69265 More zpp error/variation test removals
Some of these tests also check non-zpp conditions -- however, there is
always some other test that also checks those error conditions.
2019-03-06 13:40:22 +01:00
Nikita Popov
824efb726c Merge branch 'PHP-7.4' 2019-03-05 17:10:26 +01:00
Nikita Popov
10b4113638 Remove more zpp error tests 2019-03-05 17:09:09 +01:00
Nikita Popov
c8e2b333cb Merge branch 'PHP-7.4' 2019-02-20 11:22:31 +01:00
Nikita Popov
c0e15a3b7f Implement fine-grained conflict handling
Tests can specify conflict keys, either in --CONFLICTS-- or
a per-directory CONFLICTS file. Non-conflicting tests may be run
in parallel.
2019-02-20 11:20:40 +01:00
Nikita Popov
1016e3a927 Merge branch 'PHP-7.4' 2019-02-19 10:07:47 +01:00
Tyson Andre
12ffee57d6 Fixed bug #77631
Do not include unbound anonymous classes in get_declared_classes().

Note that earlier PHP versions would include the anonymous class in
get_declared_classes(), and return false until the class was bound,
but would not crash.
2019-02-19 10:07:40 +01:00
Nikita Popov
29aa080f0d Merge branch 'PHP-7.4' 2019-02-18 15:31:15 +01:00
Andrea Faulds
39792f5bb7 run-tests.php: experimental parallel testing support 2019-02-18 14:58:53 +01:00
Nikita Popov
c53852dc0a Merge branch 'PHP-7.4' 2019-02-13 12:25:27 +01:00
Nikita Popov
6347f0b937 Implement ReflectionReference
RFC: https://wiki.php.net/rfc/reference_reflection
2019-02-13 12:21:18 +01:00
Gabriel Caruso
35db1ccdd1
Fix variadic arginfos for Reflection functions
Fix arginfos of required arguments for some Reflection methods
2019-02-10 14:29:08 -02:00
Peter Kokot
17baa87fad Merge branch 'PHP-7.4'
* PHP-7.4:
  Update and fix remaining year ranges (2019)
2019-02-08 23:15:49 +01:00
Peter Kokot
c245898bfa Update and fix remaining year ranges (2019)
This patch follows previous license year ranges updates. With new
approach source code files now have simplified headers with license
information without year ranges.
2019-02-08 23:14:29 +01:00
Nikita Popov
aad39879f2 Remove bareword fallback for constants
Access to undefined constants will now always result in an Error
exception being thrown.

This required quite a few test changes, because there were many
buggy tests that unintentionally used bareword fallback in combination
with error suppression.
2019-01-31 13:52:06 +01:00
Gabriel Caruso
4e0dd6b0ed Remove unnecessary CLI checks in tests 2019-01-31 00:21:32 -02:00
Nikita Popov
682b54f687 Remove support for legacy constructors
This has been deprecated in PHP 7.0 by
https://wiki.php.net/rfc/remove_php4_constructors.
2019-01-29 13:04:20 +01:00
Nikita Popov
d0fd2be642 Revert removal of private __clone() methods
I thought these were redundant, because we already NULL out the
clone_obj object handler. However, it turns out that reflection is
using private __clone() to determine clonability (isCloneable) for
the case where we only have a class, rather than an object.

As such, removing these methods would be a BC break.

This reverts commit e7131a4e9f.
This reverts commit 55bd88ce0d.
2019-01-14 09:19:30 +01:00
Nikita Popov
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00
Nikita Popov
55bd88ce0d Remove redundant __clone() methods from Reflection
Reflection classes already use NULLed clone_obj to signal that they
cannot be cloned, so it's not necessary to additionally declare a
throwing __clone() method.
2018-11-26 14:00:42 +01:00
Peter Kokot
d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00
Peter Kokot
b746e69887 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:32:30 +02:00
Peter Kokot
f1d7e3ca0b Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:31:31 +02:00
Peter Kokot
d7a3edd45d Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +02:00
Peter Kokot
782352c54a Trim trailing whitespace in *.phpt 2018-10-14 19:45:12 +02:00
Peter Kokot
17ccbeec32 Trim trailing whitespace in *.phpt 2018-10-14 19:44:14 +02:00
Gabriel Caruso
9c144e0d82
Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
Peter Kokot
1ad08256f3 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:56:38 +02:00
Peter Kokot
1c850bfcca Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:55:24 +02:00
Peter Kokot
60a69daec6 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:54:08 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Nikita Popov
a5fa51afbb Don't overload get_properties for ArrayObject
Instead overload get_properties_for for a few specific cases such
as array casts. This resolves the issue where ArrayObject
get_properties may violate engine invariants in some cases.
2018-10-10 10:39:10 +02:00
Nikita Popov
784579d99a Merge branch 'PHP-7.3' 2018-10-02 18:20:30 +02:00
Nikita Popov
a42801abe3 Merge branch 'PHP-7.2' into PHP-7.3 2018-10-02 18:20:25 +02:00
Nikita Popov
f0647edd88 Fixed bug #66430 2018-10-02 18:19:53 +02:00
Nikita Popov
c8188fdd3b Merge branch 'PHP-7.3' 2018-10-02 17:49:08 +02:00
Nikita Popov
b8392803f9 Merge branch 'PHP-7.2' into PHP-7.3 2018-10-02 17:48:56 +02:00
Nikita Popov
d2477b284b Fixed bug #76936 2018-10-02 17:47:07 +02:00
Nikita Popov
96da1fe8a9 Fixed bug #76737
Explicitly prohibit serialization and unserialization of reflection
objects.
2018-09-29 14:47:57 +02:00
Peter Kokot
c951836721 Remove unused files
- ext/simplexml/tests/bug25756_1.xml
- ext/simplexml/tests/bug25756_2.xml
- ext/simplexml/tests/bug25756.xsd
Added via 503d74aa29 and then removed via
9e29f17493

- ext/mysqli/tests/cacert.pem
- ext/mysqli/tests/client-cert.pem
- ext/mysqli/tests/client-key.pem
Added via e9f9f66f2e and then removed via
6d51b7b2e3

- ext/gd/tests/simpletext私はガラスを食べられます.jpg
Added via 3d3f11ede4 and never used

- ext/gd/tests/src.png
Added via cc938b5df0 and never used

- ext/zlib/tests/gzgetss.test
Added via d536ecac5c as a file content of the
ext/zlib/tests/gzgetss.gzbut but never used in tests directly. Removed for
better clarity of zlib tests

- ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl
- ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl
- ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl
Added via 1d25fc5c7b and never used

- ext/reflection/tests/exception.inc
Removed via 9f8ba2e8a1

- ext/phar/tests/files/extracted.inc
Removed via 549bf83bd1

- ext/phar/tests/cache_list/files/extracted.inc
Added via 05c3104097 and never used
2018-09-26 12:54:20 +02:00
Gabriel Caruso
f72b6c5e19
Use EXPECT instead of EXPECTF when possible 2018-09-16 15:39:18 -03:00
Dmitry Stogov
0fbd2e6a16 Renumber ZEND_ACC_... flags 2018-09-11 17:21:17 +03:00
Dmitry Stogov
37290ad8d2 Use mnemonic names 2018-09-11 14:54:11 +03:00
Christoph M. Becker
f94518dca1 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #74454: Wrong exception being thrown when using ReflectionMethod
2018-09-05 15:11:09 +02:00
Christoph M. Becker
21cd552e1e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #74454: Wrong exception being thrown when using ReflectionMethod
2018-09-05 15:10:27 +02:00
Christoph M. Becker
7a2c9585c4 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #74454: Wrong exception being thrown when using ReflectionMethod
2018-09-05 15:07:59 +02:00
Christoph M. Becker
c0a389a927 Fix #74454: Wrong exception being thrown when using ReflectionMethod
If zend_throw_exception_ex() already threw an exception, we should not
throw again.
2018-09-05 15:05:19 +02:00
Dmitry Stogov
d140df58e6 Keep information about unresolved interfaces in zend_class_entry->interface_names.
Move interface implementation code into ZEND_DECLARE_*CLASS opcodes.
Remove ZEND_ADD_INTERFACE and ZEND_VERIFY_ABSTRACT_CLASS opcodes.
2018-08-23 17:16:28 +03:00
Nikita Popov
23ae6ca405 Fix check for invoking abstract method 2018-07-02 21:33:09 +02:00
Nikita Popov
826e403d2c Add $ before property name in error message 2018-07-02 21:24:38 +02:00
Nikita Popov
04824aa263 Merge branch 'PHP-7.2' 2018-07-02 18:58:01 +02:00
Nikita Popov
9bbb9e537c Merge branch 'PHP-7.1' into PHP-7.2 2018-07-02 18:57:25 +02:00
Nikita Popov
c97b8bbf82 Fixed bug #75231
The behavior is now consistent with ReflectionMethod.
2018-07-02 18:56:27 +02:00
Nikita Popov
db7ead0768 Fix ReflectionProperty::get/setValue() on internal static property
This was broken by 6dc0cd868d, which
moved static property initialization outside of constant updating.

Instead of replicating logic, use zend_get_static_property() API
in the reflection implementation, just like we're using
read_property for non-static proprety access.
2018-06-28 22:45:26 +02:00
Xinchen Hui
8e940654e1 Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWS
  Fixed bug #76536 (PHP crashes with core dump when throwing exception in error handler). (Laruence)
2018-06-28 12:38:26 +08:00
Xinchen Hui
5d7f9dcca7 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76536 (PHP crashes with core dump when throwing exception in error handler). (Laruence)
2018-06-28 12:37:58 +08:00
Xinchen Hui
1f6b842af4 Fixed bug #76536 (PHP crashes with core dump when throwing exception in error handler). (Laruence) 2018-06-28 12:37:33 +08:00
Peter Kokot
ede39739fd Normalize Reflection phpinfo() output
This patch normalizes the Reflection extension version in the phpinfo
output. It removes the Git attributes ident blob object name from Git
repository as an extension version.

Also the table output is synced with other extensions (i.e. enabled
in a row instead of table header).
2018-06-04 16:28:16 +02:00
Dmitry Stogov
9d139b16c2
Test ReflectionZendExtension class 2018-03-09 12:07:52 +01:00
Gabriel Caruso
0c0a5df111 Test ReflectionClass::getReflectionConstant method 2018-02-22 13:18:52 +01:00
Gabriel Caruso
b895690dfa
remove support for string|unicode in tests 2018-02-22 08:11:30 +01:00
Gabriel Caruso
ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Gabriel Caruso
21e3b0c70c Remove trailing whitespace in inc files 2018-02-10 19:20:23 +01:00
Gabriel Caruso
fef879a2d6 Use bool instead of boolean while throwing a type error
PHP requires boolean typehints to be written "bool" and disallows
"boolean" as an alias. This changes the error messages to match
the actual type name and avoids confusing messages like "must be
of type boolean, boolean given".

This a followup to ce1d69a1f6, which
implements the same change for integer->int.
2018-02-04 23:09:40 +01:00
Gabriel Caruso
ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Gabriel Caruso
a920db8f13 Remove superfluous SKIPIF sections in Reflection tests 2018-02-03 14:10:51 +01:00
Michael Moravec
f70ca770b6 Revert BC break caused by fixing bug #74035
This reverts commit 9ffc6ca62f.
2017-11-06 17:52:17 -05:00
Derick Rethans
21493e0824 Merge branch 'PHP-7.1' into PHP-7.2 2017-08-16 11:14:53 +01:00
Derick Rethans
9a72a7c58f Merge branch 'PHP-7.0' into PHP-7.1 2017-08-16 11:14:47 +01:00
Derick Rethans
5d2c303438 Fixed stupid test 2017-08-16 11:14:41 +01:00
Xinchen Hui
262aeb8ae1 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed test
2017-07-27 12:50:41 +08:00
Xinchen Hui
0ddda0dcb7 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed test
2017-07-27 12:50:28 +08:00
Xinchen Hui
9fcfe52d03 Fixed test 2017-07-27 12:50:17 +08:00
Xinchen Hui
afc2be8fc8 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update NEWS
  Fixed bug #74949 (null pointer dereference in _function_string)
2017-07-27 11:24:53 +08:00
Xinchen Hui
84a18c4782 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74949 (null pointer dereference in _function_string)
2017-07-27 11:23:27 +08:00
Xinchen Hui
e36c04ef48 Fixed bug #74949 (null pointer dereference in _function_string) 2017-07-27 11:23:06 +08:00
Michał Brzuchalski
8e10c9d373 Implement object type annotation
RFC: https://wiki.php.net/rfc/object-typehint
2017-06-25 21:49:41 +02:00
Sara Golemon
c1500f8519 Rename ReflectionClass::isIterateable() to isIterable()
Iterateable is not a word.
Add the correct spelling, but keep the original one around
for BC purposes.

Perhaps we can add ZEND_ACC_DEPRECATED at some later date
and even remove it from PHP 8.
2017-05-31 12:08:07 -07:00
Xinchen Hui
bfd35512bb Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWS
  Fixed bug #74673 (Segfault when cast Reflection object to string with undefined constant)

Conflicts:
	ext/reflection/php_reflection.c
2017-05-31 13:12:24 +08:00
Xinchen Hui
9064dca58b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74673 (Segfault when cast Reflection object to string with undefined constant)

Conflicts:
	ext/reflection/php_reflection.c
2017-05-31 13:08:26 +08:00
Xinchen Hui
9c5717d0de Fixed bug #74673 (Segfault when cast Reflection object to string with undefined constant) 2017-05-31 12:39:26 +08:00
Andrea Faulds
9891b9ede2 Test ReflectionType support of iterable 2017-04-29 16:12:46 +01:00
Andrea Faulds
753ae9b7db Test ReflectionType support of iterable 2017-04-29 14:37:35 +01:00
Nikita Popov
d5c6fcc3ba Don't leak internal flags in reflection
If someone complains, we may re-expose specific flags while also
adding corresponding class constants for them.
2017-04-22 16:44:20 +02:00
Nikita Popov
0710eee043 Fix reflection test after flag removal
Reflection is leaking internal flags...
2017-04-22 16:31:28 +02:00
Nikita Popov
134d0b33a3 Merge branch 'PHP-7.0' into PHP-7.1 2017-02-12 22:03:31 +01:00
Nikita Popov
eb1373e509 Revert "Fixed bug #74035"
This reverts commit 9ffc6ca62f.
2017-02-12 22:02:39 +01:00
Julien Pauli
ed4216c955 ReflectionGenerator now sends ReflectionException as expected 2017-02-07 17:47:08 +01:00
Nikita Popov
162aa1a5fc Deprecate __autoload() 2017-02-03 18:52:57 +01:00
Nikita Popov
6303dd1ea4 Merge branch 'PHP-7.1' 2017-02-03 18:30:40 +01:00
Nikita Popov
57817eb72f Merge branch 'PHP-7.0' into PHP-7.1 2017-02-03 18:30:32 +01:00
andrewnester
9ffc6ca62f Fixed bug #74035 2017-02-03 18:29:39 +01:00
Nikita Popov
fb008bf60e Remove obsolete version checks from tests 2017-02-02 00:58:04 +01:00
Nikita Popov
a8d901a80c Remove zend_version() checks from tests 2017-01-30 22:50:25 +01:00
Nikita Popov
ca682952e7 Merge branch 'PHP-7.1' 2016-12-18 17:11:01 +01:00