Commit Graph

2117 Commits

Author SHA1 Message Date
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
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
Joe Watkins
f37e95a443
Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #76131 some arginfo params are different from the documentation
2018-03-27 22:00:31 +02:00
Joe Watkins
3e267ca91b
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76131 some arginfo params are different from the documentation
2018-03-27 21:58:24 +02:00
Gabriel Caruso
63934ea71e
Fix #76131 some arginfo params are different from the documentation 2018-03-27 21:56:46 +02:00
Dmitry Stogov
d7f2dc4ec6 Improve HashTable iterators handling:
- Avoid iterators check/update on each HashTable update opration
- Keep position equal (or above) nNumUsed instead of HT_INVALID_IDX
- Fixed iterators handling in array_unshift()
2018-03-22 02:41:49 +03: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
Christoph M. Becker
ef255c9f0f Revert "[ci skip] Add missing return types to protos"
This reverts commit a2c7c46d5e.

Since apparently there have been some mistakes in this commit, and it's
not clear yet how to solve them, we're reverting for now.
2018-02-27 17:40:03 +01:00
Gabriel Caruso
a2c7c46d5e [ci skip] Add missing return types to protos 2018-02-24 11:45:17 +01: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
Gabriel Caruso
21e3b0c70c Remove trailing whitespace in inc files 2018-02-10 19:20:23 +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
01eafceea1
Fixed bug #74519 strange behavior of AppendIterator 2018-02-08 10:16:24 +01:00
CHU Zhaowei
495508eceb
fix #74519 strange behavior of AppendIterator 2018-02-08 10:15:09 +01:00
Gabriel Caruso
2d48d734a2 Fix some misspellings 2018-02-06 16:59:00 +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
affc20f891 Use bool instead of boolean in proto 2018-02-04 17:00:24 +01:00
Gabriel Caruso
84488d921b Remove superfluous SKIPIF sections in more tests 2018-02-04 16:57:08 +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
Christoph M. Becker
96595a232a Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Revert "Fix #75878: RecursiveTreeIterator::setPostfix has wrong signature"
2018-01-27 13:13:06 +01:00
Christoph M. Becker
a882f95e39 Revert "Fix #75878: RecursiveTreeIterator::setPostfix has wrong signature"
This reverts commit 4bd7658e1b.

To avoid the BC break we apply the fix to master only.
2018-01-27 13:11:30 +01:00
Christoph M. Becker
ce7ef7c282 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #75878: RecursiveTreeIterator::setPostfix has wrong signature
2018-01-27 12:46:10 +01:00
Christoph M. Becker
d7a02844f9 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #75878: RecursiveTreeIterator::setPostfix has wrong signature
2018-01-27 12:41:15 +01:00
Christoph M. Becker
4bd7658e1b Fix #75878: RecursiveTreeIterator::setPostfix has wrong signature 2018-01-27 12:33:36 +01:00
Dmitry Stogov
6634d5e313 Use HT_FLAGS() macro 2018-01-22 14:58:16 +03:00
Dmitry Stogov
5f349f3ab8 Avoid useless duplication 2018-01-19 13:14:15 +03: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
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
Nikita Popov
2667ddc46d Remove unnecessary readobj==writeobj checks
This can no longer be the case since PHP 7. The writeobj must
always point to a different zval.
2017-12-25 21:19:45 +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
Dmitry Stogov
b864e6b58c Move constants into read-only data segment 2017-12-15 01:55:00 +03:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Dmitry Stogov
1db8402208 Move zend_object_iterator_funcs structures into read-only data segment 2017-12-14 14:21:22 +03:00
Peter Kokot
2783b1c823 Remove outdated TODO files
Some extensions included TODO files that has been present for several
years in the repository tree without changes. This included:

- ext/phar
- ext/intl
- ext/zip
- ext/soap
- ext/pdo
- ext/spl
- ext/dom
- ext/gmp
- ext/xmlwriter
- ext/xmlreader

ext/phar feature request has been created instead, and for others it
would be better to use wiki and RFC workflow instead based on current
feature requests and further PHP development requirements.

[ci skip]
2017-12-09 19:18:58 +01:00
Nikita Popov
9cdd547eca Fixed bug #74372 2017-12-06 23:36:09 +01:00
Dmitry Stogov
084c17fe0b Use zend_string_tolower() where it's possible (to avoid reallocations).
Allow zend_string_tolower_ex() to create parsistent strings
2017-11-30 01:13:39 +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
20d930d8f3 Fix remaining signedness warnings 2017-11-14 17:07:09 +01:00
Anatol Belski
a5bc5aed71 Patch core for PCRE2 support
RFC https://wiki.php.net/rfc/pcre2-migration
2017-11-13 19:37:38 +01:00
Xinchen Hui
d56a534acc RC manipulation cleanup 2 2017-11-02 12:13:35 +08:00
Xinchen Hui
a8a17a72b0 RC manipulation cleanup 2017-11-01 10:25:10 +08:00
Dmitry Stogov
49ea143bbd Encapsulate reference-counting primitives.
Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead.
Added mactros to validate reference-counting (disabled for now).
These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
2017-10-27 01:28:58 +03:00
Dmitry Stogov
9cf87aa196 Avoid HashTable allocations for empty arrays (using zend_empty_array). 2017-10-24 17:27:31 +03:00
Dmitry Stogov
cb9d81ef4f Refactored recursion pretection 2017-10-06 01:34:50 +03:00
Xinchen Hui
ac3c586ca7 Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWS
  Update NEWS
  Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()).
  Compiler warning
2017-09-24 17:25:26 +08:00
Xinchen Hui
bad5639386 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update NEWS
  Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()).
  Compiler warning
2017-09-24 17:24:57 +08:00
Xinchen Hui
e8c200515a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()).
  Compiler warning
2017-09-24 17:24:23 +08:00
Xinchen Hui
db63367871 Compiler warning 2017-09-24 17:19:05 +08:00
Christoph M. Becker
0ef396f24e Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)
2017-09-20 15:54:46 +02: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
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
Joe Watkins
cb62dbe97d
Merge branch 'PHP-7.2'
* PHP-7.2:
  fix bug #75173 incorrect behavior of AppendIterator::append in foreach loop
2017-09-12 07:08:43 +01: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
Joe Watkins
7015d22116
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix bug #75173 incorrect behavior of AppendIterator::append in foreach loop
2017-09-12 07:06:35 +01:00
jhdxr
3e11b7fc21
fix bug #75173 incorrect behavior of AppendIterator::append in foreach loop 2017-09-12 07:05:58 +01:00
Nikita Popov
80881194a1 Merge branch 'PHP-7.2' 2017-09-04 21:24:49 +02:00
Nikita Popov
b2824629c2 Merge branch 'PHP-7.1' into PHP-7.2 2017-09-04 21:24:32 +02:00
Nikita Popov
c2e3541cc1 Add test for bug #75155 2017-09-04 21:23:07 +02:00
Nikita Popov
b689857d53 Revert "Fixed #74977 - Appending AppendIterator leads to segfault"
This reverts commit dbc2ffba82.
2017-09-04 21:20:49 +02:00
Kalle Sommer Nielsen
d3bc8beb4f Removed support for BeOS, development for BeOS was supported 17 years ago.
This patch however does not drop support for the BeOS compatible variant, Haiku, see Github PR #2697 which is currently a WiP

I intentionally left out some fragments for BeOS in the build system for that seems to be bundles
2017-08-29 22:03:56 +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
Xinchen Hui
c8efaea1e3 Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWs
  Update NEWS
  Fixed bug #75049 (spl_autoload_unregister can't handle spl_autoload_functions results)
2017-08-09 11:30:13 +08:00
Xinchen Hui
e7dd9c781b Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update NEWS
  Fixed bug #75049 (spl_autoload_unregister can't handle spl_autoload_functions results)
2017-08-09 11:29:46 +08:00
Xinchen Hui
307acb6618 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #75049 (spl_autoload_unregister can't handle spl_autoload_functions results)
2017-08-09 11:29:13 +08:00
Xinchen Hui
b06f8cb58b Fixed bug #75049 (spl_autoload_unregister can't handle spl_autoload_functions results) 2017-08-09 11:28:53 +08:00
Xinchen Hui
5c9330bb87 Fixed compiler warning(enumeration value ‘SPL_FS_INFO’ not handled in switch) 2017-08-08 10:11:53 +08:00
Nikita Popov
7c5abb9209 Merge branch 'PHP-7.2' 2017-08-02 17:54:14 +02:00
Tyson Andre
5097e2ee13 Implement spl_object_id(object $x) : int
spl_object_id is a new function returning the object handle,
as a signed integer.

Discussion for this new function is ongoing on php-internals, see
https://marc.info/?t=143835274500003&r=1&w=2

The object id is unique for the lifetime of the object.
When the object is garbage collected,
different objects may & will have the same object id.

- This is also the case for the string generated by spl_object_hash

It is always possible to cast the object handle to a **signed** zend_long
in php 7.2. _zend_object->handle is always of the type `uint32_t`.
(zend_long is 32 bits on 32 bit builds, 64 bits on 64 bit builds)

As of php 7.0, the object id uniquely identifies the object,
there can't be two objects with the same id but different handlers
(See the implementation of spl_object_hash)

Skip the pointless XORing, as discussed in internals.

- It was intended to avoid exposing in-memory addresses.
- The object handle is not a memory address.
- The output of var_dump() includes the object handle(id)
2017-08-02 17:54:07 +02:00
Julien Pauli
d8aa438b67 Merge branch 'PHP-7.2'
* PHP-7.2:
  Updated NEWS
  Updated NEWS
  Updated NEWS
  Fix #75015. Crash in SPL destructors
2017-08-01 16:03:09 +02:00
Julien Pauli
4f06b62781 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Updated NEWS
  Updated NEWS
  Fix #75015. Crash in SPL destructors
2017-08-01 16:02:36 +02:00
Julien Pauli
cd06b5af09 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Updated NEWS
  Fix #75015. Crash in SPL destructors
2017-08-01 16:02:00 +02:00
Julien Pauli
64e6ddc7f7 Fix #75015. Crash in SPL destructors 2017-08-01 15:59:54 +02:00
Anatol Belski
49d9b3013f Move cwd_state and path related routines to size_t
Having `int` there is no real profit in the size or speed, while unsigned
improves security and overall integration. ZPP supplied strings can
be then accepted directly and structs can be still handled with smaller
unsigned types for size reasons, which is safe. Yet some related places
are to go.

basic move tsrm_realpath_r to size_t

fix conditions and sync with affected places

touch ocurrences of php_sys_readlink usage

follow up on phar path handling

remove duplicated check

move zend_resolve_path and related pieces to size_t

touch yet resolve path related places

remove cast

missing pieces

missing piece

yet cleanups for php_sys_readlink for ssize_t

fix wrong return
2017-07-27 20:11:21 +02:00
Joe Watkins
2e8759428b
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed #74977 - Appending AppendIterator leads to segfault
2017-07-25 06:40:25 +01:00
andrewnester
dbc2ffba82
Fixed #74977 - Appending AppendIterator leads to segfault 2017-07-25 06:39:50 +01:00
Nikita Popov
a624ded4d3 Merge branch 'PHP-7.1' into PHP-7.2 2017-07-18 22:16:33 +02:00
Nikita Popov
8e7c99acf4 Merge branch 'PHP-7.0' into PHP-7.1 2017-07-18 22:16:11 +02:00