1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Commit Graph

2974 Commits

Author SHA1 Message Date
Christoph M. Becker 9216f5b92b Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77291: magic methods inherited from a trait may be ignored
2018-12-16 13:36:02 +01:00
Christoph M. Becker 0061db5503 Fix #77291: magic methods inherited from a trait may be ignored
When adding methods from a trait, we must not assume that a method name
with the same length as the name of the using class is either a PHP 4
style constructor, or not a magic method at all – it may well be
another magic method.

We mostly preserve the spirit of the optimization which caused this
regression, and avoid string comparisons for all method names which can
never be magic methods.
2018-12-16 13:30:11 +01:00
Gabriel Caruso 35be0590ed Remove unecessaries SKIPIF sections for necessary extensions 2018-11-21 08:08:09 -02:00
Nikita Popov 2fac9d9ec1 Remove some mentions of RECOVERABLE_ERROR in tests
Mostly drop error handlers that are no longer necessary.
2018-11-15 22:13:46 +01:00
Nikita Popov 149e6aaa99 Fix accessibility checks for dynamic properties
A dynamic property may be shadowed by a private/protected property.
Make sure we check property accessibility for non-indirect
properties as well.

Closes #3626.
2018-10-22 16:46:33 +02:00
Peter Kokot b10082f942 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix failing Zend/tests due to newlines
2018-10-15 05:04:38 +02:00
Peter Kokot 6b8605d31f Fix failing Zend/tests due to newlines 2018-10-15 05:04:29 +02: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 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
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
Nikita Popov 4d5d77904e Fix foreach/get_object_vars for shadowed properties
If we are in a scope where the shadowed private property is
visible, the shadowing public property should not be visible.
2018-10-10 23:18:34 +02:00
Pierrick Charron 9b4594515a Merge branch 'PHP-7.3' 2018-10-09 01:27:39 -04:00
Pierrick Charron 44d2c8c6dd Merge branch 'PHP-7.2' into PHP-7.3 2018-10-09 01:26:55 -04:00
Pierrick Charron efa5674a9b Merge branch 'PHP-7.1' into PHP-7.2 2018-10-09 01:20:01 -04:00
Pierrick Charron f42d7bddc0 Fixed bug #76965 INI_SCANNER_RAW doesn't strip trailing whitespace 2018-10-09 00:00:21 -04:00
Nikita Popov e25b23ed0c Merge branch 'PHP-7.3' 2018-10-06 11:22:24 +02:00
Michael Moravec 0a6ddc7722 Fix bug #76979: define() error message does not mention resources as valid values 2018-10-06 11:21:51 +02:00
Nikita Popov fc18f44213 Deprecate unbinding of $this of non-static methods
Static calls to non-static methods have been fully deprecated in
PHP 7.0 as part of https://wiki.php.net/rfc/reclassify_e_strict.

A combination of ReflectionMethod::getClosure() ("fake closures")
and Closure::bindTo() etc can be used to achieve the same behavior.
This commit ensures that a deprecation notice will be thrown also
in this case.
2018-09-29 21:01:27 +02:00
Nikita Popov 2ae2e820be Merge branch 'PHP-7.3' 2018-09-29 14:23:13 +02:00
Nikita Popov 8b8b625d08 Fixed bug #72635
This seems to be a simple oversight, where we did not enable
exceptions. Other constexpr conditions already throw, so there is
no particular reason to stick to a fatal error here.
2018-09-29 14:21:08 +02:00
Nikita Popov 7ef42ec359 Merge branch 'PHP-7.3' 2018-09-28 19:18:01 +02:00
Nikita Popov 7189e0b70f Merge branch 'PHP-7.2' into PHP-7.3 2018-09-28 19:17:53 +02:00
Nikita Popov 8e7dfc6ddf Merge branch 'PHP-7.1' into PHP-7.2 2018-09-28 19:17:29 +02:00
Nikita Popov 83e2b9e220 Fixed bug #76946 2018-09-28 19:15:19 +02:00
Nikita Popov 65abbdad70 Merge branch 'PHP-7.3' 2018-09-28 13:41:36 +02:00
Nikita Popov 8ebe1b8de1 Merge branch 'PHP-7.2' into PHP-7.3 2018-09-28 13:41:29 +02:00
Nikita Popov 99eb4b2ea4 Merge branch 'PHP-7.1' into PHP-7.2 2018-09-28 13:41:06 +02:00
Nikita Popov fa84b8ebb4 Fix test for release builds 2018-09-28 13:40:58 +02:00
Nikita Popov 136aa37681 Merge branch 'PHP-7.3' 2018-09-28 12:59:17 +02:00
Nikita Popov 25522baec4 Merge branch 'PHP-7.2' into PHP-7.3 2018-09-28 12:58:59 +02:00
Nikita Popov 1c35357b31 Merge branch 'PHP-7.1' into PHP-7.2 2018-09-28 12:57:55 +02:00
Nikita Popov 45cdcb2d0b Fixed bug #76846 2018-09-28 12:56:47 +02:00
Nikita Popov 5a4cb3edde Fix missing access errors for guarded properties
If a property access would normally result in a magic method call,
but the property is subject to an active recursion guard, the
access should behave as if the magic method does not exist.

This commit fixes one instance where this was not the case -- we
should have been generating a property access error, but instead
the operation simply did not do anything.
2018-09-27 14:58:26 +02:00
Peter Kokot 8e430d7e48 Remove outdated OOP examples Zend/tests/zend2.php.txt
This patch removes outdated examples file from the Zend/tests in favor
of the PHP manual OOP chapter [1].

[1] https://php.net/manual/en/language.oop5.php
2018-09-26 12:56:31 +02:00
Peter Kokot f6605c788f Rename *.php files in Zend/tests to *.inc
*.php files are ignored by Git and a better practice might be to rename
PHP included files for tests.
2018-09-23 17:20:42 +02:00
Nikita Popov c5f108c66c Handle binary_op failure in overloaded assigns 2018-09-23 15:29:25 +02:00
Peter Kokot bfa2c7158f Fix permissions
Certain files don't need to be executables.
2018-09-21 14:12:25 +02:00
Nikita Popov 10a1cfd17e Merge branch 'PHP-7.3' 2018-09-19 09:40:12 +02:00
Nikita Popov 040ca85eac Merge branch 'PHP-7.2' into PHP-7.3 2018-09-19 09:39:31 +02:00
Nikita Popov cc1fb02760 Merge branch 'PHP-7.1' into PHP-7.2 2018-09-19 09:39:13 +02:00
Nikita Popov 294fb83ee8 Fixed bug #76901
get_method() may modify the object pointer passed to it if method
forwarding is used. In this case we do not want to modify the
passed zval, so make sure that we copy the object into a temporary
first.
2018-09-19 09:37:04 +02:00
Peter Kokot 6f1a04120b Remove unused methods-on-non-objects-nested.inc
File `Zend/tests/methods-on-non-objects-nested.inc` was introduced
in 971d369d88 and made obsolete in
1c94ff0595.
2018-09-18 21:58:40 +02:00
Gabriel Caruso f72b6c5e19 Use EXPECT instead of EXPECTF when possible 2018-09-16 15:39:18 -03:00
Dmitry Stogov 7eb255e9db Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76800 (foreach inconsistent if array modified during loop)
2018-09-14 10:33:32 +03:00
Dmitry Stogov 17c7b71057 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #76800 (foreach inconsistent if array modified during loop)
2018-09-14 10:32:31 +03:00
Dmitry Stogov 3bc4a63fc2 Fixed bug #76800 (foreach inconsistent if array modified during loop) 2018-09-14 10:28:31 +03:00