Commit Graph

1815 Commits

Author SHA1 Message Date
Nikita Popov
852485d8ec Adjust tests for zpp TypeError change 2019-03-11 11:32:20 +01:00
Gabriel Caruso
726919e4b5 Merge branch 'PHP-7.4'
* PHP-7.4:
  Use EXPECT when possible
  Fix tests filenames
2019-03-11 00:07:32 -03:00
Gabriel Caruso
6c4e2079c0 Use EXPECT when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2019-03-11 00:05:44 -03:00
Peter Kokot
d0fd9fe977 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add AS_HELP_STRING to *nix build configure options
2019-03-07 20:38:04 +01:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Peter Kokot
2968a1d7f2 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove legacy AC_CHECK_TYPE calls for uint and ulong
2019-03-06 22:50:46 +01:00
Peter Kokot
bebcdcc745 Remove legacy AC_CHECK_TYPE calls for uint and ulong
The AC_CHECK_TYPE was refactored in more recent versions of Autoconf
and the call with two arguments is obsolete and not recommended anymore.

This patch also refactors some leftovers of using ulong and uint which
are not standard nor common usages of types in C.

The ulong can be used as zend_ulong and uint usage is actually
`unsigned int`.

The usage of HAVE_ULONG removed since it is not used in current code
base.

Legacy edgecase for some legacy HPUX systems removed:
- sys/stream.h header is not checked and the HAVE_SYS_STREAM_H is
  not defined with current build system.

- flags are unsigned int
- max_allowed_packet changed to unsigned int
2019-03-06 22:49:16 +01:00
Nikita Popov
c5d9a44798 Merge branch 'PHP-7.4' 2019-02-28 15:46:58 +01:00
Nikita Popov
248f9cf33f Remove more leftovers of mysqli embedded server 2019-02-28 15:43:29 +01:00
Anatol Belski
0c1470f9b7 Merge branch 'PHP-7.4'
* PHP-7.4:
  Sync with 7be0e06b48
2019-02-28 14:04:29 +01:00
Anatol Belski
9d356bab50 Sync with 7be0e06b48 2019-02-28 14:03:49 +01:00
Nikita Popov
ca8e2abb8e Merge branch 'PHP-7.4' 2019-02-28 12:56:00 +01:00
Nikita Popov
7be0e06b48 Remove mysqli embedded server support
This code is not compatible with PHP 7.0. The fact that nobody
complained that the mysqli embedded server functionality doesn't
build anymore seems like a strong signal that we can drop it...
2019-02-28 12:55:16 +01:00
Nikita Popov
82d6759982 Merge branch 'PHP-7.4' 2019-02-21 13:46:42 +01:00
Nikita Popov
8c2288bb0a Merge branch 'PHP-7.3' into PHP-7.4 2019-02-21 13:46:31 +01:00
Nikita Popov
e5d8ac92a4 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-21 13:45:53 +01:00
Nikita Popov
934691fabb Fixed bug #77597
The same variable was reused in two nested loops... The test doesn't
fail on 7.2, but I'm fixing this here anyway as the code is clearly
wrong, and probably erroneous in other situations.
2019-02-21 13:42:47 +01:00
Nikita Popov
c8e2b333cb Merge branch 'PHP-7.4' 2019-02-20 11:22:31 +01:00
Nikita Popov
c0e15a3b7f Implement fine-grained conflict handling
Tests can specify conflict keys, either in --CONFLICTS-- or
a per-directory CONFLICTS file. Non-conflicting tests may be run
in parallel.
2019-02-20 11:20:40 +01:00
Darek Slusarczyk
5c23370648 Merge branch 'PHP-7.4' 2019-02-11 18:50:45 +01:00
Darek Slusarczyk
9eacd9174c Merge branch 'PHP-7.3' into PHP-7.4 2019-02-11 18:47:58 +01:00
Darek Slusarczyk
6f7a47db5d Merge branch 'PHP-7.2' into PHP-7.3 2019-02-11 18:18:57 +01:00
Darek Slusarczyk
83d2bc9b6d Merge branch 'PHP-7.1' into PHP-7.2 2019-02-11 18:08:21 +01:00
Darek Slusarczyk
2eaabf06fc security fix - by default 'local infile' is disabled:
- set default for mysqli.allow_local_infile=0
- explicitly disable PDO::MYSQL_ATTR_LOCAL_INFILE in case of lack of driver options
- add getAttribute support for PDO::MYSQL_ATTR_LOCAL_INFILE
- update existing tests where needed
- add new tests [checking default value and setting on] the 'local infile' in ext/mysqli and ext/pdo_mysql
2019-02-11 18:04:51 +01:00
Peter Kokot
17baa87fad Merge branch 'PHP-7.4'
* PHP-7.4:
  Update and fix remaining year ranges (2019)
2019-02-08 23:15:49 +01:00
Peter Kokot
c245898bfa Update and fix remaining year ranges (2019)
This patch follows previous license year ranges updates. With new
approach source code files now have simplified headers with license
information without year ranges.
2019-02-08 23:14:29 +01: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
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
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
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
f1d7e3ca0b 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:31:31 +02:00
Peter Kokot
113213f027 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:29:24 +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
Peter Kokot
17ccbeec32 Trim trailing whitespace in *.phpt 2018-10-14 19:44:14 +02:00
Peter Kokot
7af945e271 Trim trailing whitespace in *.phpt 2018-10-14 19:43: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
Peter Kokot
60a69daec6 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:54:08 +02:00
Peter Kokot
03f3b8479b 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:51:01 +02:00
Peter Kokot
37c329d715 Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
Peter Kokot
3362620b5f Trim trailing whitespace in source code files 2018-10-13 14:16:33 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Peter Kokot
7f6387b59a Trim trailing whitespace in source code files 2018-10-13 14:12:55 +02:00
Peter Kokot
3f72c77ce4 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:21:27 +02:00
bugreportuser
cdedc1cb89
mysqli_fork: Fix undefined variable 2018-10-06 14:38:10 -03:00
Peter Kokot
c951836721 Remove unused files
- ext/simplexml/tests/bug25756_1.xml
- ext/simplexml/tests/bug25756_2.xml
- ext/simplexml/tests/bug25756.xsd
Added via 503d74aa29 and then removed via
9e29f17493

- ext/mysqli/tests/cacert.pem
- ext/mysqli/tests/client-cert.pem
- ext/mysqli/tests/client-key.pem
Added via e9f9f66f2e and then removed via
6d51b7b2e3

- ext/gd/tests/simpletext私はガラスを食べられます.jpg
Added via 3d3f11ede4 and never used

- ext/gd/tests/src.png
Added via cc938b5df0 and never used

- ext/zlib/tests/gzgetss.test
Added via d536ecac5c as a file content of the
ext/zlib/tests/gzgetss.gzbut but never used in tests directly. Removed for
better clarity of zlib tests

- ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl
- ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl
- ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl
Added via 1d25fc5c7b and never used

- ext/reflection/tests/exception.inc
Removed via 9f8ba2e8a1

- ext/phar/tests/files/extracted.inc
Removed via 549bf83bd1

- ext/phar/tests/cache_list/files/extracted.inc
Added via 05c3104097 and never used
2018-09-26 12:54:20 +02:00
Nikita Popov
e6a09f39b8 Merge branch 'PHP-7.3' 2018-09-19 12:32:03 +02:00
Nikita Popov
f5729ec532 Merge branch 'PHP-7.2' into PHP-7.3 2018-09-19 12:31:55 +02:00
Nikita Popov
c26902911f Merge branch 'PHP-7.1' into PHP-7.2 2018-09-19 12:31:46 +02:00
Nikita Popov
c614dd677c Fix intermittent failures in mysqli_stmt_bind_result_format.phpt
There were two distinct issues here:
 * $trend was compared against 'NULL' using !=, which does not work
   as intended in the case where $trend==0.0.
 * current_targets was declared as double(17,0), which means that
   the fractional part was rounded, so that the same comparison in
   SQL (rounded) and in PHP (not rounded) did not necessarily
   match.

Please don't write mt_rand based tests, it takes ages to debug this
crap...
2018-09-19 12:27:31 +02:00
Nikita Popov
37dc710ae6 Remove my_estrdup() and my_efree() macros
Replace the single use of my_efree().
2018-09-17 20:59:16 +02:00
Dmitry Stogov
0fbd2e6a16 Renumber ZEND_ACC_... flags 2018-09-11 17:21:17 +03:00
Gabriel Caruso
a303089ffe
Remove empty PHP tags from test 2018-09-08 16:28:48 -03:00
Gabriel Caruso
84b195d9fc Fix some misspellings 2018-08-12 16:15:45 +02:00
Peter Kokot
cf3b852109 Trim trailing whitespaces in build files
Some editors utilizing .editorconfig automatically trim whitespaces. For
convenience this patch removes whitespaces in certain build files:
- ext/*/config*.m4
- configure.ac
- acinclude.m4
2018-07-29 03:43:45 +02:00
Peter Kokot
a5e80b22e1 Fix typos in code comments 2018-07-25 11:57:11 +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
d775fe33d1 Better name: ZEND_PROPERTY_HAS => ZEND_PROPERTY_NOT_EMPTY 2018-07-24 09:31:57 +03:00
Xinchen Hui
1638a6e118 Give a meaningful name 2018-07-24 12:51:36 +08:00
Dmitry Stogov
7d4e18b05d Improved user iterator implementation to reduce zend_class_entry memory consumption and avoid race condition during resolving/caching of user iterator functions of internal classes in ZTS build. 2018-07-12 14:04:14 +03:00
Anatol Belski
cce87471b1 Skip test on incompatible servers 2018-07-09 16:39:58 +02:00
Nikita Popov
606de9e4a9 Fix inverted stristr() argument order in mysqli test 2018-07-05 21:25:21 +02:00
Dmitry Stogov
273e194df5 Replace zval_dtor() with specialized destructors 2018-07-05 13:55:56 +03:00
Dmitry Stogov
4a475a4976 Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places.
Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
2018-07-04 19:22:24 +03:00
Peter Kokot
be49d61b19 Remove old SVN keywords substitutions
When the PHP source code was versioned in Subversion, there was
possible to substitute certain keywords such as $Id$ with revision
number, last change time and author name. Such approach is not used
in Git so this patch removes these outdated artifacts from source
code files.
2018-06-16 13:04:30 +02:00
Victor Csiky
71c04324b7 Fixe bug #76386
..that is also a duplicate of #67122
2018-06-15 07:23:31 +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
Dmitry Stogov
eafa92ba9d zend_fcall_info_cache.calling_scope is not used by zend_call_function() and doesn't have to be initialized.
It's used only as a result of zend_is_callable() in forward_static_call and spl_autoload.
2018-05-03 19:27:04 +03:00
Nikita Popov
ad87e2bd6a Merge branch 'PHP-7.2' 2018-03-23 18:57:58 +01:00
atvoicu
17ed2f21cf Add missing skip prefix for some SKIPIF messages 2018-03-23 18:56:36 +01:00
Dmitry Stogov
1af60a2a71 Keep initialized object_handlers structures in read-only memory. 2018-03-14 14:01:45 +03:00
Gabriel Caruso
5f54f48024 [ci skip] Remove space between function name and open parentheses 2018-02-24 11:50:39 +01:00
Gabriel Caruso
1314f0fb3a Use int instead of long in protos 2018-02-23 11:06:20 +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
Gabriel Caruso
5f6b2c12a2 Remove explicit params count check
Relying on ZPP instead. Also, use ZEND_NUM_ARGS() instead of hardcode
number of parameters
2018-02-19 13:56:30 +01:00
Gabriel Caruso
4f43d312ad
Remove redelcaration of zend_parse_parameters_none 2018-02-18 09:38:47 +01:00
Sergei Morozov
1c393e9502 [Bug 75448] In case of failure, mysqli::prepare() returns NULL instead of FALSE 2018-02-10 10:40:47 -05: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
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
84488d921b Remove superfluous SKIPIF sections in more tests 2018-02-04 16:57:08 +01:00
Nikita Popov
c58b307833 Remove checks for unicode.semantics ini option 2018-02-03 19:50:20 +01:00
Nikita Popov
60c29a7f2b Simplify E_STRICT handling in mysqli tests
E_STRICT is always defined, so we don't need to handle it
conditionally. Instead just let the message be printed and check
the output.
2018-02-03 19:11:55 +01:00
Dmitry Stogov
ffa16693a7 A cheaper way to clone reference value. 2018-01-17 10:59:50 +03: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
d9f5ea691f zend_fcall_info_cache.initialized is removed (zend_fcall_info_cache is initialized if zend_fcall_info_cache.function_handler is set). 2017-12-27 15:15:03 +03:00
Dmitry Stogov
b864e6b58c Move constants into read-only data segment 2017-12-15 01:55:00 +03:00
Dmitry Stogov
1db8402208 Move zend_object_iterator_funcs structures into read-only data segment 2017-12-14 14:21:22 +03:00
Dmitry Stogov
6a9d2b2190 Cleanup type conversion 2017-12-07 19:24:55 +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
Dmitry Stogov
6bcace1b72 Use single memory pool for result metadata and result set. 2017-11-15 14:07:09 +03:00
Dmitry Stogov
69462bdf4c Embeded zend_list into st_mysqlnd_error_info, to avoid extra allocation/deallocation. 2017-11-15 00:53:51 +03:00
Dmitry Stogov
e2589b7d02 Use interned strings for "magic" property of internal classes. (not copyied into SHM) 2017-11-01 19:04:54 +03:00
Dmitry Stogov
67d5f39a47 Persistent resources are "thread-local".
Register persistent resources through new functions zend_register_persistent_resource()/zend_register_persistent_resource_ex().
2017-11-01 15:19:31 +03:00
Dmitry Stogov
0a8d834a7f Fixed test 2017-10-30 18:37:03 +03:00
Nikita Popov
8d54f98e33 Merge branch 'PHP-7.2' 2017-10-28 12:58:43 +02:00
Nikita Popov
58f90ab569 Merge branch 'PHP-7.1' into PHP-7.2 2017-10-28 12:58:23 +02:00
Nikita Popov
27856f64c3 Merge branch 'PHP-7.0' into PHP-7.1 2017-10-28 12:57:46 +02:00
Fabien Villepinte
938f256ed9 Fix bug #75434 Wrong reflection for mysqli_fetch_all function 2017-10-28 12:57:25 +02:00
Dmitry Stogov
9cf87aa196 Avoid HashTable allocations for empty arrays (using zend_empty_array). 2017-10-24 17:27:31 +03:00
Peter Kokot
e06a2c150a Remove done and old TODO file from ext/mysqli
Since PHP documentation and ini settings should be updated for the
mysqli extension, this patch removes an old and done TODO file from
ext/mysqli folder.
2017-09-30 03:23:28 +02:00
Dmitry Stogov
44e0b79ac6 Refactored array creation API. array_init() and array_init_size() are converted into macros calling zend_new_array(). They are not functions anymore and don't return any values. 2017-09-20 02:25:56 +03:00
Anatol Belski
756aaaf806 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #75018, fixed bug #75177
2017-09-13 14:12:53 +02:00
Anatol Belski
b134793b32 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75018, fixed bug #75177
2017-09-13 14:12:31 +02:00
Anatol Belski
3d93856c4a Fixed bug #75018, fixed bug #75177
Both are caused by the same cast issue in mysqlnd on 32-bit.
2017-09-13 14:10:30 +02:00
Kalle Sommer Nielsen
c34ba92782 Get rid of all these old package[2].xml files, most of these had no had a release since PHP4, or any release at all in close to 10 years, some even did not have a package registered at pecl
OCI, PDO_OCI and zip are left as they are actively developed and released there
2017-08-17 22:09:29 +02:00
Joe Watkins
2b5886a885
Merge branch 'PHP-7.2'
* PHP-7.2:
  minor loop optimizations, closes #2633
2017-07-25 06:54:29 +01:00
Joe Watkins
8d5a5fbf6b
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  minor loop optimizations, closes #2633
2017-07-25 06:54:20 +01:00
Joe Watkins
78ad5e8864
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  minor loop optimizations, closes #2633
2017-07-25 06:51:44 +01:00
Joe Watkins
69b48f83df
minor loop optimizations, closes #2633 2017-07-25 06:47:58 +01:00
Anatol Belski
e960ba6400 Merge branch 'PHP-7.2'
* PHP-7.2:
  fix skipif
2017-07-23 11:08:49 +02:00
Anatol Belski
47334646db fix skipif 2017-07-23 11:08:11 +02:00
Anatol Belski
1513bc32d5 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #74968 PHP crashes when calling mysqli_result::fetch_object with an abstract class
2017-07-22 10:37:11 +02:00
Anatol Belski
14e8f9557b Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #74968 PHP crashes when calling mysqli_result::fetch_object with an abstract class
2017-07-22 10:36:58 +02:00
Anatol Belski
4cb1151fff Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74968 PHP crashes when calling mysqli_result::fetch_object with an abstract class
2017-07-22 10:36:31 +02:00
Anatol Belski
e405ff59f9 Fixed bug #74968 PHP crashes when calling mysqli_result::fetch_object with an abstract class 2017-07-22 10:35:26 +02:00
Nikita Popov
8c1dc840b5 Remove version checks for MySQL < 5.0 2017-07-19 19:34:14 +02:00
Anatol Belski
bfa3df0048 Merge branch 'PHP-7.1'
* PHP-7.1:
  increase poll timeout as false positives mitigation
2017-07-12 14:50:36 +02:00
Anatol Belski
8b04e89ef0 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  increase poll timeout as false positives mitigation
2017-07-12 14:49:58 +02:00
Anatol Belski
04cc2f6473 increase poll timeout as false positives mitigation 2017-07-12 14:38:12 +02:00
Tom Van Looy
04fb3f28ff Remove superfluous semicolons 2017-06-26 00:23:25 +02:00
Mitch Hagstrand
7cb18b2a46 BUG #74737: Incorrect ReflectionFunction information for mysqli_get_client_info 2017-06-19 22:14:26 -04:00
Xinchen Hui
dd0795ac33 Merge branch 'PHP-7.1'
* PHP-7.1:
  Update news
  Fixed #74595 - ReflectionMethod::getParameters returns incorrect number of parameters
2017-05-20 00:03:17 +08:00
andrewnester
2e5a747b59 Fixed #74595 - ReflectionMethod::getParameters returns incorrect number of parameters 2017-05-15 17:07:00 +03:00
Anatol Belski
703209f146 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #74547 mysqli::change_user() doesn't accept null as $database argument w/strict_types
2017-05-06 15:11:06 +02:00
Anatol Belski
378f785515 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74547 mysqli::change_user() doesn't accept null as $database argument w/strict_types
2017-05-06 15:10:16 +02:00
Anatol Belski
561f1afe6e Fixed bug #74547 mysqli::change_user() doesn't accept null as $database argument w/strict_types 2017-05-06 15:06:34 +02:00
Anatol Belski
c0e9c21e98 Merge branch 'PHP-7.1'
* PHP-7.1:
  Tests to ensure BC with undocumented behavior used in hacks
2017-05-01 18:07:05 +02:00
Anatol Belski
023cbdb2ca Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Tests to ensure BC with undocumented behavior used in hacks
2017-05-01 18:06:09 +02:00
Anatol Belski
a581e64199 Tests to ensure BC with undocumented behavior used in hacks
Should become obsolete, once behaviors change.
2017-05-01 18:01:05 +02:00
Pedro Magalhães
5324fb1f34 Fixed bug #61970: Allow a child class to restrict access to ctor 2017-05-01 14:15:57 +02:00
Nikita Popov
6df10e1932 Fix reflection tests in mysqli extension 2017-04-22 23:57:00 +02:00
Nikita Popov
fb22a0f48d Merge branch 'PHP-7.1' 2017-02-12 12:51:12 +01:00
Nikita Popov
98fceaf61e Merge branch 'PHP-7.0' into PHP-7.1 2017-02-12 12:50:14 +01:00
andrewnester
01c1afa79f Fixed bug #74021 2017-02-12 12:48:18 +01:00
Nikita Popov
06a0340162 Deprecate each() 2017-02-03 21:02:52 +01:00
Joe Watkins
5bc81620ef
Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix bug #73949 leak in mysqli_fetch_object
2017-01-18 18:24:49 +00:00
Joe Watkins
6d89640d55
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #73949 leak in mysqli_fetch_object
2017-01-18 18:23:59 +00:00
Joe Watkins
f9226f9bf3
Fix bug #73949 leak in mysqli_fetch_object 2017-01-18 18:22:57 +00:00
Nikita Popov
e8c98a74f0 Merge branch 'PHP-7.1' 2017-01-12 21:16:13 +01:00
Nikita Popov
da5e09ad03 Merge branch 'PHP-7.0' into PHP-7.1 2017-01-12 21:15:57 +01:00
rfussenegger
bd75f9e613 Fix bug #69899 2017-01-12 21:13:39 +01:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
1e3624290a Resolve conflict 2017-01-03 08:01:05 -06:00
Nikita Popov
08b68b9781 Merge branch 'PHP-7.1' 2017-01-03 12:19:08 +01:00
Nikita Popov
661fad7beb Merge branch 'PHP-7.0' into PHP-7.1 2017-01-03 12:18:33 +01:00
Vince
cfd6e14842 Fix Bug #73462 - Persistent connections don't set $connect_errno
Persistent connections skipped resetting $connect_error and $connect_errno values
This adds the "clear error" line to persistent connections for consistency
2017-01-03 12:13:08 +01:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Anatol Belski
afb6ca2566 Finish remaining replacement uint => uint32_t
Tthe core should be normalized now, no uints anymore
2016-12-22 14:32:02 +01:00
Andrey Hristov
0745cc8a98 Merge branch 'PHP-7.1' 2016-12-12 21:53:05 +02:00
Andrey Hristov
3836c2faac Merge branch 'PHP-7.0' into PHP-7.1 2016-12-12 21:52:59 +02:00
Andrey Hristov
13fc1b92ca Add a bit more test cases (edge cases) to the BIT test case 2016-12-12 21:52:36 +02:00
Andrey Hristov
ddb2febe90 Merge branch 'PHP-7.1' 2016-12-12 21:29:12 +02:00
Andrey Hristov
d494e19701 Merge branch 'PHP-7.0' into PHP-7.1 2016-12-12 21:29:06 +02:00
Andrey Hristov
a881ea7d86 Add a test case to test fetching of multiple rows with bit values. 2016-12-12 21:28:33 +02:00
Anatol Belski
ffb1773bcb Merge branch 'PHP-7.1'
* PHP-7.1:
  fix test compat with MySQL 5.7
2016-12-07 16:05:43 +01:00
Anatol Belski
5b3e36fe78 fix test compat with MySQL 5.7 2016-12-07 16:04:47 +01:00
Anatol Belski
35cfec1f9f Merge branch 'PHP-7.1'
* PHP-7.1:
  fix test
2016-12-04 22:46:23 +01:00
Anatol Belski
8ad9043aa3 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix test
2016-12-04 22:45:31 +01:00
Anatol Belski
eddca73ad2 fix test
This test depends on connection flags modifable from teh env,
that can affect the exact function called.
2016-12-04 22:42:39 +01:00
Anatol Belski
4fe117589c Merge branch 'PHP-7.1'
* PHP-7.1:
  fix test
2016-12-04 22:29:33 +01:00
Anatol Belski
b6f5fcfc3a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix test
2016-12-04 22:28:34 +01:00
Anatol Belski
1eb3f01c68 fix test
On Windows, either doubled backslashes or forward slashes are supported
on the server side.
2016-12-04 22:27:17 +01:00
Anatol Belski
b204b3abd1 further normalizations, uint vs uint32_t
fix merge mistake

yet one more replacement run
2016-11-26 17:29:01 +01:00
Nikita Popov
5af586bec5 Remove more PHP 6 leftovers from tests 2016-11-24 22:39:39 +01:00
Tom Van Looy
972b9e989f Fix two tests 2016-11-22 18:47:34 +01:00
Nikita Popov
45f7b2bcc8 Fix CRLF line-endings in tests
Also fix a single instance of CRLF in ibase_query.c.
2016-11-20 22:31:24 +01:00
Pedro Magalhães
617dcf1b37 Remove the binary cast from unrelated tests 2016-11-20 21:11:53 +01:00
Pedro Magalhães
9c5af4e4cb Remove the b prefix from literals on unrelated tests 2016-11-20 21:11:53 +01:00
Tom Van Looy
442fd2f92a Cleanup tests version checks 2016-11-20 14:16:50 +01:00
Matteo Beccati
c3c06b92f9 Fixed test to accept MYSQLI_OPT_READ_TIMEOUT
The new constant has been added in 7108db30
2016-10-20 12:54:42 +02:00
Andrey Hristov
7108db3022 Merge branch 'PHP-7.0' into PHP-7.1 2016-10-17 19:11:54 +03:00
Andrey Hristov
66d4a2e13f Merge branch 'PHP-5.6' into PHP-7.0 2016-10-17 19:01:12 +03:00
Andrey Hristov
9594e364ed This is a very very old thing dated back to year 2009.
MYSQL_OPT_READ_TIMEOUT was never a macro in mysqlnd but an enum value.
So this never actually worked correctly. mysqlnd provides these so it is
safe to have them when mysqlnd used.
2016-10-17 18:58:14 +03:00
Nikita Popov
9e2df3b6b2 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-17 22:56:36 +02:00
Nikita Popov
01759c4346 Add test for bug #72489 2016-09-17 22:54:25 +02:00
Anatol Belski
9b9aeb66bd add test for bug #72701 2016-07-29 17:23:39 +02:00
Andrey Hristov
b27ff62ee0 Fix for bug #71863 Segfault when EXPLAIN with "Unknown column" error
The reason was that after the big refactoring of mysqlnd at the end of
last year code that is initializing the error_info structure in the
result set was not added. It existed already for connections and PS.
The code that segfaults is hit only with MariaDB because MariaDB sends
full metadata about the EXPLAIN query + EOF packet and only then it sends
an error packet. MySQL doesn't do that but sends directly an error which
is caught (by different code path). As errors during execution (which means
after sending meta) are pretty rare there was no test case of MySQL to
catch it.
2016-07-25 21:59:27 +02:00
Aaron Piotrowski
24237027bc Merge branch 'throw-error-in-extensions' 2016-07-05 02:08:39 -05:00
Dmitry Stogov
0cfb47651c Fixed compilation warnings 2016-06-28 11:37:51 +03:00
Dmitry Stogov
323b2733f6 Fixed compilation warnings 2016-06-22 00:40:50 +03:00
Dmitry Stogov
1616038698 Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
2016-06-21 16:00:37 +03:00
Dmitry Stogov
ff363e2e7c Implemented RFC: Replace "Missing argument" warning with "Too few arguments" exception
Squashed commit of the following:

commit 8b45fa2acb
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jun 16 01:52:50 2016 +0300

    Separate slow path of ZEND_RECV into a cold function.

commit 9e18895ee5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 23:26:28 2016 +0300

    Required argument can't be IS_UNDEF anymore.

commit 662db66e39
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 31 17:14:50 2016 +0300

    Replace "Missing argument" warning by "Too few arguments" exception.
2016-06-16 02:32:02 +03:00
Aaron Piotrowski
771e5cc247 Replace zend_ce_error with NULL and replace more E_ERROR with thrown Error 2016-06-13 09:02:17 -05:00
Aaron Piotrowski
e3c681aa5c Merge branch 'master' into throw-error-in-extensions 2016-06-10 22:02:23 -05:00
Anatol Belski
148fa6bb44 Merge branch 'PHP-7.0'
* PHP-7.0:
  Revert "Fixed bug #71820 pg_fetch_object bind parameters before call constructor"
  Revert "Backport patch for bug #71820"
2016-05-09 17:29:56 +02:00
Anatol Belski
fc2a45b70a Revert "Fixed bug #71820 pg_fetch_object bind parameters before call constructor"
This reverts commit b4eedd128b.

This fixed bug #72151, and reverts the fix for bug #71820.
See also bug #50636 and #49521 for the history.
2016-05-09 17:25:53 +02:00
Anatol Belski
1cc536af5a Revert "Backport patch for bug #71820"
This reverts commit 1b632cfe83.

This fixed bug #72151, and reverts the fix for bug #71820.
See also bug #50636 and #49521 for the history.
2016-05-09 17:15:40 +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