1
0
mirror of https://github.com/php/php-src.git synced 2026-04-13 19:14:16 +02:00
Commit Graph

899 Commits

Author SHA1 Message Date
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
d7a3edd45d Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +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
be2ddc6b65 Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:23:52 +02:00
Nikita Popov
0b6063f331 Restore array_key_exists() compatibility for ArrayObject
Doing this by special-casing array_key_exists() for ArrayObject.
2018-10-11 16:10:22 +02:00
Nikita Popov
a5fa51afbb Don't overload get_properties for ArrayObject
Instead overload get_properties_for for a few specific cases such
as array casts. This resolves the issue where ArrayObject
get_properties may violate engine invariants in some cases.
2018-10-10 10:39:10 +02:00
Nikita Popov
ab2120e4e5 Fix test 2018-09-30 19:56:28 +02:00
Kalle Sommer Nielsen
8595dc8fa9 Fix some tests and improve coverage for Windows in SPL 2018-09-30 10:41:34 +02:00
Peter Kokot
80c6ba26e3 Remove and refactor ext/spl/examples
- Test file from ext/spl/examples has been moved to ext/spl/tests
- Other custom SPL examples and implementations were removed in favor of
the PHP manual.
2018-09-29 09:29:32 +02:00
Peter Kokot
bfa2c7158f Fix permissions
Certain files don't need to be executables.
2018-09-21 14:12:25 +02:00
Gabriel Caruso
f72b6c5e19 Use EXPECT instead of EXPECTF when possible 2018-09-16 15:39:18 -03:00
Christoph M. Becker
3278b3347c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #68825: Exception in DirectoryIterator::getLinkTarget()
2018-08-22 15:40:03 +02:00
Christoph M. Becker
36946f5c45 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #68825: Exception in DirectoryIterator::getLinkTarget()
2018-08-22 15:38:30 +02:00
Christoph M. Becker
32a728d351 Fix #68825: Exception in DirectoryIterator::getLinkTarget()
intern->file_name may not have been properly set when
DirectoryIterator::getLinkTarget() is called, so we make sure it is
before using it.
2018-08-22 15:37:02 +02:00
Christoph M. Becker
be2447fb7c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add regression test for bug #68175
  Fix #68175: RegexIterator pregFlags are NULL instead of 0
2018-08-18 14:39:15 +02:00
Christoph M. Becker
41d2102c77 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Add regression test for bug #68175
  Fix #68175: RegexIterator pregFlags are NULL instead of 0
2018-08-18 14:37:48 +02:00
Christoph M. Becker
4c448334bd Add regression test for bug #68175 2018-08-18 14:36:16 +02:00
Gabriel Caruso
c93aba042f Give a reason why the test was skipped
This will help us debug why a test was skipped in GCOV
(http://gcov.php.net/viewer.php?version=PHP_HEAD&func=skip), and maybe
put them to run again
2018-07-22 16:41:41 -03:00
Nikita Popov
d9acfa45b8 Deprecate fgetss() and gzgetss()
SplFileObject::fgetss() will also generate a deprecation notice
through an internal call to fgetss().

Part of RFC https://wiki.php.net/rfc/deprecations_php_7_3.
2018-07-21 22:38:35 +02:00
Xinchen Hui
0aff0548cb Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWS
  Fixed bug #76367 (NoRewindIterator segfault 11)
2018-05-23 14:46:32 +08:00
Xinchen Hui
dc461d6f56 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76367 (NoRewindIterator segfault 11)
2018-05-23 14:46:01 +08:00
Xinchen Hui
8f221bdec0 Fixed bug #76367 (NoRewindIterator segfault 11) 2018-05-23 14:45:38 +08:00
Gabriel Caruso
e1cc4863d9 Remove duplicated tests 2018-02-22 13:03:21 +01:00
Gabriel Caruso
b895690dfa remove support for string|unicode in tests 2018-02-22 08:11:30 +01:00
Gabriel Caruso
ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Nikita Popov
ede663f381 Convert iterator by reference errors to exceptions
I'm using RuntimeException in SPL, because other SPL classes that
throw this error used it. Error is used for everything else, because
that's what core does.
2018-02-19 21:58:56 +01:00
Gabriel Caruso
6d785a7a00 Test more functionalities of SPL 2018-02-19 08:26:34 +01:00
Joe
748c40867b Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #74519 strange behavior of AppendIterator
2018-02-08 10:19:15 +01:00
Joe
ab770401e1 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #74519 strange behavior of AppendIterator
2018-02-08 10:18:31 +01:00
CHU Zhaowei
495508eceb fix #74519 strange behavior of AppendIterator 2018-02-08 10:15:09 +01:00
Gabriel Caruso
fef879a2d6 Use bool instead of boolean while throwing a type error
PHP requires boolean typehints to be written "bool" and disallows
"boolean" as an alias. This changes the error messages to match
the actual type name and avoids confusing messages like "must be
of type boolean, boolean given".

This a followup to ce1d69a1f6, which
implements the same change for integer->int.
2018-02-04 23:09:40 +01:00
Gabriel Caruso
ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Gabriel Caruso
766ce8bdd5 Remove superfluous SKIPIF sections in SPL tests 2018-02-03 17:50:31 +01:00
Gabriel Caruso
53dbc69a8d Use %d when expecting line number in tests 2018-02-02 22:35:13 +01:00
timurib
a484b9a535 Fix #75765 Exception on extend of undefined class
As the parent class is fetched prior to binding, there are no
safety concerns in this case and we can replace the fatal error
with an Error exception.
2018-01-12 18:41:39 +01:00
Nikita Popov
26207101c5 Merge branch 'PHP-7.2' 2017-12-22 18:22:52 +01:00
Nikita Popov
12e991f5bd Merge branch 'PHP-7.1' into PHP-7.2 2017-12-22 18:22:47 +01:00
Nikita Popov
f14b6f4920 Fixed bug #73209 2017-12-22 18:22:00 +01:00
Nikita Popov
d90797a896 Merge branch 'PHP-7.2' 2017-12-22 18:12:23 +01:00
Nikita Popov
2c880037f5 Merge branch 'PHP-7.1' into PHP-7.2 2017-12-22 18:12:17 +01:00
Nikita Popov
ec142f2c86 Fixed bug #75242 2017-12-22 18:11:38 +01:00
Nikita Popov
9fe0eb8c48 Merge branch 'PHP-7.2' 2017-12-22 18:01:53 +01:00
Nikita Popov
74e3da5c8c Merge branch 'PHP-7.1' into PHP-7.2 2017-12-22 18:01:30 +01:00
Nikita Popov
ccb113c3e5 Fixed bug #75717 2017-12-22 18:01:03 +01:00
Nikita Popov
9cdd547eca Fixed bug #74372 2017-12-06 23:36:09 +01:00
Christoph M. Becker
43152bc39f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)
2017-09-20 15:54:07 +02:00
Christoph M. Becker
0c0b955d5f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)
2017-09-20 15:47:02 +02:00
Christoph M. Becker
eedc060c92 Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)
We must not overwrite the SPL_DLLIST_IT_FIX flag when changing the
iterator mode.
2017-09-20 15:46:04 +02:00
Joe Watkins
f87e513557 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  fix bug #75173 incorrect behavior of AppendIterator::append in foreach loop
2017-09-12 07:08:01 +01:00