1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 23:48:14 +02:00
Commit Graph

801 Commits

Author SHA1 Message Date
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
Tyson Andre 9249d82019 Fix typos in code comments [skip ci] 2019-02-18 17:48:12 +01:00
Nikita Popov ec694a9e81 Merge branch 'PHP-7.4' 2019-02-14 11:48:06 +01:00
Nikita Popov 1a5cff334d Remove bogus ctor checks in get_class_methods() + reflection
Contrary to the comments, these only hide constructors (old or new
style) if they a) are inherited b) come from a trait and c) are
aliased -- which doesn't make any sense at all.
2019-02-14 11:47:31 +01:00
Dmitry Stogov 4474cf43e6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #77613 (method visibility change) (reverted ZEND_ACC_CTOR and ZEND_ACC_DTOR flags removal)
2019-02-14 13:18:45 +03:00
Dmitry Stogov 43a7d95016 Fixed bug #77613 (method visibility change) (reverted ZEND_ACC_CTOR and ZEND_ACC_DTOR flags removal) 2019-02-14 13:12:50 +03: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
Dmitry Stogov f45e0ce928 Remove ZEND_OVERLOADED_FUNCTION and corresponding call_method object handler 2019-02-07 21:05:46 +03:00
Dmitry Stogov 91ef4124e5 Refactor zend_object_handlers API to pass zend_object* and zend_string* insted of zval(s). 2019-02-04 13:20:25 +03:00
Peter Kokot 92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski 0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02: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
jvoisin fbdaabba62 Fix some sign-related issues in comparisons 2019-01-09 10:01:12 +01:00
Nikita Popov ba5cb2eb32 Remove unnecessary uses of object_and_properties_init
Use object_init_ex instead if the properties are NULL.
2019-01-07 16:00:29 +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