Commit Graph

791 Commits

Author SHA1 Message Date
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
Joe Watkins
b899656eb0 fix ReflectionClass::__toString doc block omitted 2016-01-20 10:52:27 +00:00
Lior Kaplan
3d5438bf7b Merge branch 'PHP-7.0'
* PHP-7.0:
  Update header to PHP Version 7
  Happy new year (Update copyright to 2016)
  Happy new year (Update copyright to 2016)
2016-01-01 20:04:31 +02:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Xinchen Hui
0adbf6de77 Remove useless check 2015-12-09 11:37:40 +08:00
Dmitry Stogov
c58b0cb4ce Removed useless checks 2015-12-08 12:47:05 +03:00
Dmitry Stogov
a75c195000 Implemented the RFC Support Class Constant Visibility.
Squashed commit of the following:

commit f11ca0e7a5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Dec 8 12:38:42 2015 +0300

    Fixed test expectation

commit 211f873f54
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Dec 8 12:28:38 2015 +0300

    Embed zend_class_constant.flags into zend_class_constants.value.u2.access_flags

commit 51deab84b2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Dec 7 11:18:55 2015 +0300

    Fixed issues found by Nikita

commit 544dbd5b47
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Sat Dec 5 02:41:05 2015 +0300

    Refactored immplementation of https://wiki.php.net/rfc/class_const_visibility
    @reeze created an RFC here and I emailed internals here and didn't get any responses positive/negative.
2015-12-08 12:40:42 +03:00
Xinchen Hui
3ae3341533 Fixed bug #71018 (ReflectionProperty::setValue() behavior changed) 2015-12-04 11:52:08 +08:00
Xinchen Hui
b0f472b3b2 Fixed test 2015-11-27 11:42:30 +08:00
Xinchen Hui
6cb6c04499 Fixed bug #70982 (setStaticPropertyValue behaviors inconsistently with 5.6) 2015-11-27 11:32:38 +08:00
Xinchen Hui
e637ead6ed Merge branch 'PHP-5.6' into PHP-7.0 2015-11-24 13:45:32 +08:00
Xinchen Hui
e6b46dc2ff Fixed bug #70960 (ReflectionFunction for array_unique returns wrong number of parameters) 2015-11-24 13:45:16 +08:00
Xinchen Hui
8c51578c81 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-23 18:48:51 +08:00
Xinchen Hui
b9845e5006 Add bug #70957 and #70958 releated test in refection 2015-11-23 18:48:21 +08:00
James Titcumb
bb55ac6279 Fixed typo in reflection phpt 2015-11-07 22:58:56 -08:00
Xinchen Hui
95446b4416 Indents 2015-10-23 11:19:30 +08:00
c9s
bbaf6daa9d Fix boolean conversion warnings
Summary:

The compiler complains and raised some warnings about boolean
conversion:

    warning: address of 'ce->constants_table' will always evaluate to
    'true' [-Wpointer-bool-conversion]

Since the address of 'HashTable' will always evaluate to true. the
condition should be removed. The scope is kept for local variables.

Platform:

    OS X 10.11

Compiler:

    Apple LLVM version 7.0.0 (clang-700.0.72)
    Target: x86_64-apple-darwin15.0.0
    Thread model: posix
2015-10-23 11:19:19 +08:00
Bob Weinand
60b4355168 Do not create a fake Closure for real Closures
That is solved by just returning the Closure as is, which is safe due to Closures being immutable objects
2015-10-14 12:07:33 +02:00
Xinchen Hui
534856c98a Move the tests to proper place 2015-10-14 10:26:02 +08:00
Dmitry Stogov
23b372d358 Forbid "fake" closure rebinding 2015-10-12 20:34:08 +02:00
Dmitry Stogov
91fb3a7b27 Fixed bug #70674 (ReflectionFunction::getClosure() leaks memory when used for internal functions) 2015-10-09 00:45:02 +03:00
Márcio Almada
ddb6d7801e Fix bug #70650 2015-10-07 16:25:59 +02:00
Xinchen Hui
6876112c89 Fixed the third one of (segfault in gc_remove_from_buffer())
This one maybe only used in debug mode, so no bug report and no test
script provided
2015-10-03 20:15:35 -07:00
Xinchen Hui
4744eec753 Fixed bug #70631 (Another Segfault in gc_remove_from_buffer()) 2015-10-03 20:08:21 -07:00
marcosptf
519016096f Add test for ReflectionMethod::getPrototype_basic() 2015-09-02 00:28:46 +02:00
Bob Weinand
5ece3ec71c Fix bogus traces with ReflectionGenerator::getTrace() 2015-08-20 23:24:28 +02:00
Dmitry Stogov
715d5d2855 Get rid of implicit type casting in GC_*() macros in Zend/zend_types.h.
This prevented compilation warnings and disclosed few incorrect usages in Zend/zend_vm_def.h and ext/dom/xpath.c.
Now explicit type casting may be required on call site.
This may break some C extension code, but it shoulfn't be a problem to add explicit casting.
2015-08-13 13:56:29 +03:00
Nikita Popov
3c33854e7c Don't leak generator cycle in ReflectionGenerator test
This is tracked by bug #69989.
2015-07-03 19:33:28 +02:00
Aaron Piotrowski
ed1b64877d Switch position of ce in exception ce variable names 2015-07-03 09:45:03 -05:00
Aaron Piotrowski
a812a74c2e Change zend_exception_get_default() to zend_exception_ce 2015-07-03 09:44:48 -05:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00