Commit graph

818 commits

Author SHA1 Message Date
Nikita Popov
4fc4249d24 Make ReflectionType an abstract class
This is never instantiated directly, only child classes are used.
2019-09-02 15:38:56 +02:00
Nikita Popov
bdf2cd7508 Move isBuiltin() method from ReflectionType to ReflectionNamedType
This method only makes sense for single types, e.g. it would be
meaningless for union types.

Note that we always return ReflectionNamedType right now, so this does
not break compatibility for code using any currently existing types.
2019-09-02 14:59:31 +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
Dmitry Stogov
390810e1e6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Evaluate constant in class scope
2019-07-22 11:59:49 +03:00
Dmitry Stogov
2f51764e5d Evaluate constant in class scope 2019-07-22 11:59:24 +03:00
Nikita Popov
f464f8edfe Merge branch 'PHP-7.4' 2019-07-11 14:15:02 +02:00
Nikita Popov
42cac9d7d7 Don't call Reflection::export() internally
export() methods were implemented in a roundabout way, where they
would call Reflection::export(), which would then call __toString().
Cut out the middleman by directly calling __toString().
2019-07-11 14:14:55 +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
twosee
61f78de486 Constify some char* arguments or return values of ZEND_API
Closes GH-4247.
2019-06-12 16:49:32 +02:00
twosee
63171d88f2 Add do...while(0) for RETURN_* and ZVAL_* APIs
Closes GH-4255.
2019-06-12 16:17:16 +02:00
Dmitry Stogov
e029cc4dd4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Cheaper checks for exceptions thrown from __toString()
2019-06-06 02:23:17 +03:00
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03: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
Dmitry Stogov
b2cdde0826 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros
2019-05-28 20:19:15 +03:00
Dmitry Stogov
83804519df Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros 2019-05-28 20:10:02 +03:00
Nikita Popov
20e983d9ce Merge branch 'PHP-7.4' 2019-05-14 14:59:36 +02:00
Nikita Popov
3f19f5112a Add RETURN_EMPTY_ARRAY() / RETVAL_EMPTY_ARRAY()
The usual wrappers around ZVAL_EMPTY_ARRAY()...
2019-05-14 14:59:10 +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
be31a9468d Merge branch 'PHP-7.4' 2019-05-08 17:06:34 +02:00
Nikita Popov
e4e6820d10 Use fast zpp for ReflectionClass constructor
At this point zpp overhead makes up a significant part of this
function.
2019-05-08 17:06:00 +02:00
Nikita Popov
230d3089b3 Merge branch 'PHP-7.4' 2019-05-08 15:44:29 +02:00
Nikita Popov
ee0fc1b5ae Optimize $name/$class property population in reflection
Instead of going through write_property, directly assign to the
respective property slot.
2019-05-08 15:43:42 +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
c5d9a44798 Merge branch 'PHP-7.4' 2019-02-28 15:46:58 +01:00
Nikita Popov
f4ded492c9 Don't return inside _DO_THROW macro
Returning inside _DO_THROW() is kind of pointless if we are going
to comment most uses with "this is gonna return".
2019-02-28 15:45:47 +01:00
Joe Watkins
0e391d14bf
Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #77673 ReflectionClass::getDefaultProperties returns spooky array
2019-02-27 09:18:20 +01:00
Joe Watkins
1ca9d818b8
Fix #77673 ReflectionClass::getDefaultProperties returns spooky array 2019-02-27 09:17:09 +01:00
Nikita Popov
879cd04913 Merge branch 'PHP-7.4' 2019-02-18 17:51:41 +01:00