Commit Graph

270 Commits

Author SHA1 Message Date
Zeev Suraski
38c337f22e Remove year range from copyright notice 2019-01-30 11:00:23 +02:00
jvoisin
fbdaabba62 Fix some sign-related issues in comparisons 2019-01-09 10:01:12 +01:00
jvoisin
3d9624e126 Fix a warning about comparing signed/unsigned variables
This can be seen here: https://travis-ci.org/nbs-system/snuffleupagus/jobs/473895085#L685
2019-01-06 01:54:48 +01:00
Dmitry Stogov
cbf642b715 Create object only after parameter checks 2018-12-26 13:06:33 +03: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
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
37c329d715 Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
Nikita Popov
74d138e4a3 Fix incorrect printf modifier after size_t changes 2018-10-04 12:13:46 +02:00
Kalle Sommer Nielsen
5268f367ce Hopefully last round of size_t fixes, this makes the remaining php_hash_ops use size_t over an int 2018-10-03 13:36:05 +02:00
Kalle Sommer Nielsen
c116326793 Remove $ext_shared usage for ext/hash in the Unix build script (Thanks Christoph for the notice) 2018-10-03 11:36:11 +02:00
Kalle Sommer Nielsen
84b0d0faba Second round of fixing compiler warnings in ext/hash. Lots of the signatures that previously was unsigned int is now size_t, there was a fair bit of inconsistency there already and this commit should make it all sync nicely 2018-10-03 11:32:57 +02:00
Kalle Sommer Nielsen
f7991ca656 Revert "Fix compiler warnings in ext/hash"
This reverts commit 596fbf7393.
2018-10-03 10:37:20 +02:00
Kalle Sommer Nielsen
596fbf7393 Fix compiler warnings in ext/hash 2018-10-03 08:48:27 +02:00
Kalle Sommer Nielsen
f73c0102d6 Update hash tests for consistency in their titles and remove the skipif sections (except for the mhash related tests) 2018-10-03 08:48:11 +02:00
Kalle Sommer Nielsen
bf34442581 Implemented RFC "Always available hash extension" 2018-10-03 08:47:07 +02:00
Sara Golemon
ffc7f8ae52 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76918 Repeated parameter name in arg info
2018-09-25 12:10:33 -04:00
Sara Golemon
913c20e61f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #76918 Repeated parameter name in arg info
2018-09-25 12:10:21 -04:00
Sara Golemon
4baf4964ad Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76918 Repeated parameter name in arg info
2018-09-25 12:09:38 -04:00
Sara Golemon
b5d0eb44c0 Fixed bug #76918 Repeated parameter name in arg info 2018-09-25 11:18:24 -04:00
Dmitry Stogov
8939c4d96b Get rid of ZEND_ACC_CTOR, ZEND_ACC_DTOR and ZEND_ACC_IMPLEMENTED_ABSTRACT 2018-09-05 13:16:10 +03:00
Peter Kokot
02294f0c84 Make PHP development tools files and scripts executable
This patch makes several scripts and PHP development tools files
executable and adds more proper shebangs to the PHP scripts.

The `#!/usr/bin/env php` shebang provides running the script via
`./script.php` and uses env to find PHP script location on the system.
At the same time it still provides running the script with a user
defined PHP location using `php script.php`.
2018-08-29 20:58:17 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
b6cc4d2009 Use zval_ptr_dtor() instead of zval_dtor() in internal functions that destroy new created object (This is safer and produces less code) 2018-07-05 11:54:26 +03:00
Peter Kokot
3f96f01e9e Bump phar and hash extension version to match PHP version 2018-06-21 13:15:32 +02:00
Dmitry Stogov
f2b4ec4bdc Export standard object handlers, to avoid indirect access 2018-05-31 11:57:22 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Anatol Belski
f9822b143e Remove unused argument 2018-03-14 16:33:57 +01:00
Gabriel Caruso
701437a948
Remove return types from some magic method in protos
__construct, __destruct, __wakeup does not have return types defined.
2018-03-09 12:04:46 +01:00
Dmitry Stogov
4d75504d4f Avoid double copying and string length recalculation 2018-03-06 21:19:18 +03:00
Christoph M. Becker
701d1ab0cc Fix skip condition
The test is not about mhash, but rather about hash.
2018-02-23 16:23:55 +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
Anatol Belski
d3cb224eb3 Avoid conditions inside loop 2018-02-09 19:28:20 +01:00
Anatol Belski
3e6492f305 Improve loop vectorization 2018-02-09 19:28:20 +01:00
Anatol Belski
e87dfb1da2 Improve loop vectorization 2018-02-09 19:28:20 +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
9a4cc52c23 Remove superfluous PHP version check in tests
Also remove tests that target only old PHP versions.
2018-02-04 16:58:54 +01:00
Gabriel Caruso
c6c9e71a5b Add missing SKIPIF sections 2018-02-03 13:54:34 +01:00
Gabriel Caruso
8034fdc9d9 Use int instead of integer in proto 2018-02-02 22:32:15 +01:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Nikita Popov
b72b1a4e4d Add zend_object_alloc() API
Using ecalloc() to create objects is expensive, because the
dynamic-size memset() is unreasonably slow. Make sure we only
zero the main object structure with known size, as the properties
are intialized separately anyway.

Technically we do not need to zero the embedded zend_object
structure either, but as long as the memset argument is constant,
a couple more bytes don't really matter.
2017-11-25 17:12:37 +01:00
Anatol Belski
80d6eb6806 Fix unsigned comparisons and remove dead code
Fix unsigned comparison

Cleanup never executed block

Fix unsigned comparison

Fix unsigned comparison, diff can't be < 0

Fix unsigned comparison

Fix unsigned comparison

Remove dead code
2017-11-17 22:38:44 +01:00
Dmitry Stogov
0056f52f50 Use interned strings for hash algorithm names (not copyied into SHM) 2017-11-01 02:40:39 +03:00
Remi Collet
d68879c734 Merge branch 'PHP-7.2'
* PHP-7.2:
  NEWS
  Fix Bug #75284 sha3 is not supported on bigendian machine
  NEWS
2017-10-03 06:42:48 +02:00
Remi Collet
d67873ec99 Fix Bug #75284 sha3 is not supported on bigendian machine 2017-10-03 06:41:46 +02:00