Commit Graph

823 Commits

Author SHA1 Message Date
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Nikita Popov
4ef4e34c2e Merge branch 'PHP-7.0' into PHP-7.1 2016-12-18 17:10:54 +01:00
Nikita Popov
c1af9f282f Fix bug #46103 2016-12-18 17:10:19 +01:00
Dmitry Stogov
bdc1ba3e3a Intriduced ZEND_ACC_INHERITED class flag.
It's going to be helpful for static optimisations, when "parent" is not known yet.
2016-11-01 22:56:25 +03:00
Nikita Popov
02ba9d71ab Unwrap reference returns in cufa etc 2016-09-30 22:10:01 +02:00
Nikita Popov
f70fb05138 Don't mark ReflectionType::__toString() as deprecated for now 2016-09-28 19:21:53 +02:00
Nikita Popov
bf907b9961 Revert ReflectionType::__toString() behavior + deprecate 2016-09-28 19:21:51 +02:00
Andrea Faulds
fc5497cb92 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 22:46:20 +01:00
Andrea Faulds
d690014bf3 Remove zpp fallback code (always use Fast ZPP)
Squashed commit of the following:

commit 3e27fbb3d2
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Sep 11 19:14:37 2016 +0100

    Keep dummy FAST_ZPP macro for compatibility

commit 8a7cfd00de
Author: Andrea Faulds <ajf@ajf.me>
Date:   Mon Sep 5 22:36:03 2016 +0100

    Remove FAST_ZPP macro and plain zpp fallback code
2016-09-11 22:44:46 +01:00
Davey Shafik
12ee17d5e0 Implement \ArgumentCountError exception 2016-08-30 19:35:56 -07:00
Levi Morrison
f4e68a3968 Revert "Do not prepend ? on nullables in ReflectionType::__toString()"
This reverts commit 8855a2ce76.
2016-08-23 09:43:31 -06:00
Nikita Popov
906456c410 call_user_func(_array): Don't abort on reference warning
Change zend_call_function() to not abort the call if a non-reference
is passed to a reference argument. The usual warning will still be
thrown, but the call will proceed as usual.
2016-08-23 10:29:15 +03:00
Aaron Piotrowski
8855a2ce76 Do not prepend ? on nullables in ReflectionType::__toString()
Better BC with 7.0.
2016-08-21 00:12:47 -05:00
Aaron Piotrowski
c9ee0cb202 Revert "Append \ to class name returned from ReflectionType::__toString()"
This reverts commit 20fdd47921.
2016-08-20 23:26:01 -05:00
Nikita Popov
dfed09afca Fix off-by-one in ReflectionType::__toString()
Review mistake...
2016-08-20 19:00:03 +02:00
Aaron Piotrowski
20fdd47921 Append \ to class name returned from ReflectionType::__toString() 2016-08-16 11:28:33 -05:00
Xinchen Hui
60de74ebda Fixed bug #72846 (getConstant for a array constant with constant values returns NULL/NFC/UKNOWN) 2016-08-15 23:22:55 +08:00
Aaron Piotrowski
622d2f41d1 ReflectionType improvements
Added ReflectionNamedType and updated ReflectionType::__toString()
2016-08-11 12:19:33 +02:00
Christoph M. Becker
f706897f33 Implement #38992: invoke() and invokeArgs() static method calls should match
We don't want ReflectionMethod::invoke() to simply ignore its first argument,
if the method to invoke is a static method. Instead we match its ZPP with
that of ReflectionMethod::invokeArgs(). Furthermore, we apply the DRY
principle by factoring out the code to a common helper function to prevent
inadvertent future divergence of the implementations of both methods.

As can be seen from the necessity to adapt some test cases, this causes a
BC break for some pathological cases. Therefore we apply this patch to PHP
7.1 only, which is still in beta phase.
2016-08-08 01:43:03 +02:00
Xinchen Hui
a3a797dbd5 Fixed bug #72661 (ReflectionType::__toString crashes with iterable) 2016-07-24 11:01:19 +08:00
Nikita Popov
981b94e0cf Merge branch 'PHP-7.0' 2016-07-13 21:52:40 +02:00
Nikita Popov
57c9983619 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/reflection/php_reflection.c
2016-07-13 21:48:05 +02:00
nikita2206
eb190b4e91 fix: bug72222 for PHP-5.6 reflection export of array consts 2016-07-13 21:39:55 +02:00
Aaron Piotrowski
24237027bc Merge branch 'throw-error-in-extensions' 2016-07-05 02:08:39 -05:00
Aaron Piotrowski
e4b1bfc075 Add missed return replacing bail out 2016-06-29 09:56:25 -05:00
Dmitry Stogov
0cfb47651c Fixed compilation warnings 2016-06-28 11:37:51 +03:00
Dmitry Stogov
323b2733f6 Fixed compilation warnings 2016-06-22 00:40:50 +03:00
Dmitry Stogov
ff363e2e7c Implemented RFC: Replace "Missing argument" warning with "Too few arguments" exception
Squashed commit of the following:

commit 8b45fa2acb
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jun 16 01:52:50 2016 +0300

    Separate slow path of ZEND_RECV into a cold function.

commit 9e18895ee5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 23:26:28 2016 +0300

    Required argument can't be IS_UNDEF anymore.

commit 662db66e39
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 31 17:14:50 2016 +0300

    Replace "Missing argument" warning by "Too few arguments" exception.
2016-06-16 02:32:02 +03:00
Dmitry Stogov
a9512af810 Implemented RFC: Fix inconsistent behavior of $this variable
Squashed commit of the following:

commit bdd3b6895c
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jun 16 00:19:42 2016 +0300

    Fixed GOTO VM

commit 2f1d7c8b89
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 21:01:57 2016 +0300

    Removed unused variable

commit cf749c42b0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 19:06:16 2016 +0300

    Protection from $this reassign through mb_parse_str()

commit 59a9a6c83c
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 18:14:50 2016 +0300

    Added type inference rule for FETCH_THIS opcode

commit 73f8d14a85
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 18:11:18 2016 +0300

    Restored PHP-7 behavior of isset($this->foo).
    It throws exception if not in object context.
    Removed useless opcode handlers.

commit fa0881381e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 31 12:25:47 2016 +0300

    Changed "Notice: Undefined variable: this" into "Exception: Using $this when not in object context".

commit e32cc528c0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 24 02:02:43 2016 +0300

    Throw exception on attempt to re-assign $this through extract() and parse_str().

commit 41f1531b52
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon May 23 22:18:36 2016 +0300

    Fixed inconsistent $this behavior
2016-06-16 02:30:23 +03:00
Aaron Piotrowski
771e5cc247 Replace zend_ce_error with NULL and replace more E_ERROR with thrown Error 2016-06-13 09:02:17 -05:00
Aaron Piotrowski
e3c681aa5c Merge branch 'master' into throw-error-in-extensions 2016-06-10 22:02:23 -05:00
Joe Watkins
3684d41172 fix #72209 (ReflectionProperty::getValue() doesn't fail if object doesn't match type) 2016-05-14 06:28:11 +01:00
Nikita Popov
20560da118 Merge branch 'PHP-7.0'
Conflicts:
	ext/reflection/php_reflection.c
2016-05-10 12:17:54 +02:00
Nikita Popov
a1ed4ab3ca Fixed bug #72174
Also fixes a memory leak if ::getValue() is used with __get().
2016-05-10 12:13:10 +02:00
Nikita Popov
4b0f9586db Add missing update_constants in ReflectionClassConstant
Also fix indentation of __toString().
2016-05-02 11:43:01 +02:00
Nikita Popov
5595dd5ffa Revert code to use DUP instead of COPY
In a1c405e0c5 next to the actual fix
I have also switched some (effective) ZVAL_DUPs to ZVAL_COPYs. I'm
reverting this part as those were probably there for a reason
(presumably issues with non-atomic refcounting on ZTS).
2016-04-29 22:02:31 +02:00
Nikita Popov
a1c405e0c5 Fix usages of zend_update_constant_ex
If an in-place update in an external zval is performed, it needs
to incref'd beforehand, not afterwards.
2016-04-29 14:06:39 +02:00
Dmitry Stogov
6499162ff0 - get rid of EG(scope). zend_get_executed_scope() should be used instead.
- ichanged zval_update_constant_ex(). Use IS_TYPE_IMMUTABLE flag on shared constants and AST, instead of "inline_change" parameter.
2016-04-28 04:13:34 +03:00
Dmitry Stogov
f0a2e8eb13 Removed "zend_fcall_info.function_table". It was assigned in many places, but is never used. 2016-04-27 13:46:38 +03:00
Nikita Popov
64f91774f2 Remove IS_VAR_RET_REF flag
Instead decide whether a function returned by reference or by value
by checking whether the return value has REFERENCE type. This means
that functions returning by reference must always return a reference
and functions returning by value must not return a reference.
2016-04-15 15:32:20 +02:00
Dmitry Stogov
7abfaac901 Merge zend_execute_data->called_scope into zend_execute_data->This.
"called_scope" made sense only for static method calls, for dynamic calls it was always equal to the class of $this.
Now EG(This) may store IS_OBJECT + $this or IS_UNUSED + "called_scope" (of course, "called_scope" may be NULL).
Some code might need to be adopted to support this change.
Checks (Z_OBJ(EX(This))) might need to be converted into (Z_TYPE(EX(This)) == IS_OBJECT).
2016-04-01 16:17:49 +03:00
Nikita Popov
d9f0c8429d Merge branch 'PHP-7.0' 2016-03-11 22:28:50 +01:00
Grigorii Sokolik
ccc5150f15 Fix bug #71767 2016-03-11 22:27:48 +01:00
Dmitry Stogov
c67c166f93 Removed zend_fcall_info.symbol_table 2016-03-02 17:50:55 +03:00
marcosptf
625345f58c Update ReflectionClass_isArray.phpt 2016-02-05 13:50:06 -02:00
marcosptf
2c7341ca16 test to function ReflectionParameter::isArray
was created a new test uncovered yet!
:-)
2016-02-05 12:21:10 -02:00
Andrea Faulds
1b36037689 Test for void 2016-01-28 18:07:45 +00:00
Andrea Faulds
8412de9da5 Support void return type in reflection 2016-01-28 18:01:48 +00:00
Joe Watkins
11cf826b89 fix ReflectionClass::__toString doc block omitted 2016-01-20 10:54:55 +00:00
Joe Watkins
98164714ea Merge branch 'PHP-7.0' of https://github.com/php/php-src into PHP-7.0 2016-01-20 10:52:57 +00:00