Compare commits

..
3409 Commits
Author SHA1 Message Date
Derick Rethans 3c7824e16e Update versions for PHP 7.4.0 2019-11-26 20:13:31 +00:00
Derick Rethans 62f9ce6ca7 Update NEWS for PHP 7.4.0 2019-11-26 20:13:31 +00:00
Derick Rethans 07e854dc59 Consolidate NEWS for 7.4.0 release 2019-11-24 10:24:36 +01:00
Derick Rethans cebdca048a Zend Engine version is no longer in -dev 2019-11-15 14:27:03 +00:00
Derick Rethans 75e7c249a1 Update NEWS for 7.4.0 2019-11-10 23:34:40 +00:00
Derick Rethans b3ec91581f Update NEWS for PHP 7.4.0RC6 2019-11-10 23:33:21 +00:00
Fabien Villepinte ce41795a9f Fix conflicts in windows ACL tests
Closes GH-4898.
2019-11-09 13:55:42 +01:00
Fabien Villepinte 9c4b989c75 Make test runner runnable without arguments
The default PHP executable was not set when no args were provided.

Closes GH-4894.
2019-11-08 20:33:19 +01:00
Levi Morrison 05bce66037 Merge branch 'PHP-7.3' into PHP-7.4 2019-11-08 08:02:49 -07:00
Nikita Popov 6ddb381ae5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Wrap hrtime in `extern "c" {}`
2019-11-07 14:42:11 +01:00
Nikita Popov e19f0e86dc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix php_pcre_mutex_free()
2019-11-07 14:31:55 +01:00
Nikita Popov aba89f56ff Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Remove outdated comments in test
2019-11-07 14:06:48 +01:00
Nikita Popov dacadf5aa3 Disable ifunc resolvers under thread sanitizer as well 2019-11-07 13:08:03 +01:00
Nikita Popov d3d85cbcc1 Add UPGRADING note about default object from empty value
Fixes bug #75921.

[ci skip]
2019-11-07 11:48:02 +01:00
Nikita Popov aed4f6e849 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78759
2019-11-07 11:17:14 +01:00
max 0988f69634 Fix #78788: ./configure generates invalid php_version.h
Change $SED to "${SED}" such that the IFS is not used to split the
output of that variable.
2019-11-07 10:01:02 +01:00
Nikita Popov f494a36618 Remove bogus skipifs in get_browser tests
We provide this file, it should be readable.

These checks no longer work, since --INI-- values are no longer
passed to --SKIPIF--.
2019-11-06 17:48:52 +01:00
Nikita Popov a3e454aacc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78787
2019-11-06 12:53:21 +01:00
Christoph M. Becker 537c6a6992 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  7.3.13 is next
2019-11-05 18:25:10 +01:00
Sara Golemon 566f2b0f69 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Bump for 7.2.26-dev
2019-11-05 10:58:59 -05:00
Nikita Popov 3e41ade638 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78775
2019-11-05 12:16:09 +01:00
Christoph M. Becker 214f4cfadb Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Remove obsolete oniguruma.patch
2019-11-05 10:17:50 +01:00
Adam Saponara 6c9821a531 Remove dead code ext/mysqlnd/mysqlnd_net.c.
I believe this code has been dead since 05c5e05 (2015) now replaced
by `ext/mysqlnd/mysqlnd_vio.c`.

Closes GH-4888.
2019-11-04 21:36:13 +01:00
Fabien Villepinte 6545f656be Add a test for ReflectionClass:getInterfaceNames()
The method was not tested against a class without interface.
2019-11-04 13:51:40 +01:00
Christoph M. Becker 00c9c480eb Make test more robust
Time flies, so obviously the reported uptime may differ a bit (as
already occasionally noticed on CI); we cater to that by allowing a
delay of up to one second.
2019-11-04 12:22:04 +01:00
Nikita Popov 451314111b Revert "Remove configure checks for supported instruction sets"
This reverts commit edccf32f7f.

This was reported to cause issues for as yet unknown reasons in
bug #78769. As this was intended as code cleanup, revert this from
7.4 at least. May reapply it to master later.
2019-11-04 11:32:46 +01:00
Nikita Popov c9abfaec6b Fixed bug #78774
The string held by the zend_type may be released if the property
type gets resolved to a CE. I initially wanted to fix this by
storing a zend_type* instead (so the property type resolution
propagates to the ReflectionType), but decided against this in
light of upcoming union types support, where we also need to
represent parts of the union, and will not have a single zend_type*
we can reference.
2019-11-04 11:04:02 +01:00
Simonov Denis e84042cc72 Print Client Library Version in phpinfo 2019-11-02 10:19:15 +01:00
Nikita Popov 4c717abad2 Explicitly specify ubuntu versions on azure pipelines
Use the new 18.04 for the ones where the build succeeded and the
previous 16.04 where it didn't.
2019-11-02 10:12:58 +01:00
Nikita Popov 944c1cf034 Fixed bug #78768
Remove the typedef from zend_types.h, use explicit struct prefix
instead.
2019-11-01 17:04:15 +01:00
Fabien Villepinte a0d58abb79 Fix conflicts between tests with obscure filenames
For non-windows tests
2019-11-01 12:33:36 +01:00
Fabien Villepinte 5367f36da7 Fix conflicts between tests with obscure filenames 2019-11-01 12:24:38 +01:00
Christoph M. Becker db14b78099 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test cases for libxml2 2.9.10
2019-10-31 16:09:38 +01:00
Nikita Popov edccf32f7f Remove configure checks for supported instruction sets
These were checking whether the instruction set is supported by
the host CPU, however they were only used to condition on whether
this instruction set is targeted at all. It would still use dynamic
dispatch (e.g. based on ifunc resolvers) to select the actual
implementation. Whether the target is guaranteed to support the
instruction set without dispatch is determined based on pre-defined
macros like __SSE2__.

This removes the configure-time builtin cpu checks to remove
confusion. Additionally this allows targeting an architecture that
is newer than the host architecture.
2019-10-31 11:27:53 +01:00
Nikita Popov 333d607d47 Fix bug #77930: Remove mmap limit
First, the limitation already doesn't trigger if you copy the whole
file (i.e. use copy() or stream_copy_to_stream() and don't specify
a length). This happens because length will be 0 at the time of the
check and only later calculated based on the file size. This means
that we're already completely blowing the length limit for what is
likely the most common case, and it doesn't seem like anyone complained
about that.

Second, the premise of the code comment ("to avoid runaway swapping")
seems incorrect to me. Because this performs a file-backed non-private
mmap, no swap backing is needed for the mapping. Concerns over "memory
usage" are also misplaced, as this is a virtual mapping.
2019-10-31 09:37:05 +01:00
Christoph M. Becker 0055f1e3dc Fix #78761: Zend memory heap corruption with preload and casting
We have to reset `FFI_G(persistent)` back to zero when preloading has
finished.
2019-10-30 19:49:39 +01:00
Christoph M. Becker 1e2d3d58a8 Fix #78762: Failing FFI::cast() may leak memory
We have to release objects when we're done with them.
2019-10-30 17:21:58 +01:00
Nikita Popov c76dbefe05 Add UPGRADING note for stream_read() change
Ref bug #78575.

[ci skip]
2019-10-30 11:31:43 +01:00
Tyson Andre 447f07cd28 Optimize creation of empty arrays in json_decode
Use the shared empty array from ZVAL_EMPTY_ARRAY

For code that created an 10 arrays of 100000 empty arrays
(has the same result with `$assoc=true` and `{}`)

- This is the worst-case comparison, but I'd expect 0-length arrays to be fairly
  common in regular data for json_decode
- The parser implementation was using function pointers so that third party
  extension developers could reuse the json parser for their own
  data structures, etc. (I think).

  This PR is meant to let those third party extensions continue working
  without changes.

Before this patch: In 0.126 seconds: added 97.99 MiB
After this patch:  In 0.096 seconds: added 41.99 MiB

```php
<?php
$json = '[' . str_repeat('[],', 100000) . "null]";
$start_memory = memory_get_usage();
$start_time = microtime(true);
$result = [];
for ($i = 0; $i < 10; $i++) {
    $result[] = json_decode($json);
}
$end_memory = memory_get_usage();
$end_time = microtime(true);
// Before this patch: In 0.126 seconds: added 97.99 MiB
// After this patch:  In 0.096 seconds: added 41.99 MiB
printf("In %.3f seconds: added %.2f MiB\n", $end_time - $start_time, ($end_memory - $start_memory)/1000000);

// For objects
$json = '[' . str_repeat('{},', 100000) . "null]";
$start_memory = memory_get_usage();
$start_time = microtime(true);
for ($i = 0; $i < 10; $i++) {
    $result[] = json_decode($json, true);
}
$end_memory = memory_get_usage();
$end_time = microtime(true);
// Before this patch: In 0.126 seconds: added 97.99 MiB
// After this patch:  In 0.096 seconds: added 41.99 MiB
printf("In %.3f seconds: added %.2f MiB (objects decoded as arrays) \n", $end_time - $start_time, ($end_memory - $start_memory)/1000000);
```

Closes GH-4861.
2019-10-30 11:06:46 +01:00
Nikita Popov 7816275244 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add missing refcount increment
2019-10-30 09:23:06 +01:00
Nikita Popov 4f1d5380e2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78689
2019-10-29 15:07:28 +01:00
Christoph M. Becker 22523958f4 Skip test case on non Windows platforms 2019-10-29 10:05:31 +01:00
Derick Rethans 365a45210b Update NEWS for 7.4.0RC6 2019-10-29 08:50:32 +00:00
Derick Rethans 6d8168f1d1 Update NEWS for PHP 7.4.0RC5 2019-10-29 08:49:13 +00:00
Christoph M. Becker bedbecf56d Implement #78270: Support __vectorcall convention with FFI
To work around the limitation of the current rudimentary vectorcall
support in our patched libffi, we forbid yet unsupported declarations,
i.e. float/double parameters at certain positions (SIMD vector types
and HVA types are not supported anyway).
2019-10-29 08:57:43 +01:00
Stanislav Malyshev 53b1d76144 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix libmagic buffer overflow issue (CVE-2019-18218)
  bump version
  set versions for release
2019-10-28 20:47:50 -07:00
Simonov Denis 3fb42a382c Add support for Interbase 1 dialect 2019-10-28 16:40:51 +01:00
Christoph M. Becker 9e4c5db733 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78751: Serialising DatePeriod converts DateTimeImmutable
2019-10-28 13:09:24 +01:00
ZiMuyang 99c84cd92a Remove redundant variable rv and optimize code
Closes GH-4864.
2019-10-28 11:42:45 +01:00
Nikita Popov 1ddda13d84 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78752
2019-10-28 10:28:14 +01:00
Nikita Popov 43dc7da8e3 Try one more FD in ext/standard/tests/file/php_fd_wrapper_04.phpt
For some reason FD 120 seems to exist on macos quite often, while
FD 12 did not... Let's try an even larger number, otherwise we
should just drop this test.
2019-10-27 09:35:57 +01:00
Fabien Villepinte 601aef3468 Replace EXPECTF by EXPECT
In ext/dom all the tests with a EXPECTF section
starting by "Fatal error: Uncaught" have been updated
to use the faster EXPECT
2019-10-26 16:05:02 +02:00
Nikita Popov bd379df48c Add ARM64 CI to Travis
We need to install a number of additional packages that are installed
by default on the AMD64 workers.

We also have to manually set up the MySQL user.

For now we don't set up Postgres -- if anyone wants to figure that
out, it would be great ;)

Log redirections in compile.sh are removed, because /dev/stdout is
not accessible. We don't see to use this anyway.
2019-10-25 16:37:46 +02:00
Nikita Popov f1848a4b3f Fix bug #78226: Don't call __set() on uninitialized typed properties
Assigning to an uninitialized typed property will no longer trigger
a call to __set(). However, calls to __set() are still triggered if
the property is explicitly unset().

This gives us both the behavior people generally expect, and still
allows ORMs to do lazy initialization by unsetting properties.

For PHP 8, we should fine a way to forbid unsetting of declared
properties entirely, and provide a different way to achieve lazy
initialization.
2019-10-25 16:31:45 +02:00
Nikita Popov 4d8541debb Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78747
2019-10-25 12:50:26 +02:00
Nikita Popov 6aece7be0a Optimize VERIFY_RETURN_TYPE for TMP operands as well
Only exclude CONST operands, which use a different instruction
format (they have a return operand).
2019-10-25 11:37:19 +02:00
Nikita Popov f07565b0eb Check class linking in VERIFY_RETURN_TYPE optimization
instanceof_function() requires linked classes. I'm not reusing
unlinked_instanceof() here, because it performs class loading,
which wouldn't be right here, I think.
2019-10-25 11:24:32 +02:00
Nikita Popov a8b4e40fa2 Simplify travis setup scripts
Reduce duplication.
2019-10-25 11:15:27 +02:00
Nikita Popov 184ba0c91c Remove recursive check from instanceof_interface
Parent interfaces are copied into the interface list during
inheritance, so there's no need to perform a recursive check.

Only exception are instanceof checks performed during inheritance
itself. However, we already have unlinked_instanceof for this
purpose, it just needs to be taught to handle this case.

Closes GH-4857.
2019-10-25 10:19:42 +02:00
Nikita Popov c63a0e005a Optimize instanceof_class/interface
instanceof_class does not need to check for a NULL pointer in the
first iteration -- passing NULL to this function is illegal.

instanceof_interface does not need to use instanceof_class(), it
only has to check whether the CEs match exactly. There is no way
for an interface to appear inside "parent", it will always be in
"interfaces" only.
2019-10-24 17:47:35 +02:00
Nikita Popov 435f269108 Clean up and clarify instanceof_function_ex()
The instanceof_interface_only() function was dead code (always
returned zero).

Clarify that the last parameter indicates whether the passed CE
is interface or class and rewrite the code in terms of assertions.
2019-10-24 17:40:25 +02:00
Nikita Popov 93a9b56c90 Skip IntlTimeZone::getOffset() error tests on non-x86
I'm not totally sure, but I have a strong suspicion that the fact
that this produces an error is an artifact of undefined cast behavior
(which will yield INDVAL on x86 but saturate on ARM). INF seems to
be the only value that results in an error even on x86 (variations
like -INF or NAN succeed).

It might make sense to just remove this test entirely, but for now
let's skip it on non-x86.
2019-10-24 15:26:11 +02:00
Nikita Popov edf7346810 Skip large ftruncate test if large files not supported 2019-10-24 14:46:49 +02:00
Nikita Popov 6aa6d70e9d Don't test "blocks" in lstat_stat_variation7.phpt
This stat property seems to be somewhat unreliable depending on the
filesystem. On Travis ARM64 CI a much larger payload is required
to get this value to increase.
2019-10-24 14:46:41 +02:00
Nikita Popov 8fd30aae16 Increase FD used in php://fd test 2019-10-24 14:46:34 +02:00
Nikita Popov a3469146d4 Use posix_getuid() to check for root in pcntl_setpriority() test
Using SUDO_USER doesn't seem to work on Travis ARM CI -- I guess
that sudo might be in use without the target being root.
2019-10-24 14:46:25 +02:00
Remi Collet 69b608cf13 typo and better wording 2019-10-24 07:43:49 +02:00
Dmitry Stogov fea8c5481b Added suppot for glob() wildcard matching in ffi.preload directive 2019-10-24 07:40:07 +02:00
Rasmus Lerdorf af57b6330b Reverting push to wrong repo 2019-10-23 14:34:12 -07:00
Rasmus Lerdorf 5870efbcf5 Update alloc patch 2019-10-23 14:31:27 -07:00
Dmitry Stogov c744531fff Ignore ZEND_FFI_TYPE_OWNED flag 2019-10-23 19:50:58 +03:00
Nikita Popov 5f13eff4a2 Fix aarch64 crc32 implementation
RETVAL vs RETURN mixup resulted in the fallback implementation
running as well.
2019-10-23 17:41:59 +02:00
Nikita Popov f841388781 Don't autoload when checking property types
Noticed while working on union types: We do not load argument and
return types during type checks, but we do load property types.

I'm normalizing the behavior towards the existing status quo (not
loading), though we may consider loading everywhere (all types,
and instanceof) in order to properly support class aliases.
2019-10-23 12:21:30 +02:00
Nikita Popov 3157173b28 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Use ICU's CXXFLAGS when using pkg-config
2019-10-23 11:18:01 +02:00
Nikita Popov 8b7ca91c6e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add "-pthread" to EXTRA_LDFLAGS_PROGRAM as well
2019-10-23 11:07:41 +02:00
Florian Engelhardt 1eae77221e Added missing call to ZipArchive::close() 2019-10-23 10:44:26 +02:00
Remi Collet dcd772325d add new ffi.preload option in php.ini and display ini entries in MINFO 2019-10-23 07:49:13 +02:00
Christoph M. Becker 598bf7f5d5 Fix typo 2019-10-22 17:53:34 +02:00
Dmitry Stogov 1417352dda Allow loading FFI bindings through ffi.preload directive 2019-10-22 17:52:56 +03:00
Christoph M. Becker 1c9bfcb6a7 Fix #78716: Function name mangling is wrong for some parameter types
We have to cater to function parameter alignment when calculating the
parameter size.
2019-10-22 11:38:58 +02:00
Fabien Villepinte 6422c95633 Add a run with opcache to the coverage job
Some tests are not run when OPcache is not available.
This should make the results more accurate.
2019-10-22 11:12:39 +02:00
Christoph M. Becker c9df44cab4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
2019-10-22 09:52:08 +02:00
Remi Collet c233d8c96e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  add NEWS entry
2019-10-22 09:38:05 +02:00
Stanislav Malyshev 59953efc09 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78599 (env_path_info underflow can lead to RCE) (CVE-2019-11043)
  bump versions after release
  set versions for release
2019-10-21 13:17:27 -07:00
Fabien Villepinte 7ce85c34ff Revert "Add tests for ReflectionZendExtension"
This reverts commit 4194e0415b.

There were already tests for this class.
2019-10-21 21:31:36 +02:00
Fabien Villepinte 4194e0415b Add tests for ReflectionZendExtension 2019-10-21 21:17:16 +02:00
Dmitry Stogov 05c5e5dfde Fixed bug #78512 (Cannot make preload work) 2019-10-21 14:52:26 +03:00
Nikita Popov 3d55386aa8 Fix static prop cleanup for dl'ed internal classes 2019-10-21 12:17:38 +02:00
Nikita Popov ed31e04133 Fix leak with cycle in static prop of internal class
More the cleanup of interned classes before the final GC run,
just like it is done for user classes.
2019-10-21 10:26:10 +02:00
Joe Watkins 1ac961bea8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78697: inaccurate error message
2019-10-21 09:24:41 +02:00
Stanislav Malyshev d517c559fc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78633: Heap buffer overflow (read) in mb_eregi
2019-10-20 23:20:16 -07:00
Jakub Zelenka 666fb9a194 Add NEWS for the fixed bug #74083 2019-10-20 16:58:13 +01:00
Maksim Nikulin d537ae73e0 Skip fpm bug #74083 test on Windows
Have not expected side effects of `include`.
2019-10-20 16:08:55 +01:00
Maksim Nikulin 2f9f409156 Add (slow) test for fpm concurrent reloads #74083 2019-10-20 16:08:55 +01:00
Maksim Nikulin ae5154c6c6 Block signals during fpm master initialization
Fix PHP-FPM failure in the case of concurrent reload attempts.

Postpone signal delivery to the fpm master process till proper signal
handlers are set. Prevent the following case:

- Running master process receives `SIGUSR2` and performs `execvp()`.
- Another `SIGUSR2` is arrived before signal handlers are set.
- Master process dies.
- Requests to the HTTP server handled by PHP-fpm can not be served
  any more.

Block some signals using `sigprocmask()` before `execvp()` and early
in the `main()` function. Unblock signals as soon as proper
handlers are set.

Fixes bug #74083
2019-10-20 16:08:55 +01:00
Fabien Villepinte 62b053a3be Improve the error message in timeout tests
Closes GH-4818.
2019-10-20 10:55:27 +02:00
Fabien Villepinte 4b3e041f5b Fix proto of enchant_broker_list_dicts() 2019-10-19 22:11:34 +02:00
Tyson Andre 38f388fba4 Fix miscellaneous typos in docs 2019-10-19 19:19:28 +02:00
Fabien Villepinte 550a2df043 Add tests for DOMEntityReference 2019-10-19 15:42:16 +02:00
Christoph M. Becker 26635ed71a Fix #78684: PCRE bug72463_2 test is sending emails on Linux
This test is not supposed to run on non Windows systems; otherwise it
would try to send an email.
2019-10-19 12:59:32 +02:00
Christoph M. Becker ee6a71ca73 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78694: Appending to a variant array causes segfault
2019-10-19 11:51:05 +02:00
Nikita Popov 650115c827 Improve exif tag name fetching 2019-10-18 16:55:05 +02:00
Nikita Popov 56e3e6f135 Implement a cache for exif tag name lookups 2019-10-18 16:54:56 +02:00
Nikita Popov e5324a2484 Limit the amount of errors generated during exif parsing
Emitting errors is fairly expensive, to the point that parsing
a file with a huge number of invalid tags can take seconds.
Generating ten thousand errors is unlikely to help anybody, but
constitutes a potential DOS vector.
2019-10-18 16:54:49 +02:00
Christoph M. Becker 81806db90b Fix test case
Cf. <https://github.com/php/php-src/pull/4687>.
2019-10-18 16:23:56 +02:00
Christoph M. Becker 197568d634 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #70153 \DateInterval incorrectly unserialized
2019-10-18 15:33:25 +02:00
Alex Porto dos Santos a6a2d167d8 Update array access syntax deprecated
Update array access syntax deprecated in line 175 and 204
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/alex/php/hello/ext_skel.php on line 175
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/alex/php/hello/ext_skel.php on line 204
2019-10-17 23:39:55 +02:00
Nikita Popov cf85eb2468 Integrate property types with variance system
Property types are invariant, but may still have to load classes in
order to check for class aliases. This class loading should follow
the same rules as all other variance checks, rather than just
loading unconditionally.

This change integrates property type invariance checks into the
variance system as a new obligation type, and prevent early binding
if the type check cannot be performed.
2019-10-17 13:37:04 +02:00
Fabien Villepinte 8b160f530c Change port to avoid collision with others tests
The 64321 port is already used with the ext/openssl tests.
2019-10-16 20:50:54 +02:00
Derick Rethans 3f7cc8361c Merge branch 'PHP-7.3' into PHP-7.4 2019-10-15 21:00:57 +01:00
Sara Golemon 15d7cd9e18 Silence undefined index warning when openssl not available. 2019-10-15 15:37:56 -04:00
Christoph M. Becker 8e06504e94 Prevent parallel testing conflicts
disk_free_space_basic.phpt already uses this directory, so we rename
it.
2019-10-15 16:29:46 +02:00
Derick Rethans 6e2635d2f2 Update NEWS for 7.4.0RC5 2019-10-15 11:29:33 +00:00
Derick Rethans 998be7752c Update NEWS for PHP 7.4.0RC4 2019-10-15 11:28:15 +00:00
Joe Watkins 042e3b227e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix checksum calculation for opcache
2019-10-14 16:50:23 +02:00
Nikita Popov 641f9615cc Fix handling of overflowing invalid octal in tokenizer
If token_get_all() is used, we still need to correctly distinguish
LNUMBER vs DNUMBER here for backwards compatibility.
2019-10-14 16:36:27 +02:00
Nikita Popov c518932c03 Add "-pthread" to EXTRA_LDFLAGS_PROGRAM as well 2019-10-14 11:33:39 +02:00
Christoph M. Becker f6bd5dcbe9 Fix test case
`MSG_EOR` and `MSG_EOF` are not necessarily defined, in which case the
test would fail.
2019-10-12 16:28:57 +02:00
Christoph M. Becker c10d3d3a35 Fix potential heap corruption
`tmp` is allocated by `malloc()`, so we must not `LocalFree()` it.
2019-10-12 16:16:14 +02:00
Christoph M. Becker 586f8515d5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78665: Multicasting may leak memory
2019-10-12 14:46:10 +02:00
Gerard Roche db54b0fa18 Azure: Publish code coverage results
* Add an Azure Publish Code Coverage Results task
* Add `make gcovr-html` to generate a gcovr test coverage report in HTML
* Add `make gcovr-xml` to generate a gcovr test coverage report in XML
* Remove `test` target dependency from `make lcov-html`;
  Run the two targets together instead: `make test lcov-html`.

Re: https://github.com/php/php-src/pull/4739#issuecomment-534911441

See: https://externals.io/message/107113,
https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-code-coverage-results?view=azure-devops,
and https://github.com/php/php-src/pull/4759.
2019-10-11 17:44:36 +02:00
Nikita Popov aa10e20830 Add upgrading note for round(-0.0) change
As cmb pointed out, the new behavior is compliant with POSIX:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/round.html.
2019-10-11 17:09:06 +02:00
Nikita Popov 3718a95526 Remove configure checks for ltp when using --enable-gcov
gcov builds can also be used with other tools like gcovr, so remove
the hard dependency on LTP.
2019-10-11 16:51:03 +02:00
Remi Collet a78b09c9b8 NEWS 2019-10-11 13:38:15 +02:00
Remi Collet 5a024d2c5b Fix #78662: stream_write bad error detection 2019-10-11 13:36:58 +02:00
Fabien Villepinte 8b8c226dbf Replace port already used
Closes GH-4811.
2019-10-11 10:57:09 +02:00
Nikita Popov e4aac082a2 Merge branch 'PHP-7.3' into PHP-7.4 2019-10-10 16:14:52 +02:00
Dmitry Stogov 33958ccb36 Revert "Fixed CLI/CGI/FPM build, when they are built together with Apache SAPI"
This reverts commit db094b4b2e.
2019-10-10 16:28:59 +03:00
Dmitry Stogov 1bb1a1ee28 Revert "Don't buid static libaraies when only DSO required"
This reverts commit f633c34757.
2019-10-10 16:28:59 +03:00
Dmitry Stogov b64a182233 Revert "Link executable files using non PIC object files. This reduces PIC overhead and improves performance."
This reverts commit eef85229d0.
2019-10-10 16:28:59 +03:00
Nikita Popov 5a076e670a Return error_zval form get_property_ptr_ptr on exception
This goes in the reverse direction of 4463acb951.
After looking around a bit, it seems that we already check for
Z_ISERROR_P() on the get_property_ptr_ptr return value in other places.
So do this in zend_fetch_property_address() as well, and also make
sure that EG(error_zval) is indeed returned on exception in
get_property_ptr_ptr.

In particular, this fixes the duplicate exceptions that we used to
get because first get_property_ptr_ptr threw one and then
read_property throws the same exception again.
2019-10-10 15:14:04 +02:00
Nikita Popov 4463acb951 Explicitly check for exceptions in by-ref obj prop assign
Relying on setting ERROR if an exception happened during the
property address fetch is both a bit fragile and may pessimize
other codepaths that will check for exceptions in the VM. Adding
an extra exception check instead, which should also allow us to
drop the use of ERROR in this area in master.
2019-10-10 14:41:35 +02:00
Nikita Popov 12f4e9e020 Fix leak when property AST evaluation fails 2019-10-10 12:44:55 +02:00
Nikita Popov f43f493e09 Also check for exception after stream_eof 2019-10-10 12:08:04 +02:00
Nikita Popov b02cf8b66e Merge branch 'PHP-7.3' into PHP-7.4 2019-10-10 11:41:51 +02:00
Nikita Popov 6878c583b0 Report error if stream_read is not implemented
We need to return -1 in this case. Slightly restructure the code
to avoid unnecessary conditions.
2019-10-10 11:13:10 +02:00
Nikita Popov 382f9b28e8 Fix leak on "Cannot assign by reference to overloaded object" error 2019-10-10 10:07:54 +02:00
Nikita Popov 5b44560dfc Merge branch 'PHP-7.3' into PHP-7.4 2019-10-09 17:33:52 +02:00
Christoph M. Becker 973617cacd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78656: Parse errors classified as highest log-level
2019-10-09 17:29:54 +02:00
Nikita Popov 91eb632472 Merge branch 'PHP-7.3' into PHP-7.4 2019-10-09 17:00:55 +02:00
Nikita Popov a4d7f4c3e1 Merge branch 'PHP-7.3' into PHP-7.4 2019-10-09 14:58:10 +02:00
Christoph M. Becker 4625fa181f Fix #78650: new COM Crash
As of PHP 7.4.0, the `get_property_ptr_ptr` handler is mandatory; we
implement it to always return `NULL`, which is equivalent to not
setting the handler in former versions.

We add a portable and faster test case than what has been presented in
the bug ticket.
2019-10-09 14:09:02 +02:00
Fabien Villepinte 8b5c351154 Avoid file clash in root_check skipifs
Extract root check into skipif_root.inc to share this commonly
repeated logic.

Closes GH-4779.
2019-10-08 18:20:13 +02:00
Nikita Popov bea832cbf6 Don't check type of simple parameter default values
After fixing the int->double coercion case, this is already verified
at compile-time, so there is no need to redo this type check on
every call.

Only perform the type check every time for the case of AST default
values.
2019-10-08 17:29:41 +02:00
Nikita Popov 21148679d1 Handle "non well formed" exception during ZPP
Previously if the "non well formed" notice was converted into an
exception we'd still end up executing the function.

Also drop the now unnecessary EG(exception) checks in the engine.

Additionally remote a bogus exception in zend_is_callable: It
should only be writing to error, but not directly throwing.
2019-10-08 17:17:49 +02:00
Nikita Popov 68b26ff8cf Merge branch 'PHP-7.3' into PHP-7.4 2019-10-08 16:14:06 +02:00
Nikita Popov 9004102b99 Fixed bug #78648 2019-10-08 15:39:22 +02:00
Nikita Popov ad3ddf46f9 Fixed bug #78644
Make sure the initialize the result of FETCH_OBJ_UNSET operations.
I'm using a NULL value rather than ERROR here, because the latter
no longer exists in master.
2019-10-08 14:32:49 +02:00
Christoph M. Becker d1de1777e9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add missing SKIPIFs in exif tests
2019-10-08 14:12:50 +02:00
Nikita Popov 196f9697ef Merge branch 'PHP-7.3' into PHP-7.4 2019-10-08 12:35:35 +02:00
Christoph M. Becker 346be2cf59 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78642: Wrong libiconv version displayed
2019-10-08 12:10:58 +02:00
Christoph M. Becker c2781dbe5e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  7.3.12 is next
2019-10-08 12:05:21 +02:00
Remi Collet 1cb52fe791 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  next is 7.2.25
2019-10-08 11:36:57 +02:00
Remi Collet e1362b3cf0 add librt for opcache 2019-10-08 10:48:10 +02:00
Christoph M. Becker 88e0d88897 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78641: addGlob can modify given remove_path value
2019-10-08 09:49:46 +02:00
Tyson Andre 5eebd55391 Fix grammar nits on php 7.4 UPGRADING 2019-10-07 19:30:58 -04:00
Nikita Popov 3c38d20882 Merge branch 'PHP-7.3' into PHP-7.4 2019-10-07 17:52:41 +02:00
Nikita Popov 2f64844495 Fix leak when include fails in a read operation
Usually it will already fail when opening, but reads can also
fail since PHP 7.4, in which case we still need to place the
file handle in open_files to make sure the destructor will run
on it.
2019-10-07 17:29:33 +02:00
Nikita Popov 638ac2efc4 Merge branch 'PHP-7.3' into PHP-7.4 2019-10-07 16:44:39 +02:00
Nikita Popov f085bddb51 Fix number of required arguments in arginfo
* pack() only requires one argument
* stream_context_set_option() only requires two arguments
* ReflectionMethod::getClosure() accepts no args for static methods
* DOMDocument::createProcessingInstruction() only requires one arg
* DOMImplementation::createDocument() only requires two arguments
* DOMDocument::importNode() only requires one arg
* mysql_get_client_version() doesn't accept any args,
  despite what the docs say...
2019-10-07 16:32:11 +02:00
Nikita Popov 1dbf80bcc2 Merge branch 'PHP-7.3' into PHP-7.4 2019-10-07 13:24:16 +02:00
Christoph M. Becker 8cdab9b217 Bail out if JUNIT is not enabled
Otherwise we would try to access an array element of `false`, which
issues a notice as of PHP 7.4.0.  This would happen, for instance, for
bug63447_001.phpt if CGI is not available.
2019-10-07 13:22:11 +02:00
Nikita Popov 81d95c4c3c Don't test default serialize max_depth
The default depth is large enough to cause stack overflows in
msan builds, though apparently only on old clang versions. Avoiding
a stack overflow there requires making the depth *much* smaller,
less than 1000. As I don't think that's reasonable for all the other
setups where 4k works fine, I'm just dropping this part of the test.
2019-10-07 12:43:12 +02:00
Christoph M. Becker 53077217e2 Delete temporary .post files of run-tests.php
Commit 5649267[1] changed run-tests.php to only delete .post files for
passing tests.  However, that code wouldn't be exercised at all, since
`run_test()` already returned, so we move the deletion upwards.

[1]
<http://git.php.net/?p=php-src.git;a=commit;h=5649267b257c78e46a934434c0bff894e0b5b694>
2019-10-07 12:17:41 +02:00
Nikita Popov 5b067163be Limit retry_limit test to oniguruma >= 6.9.3
This test is somewhat fragile in that it depends on how well a
particular regex is optimized. Apparently on 6.9.1 this regex
would hit the default retry_limit of 1000000 already. I'm limiting
this to 6.9.3 because that's the version that works for me.
2019-10-07 10:49:34 +02:00
Nikita Popov 07f4830413 Fix typo in UPGRADING
[ci skip]
2019-10-07 09:51:13 +02:00
Christoph M. Becker b142e8a4b3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78623: Regression caused by "SP call yields additional empty result set"
2019-10-07 09:18:46 +02:00
Nikita Popov 6623e7ac51 Add support for mbstring.regex_retry_limit
This is very similar to the existing mbstring.regex_stack_limit,
but for backtracking. The default value matches pcre.backtrack_limit.
Only used on libonig >= 2.8.0.
2019-10-06 10:06:33 +02:00
Nikita Popov b078ae6c01 Merge branch 'PHP-7.3' into PHP-7.4 2019-10-04 22:46:53 +02:00
Nikita Popov 01b3cc4dee Merge branch 'PHP-7.3' into PHP-7.4 2019-10-04 16:04:34 +02:00
Christoph M. Becker 884b780667 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Split intl tests for ICU 65
2019-10-04 13:54:49 +02:00
Nikita Popov ca652aafa8 Fixed bug #78632
I'm going for a very conservative fix here, where the previous
logic is restored for the case where an object is passed to
method_exists(). We might want to check against EG(scope) instead,
but this seems like a safer choice.

This means that behavior in PHP 7.4 changes only for
method_exists('C', 'privateMethodNotOnC'), which should be sensible.
2019-10-04 12:41:49 +02:00
Nikita Popov 9659562cb5 Fix use-after-free with delayed interned memoized const operand
We should addref CONST operands during memoization, as they might
be destroyed by later compilation, e.g. through interning.
2019-10-04 10:38:11 +02:00
Nikita Popov f26b60a583 Fix crash when unpacking into array literal with string keys 2019-10-04 10:11:30 +02:00
Christoph M. Becker 6627f782d6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78620: Out of memory error
2019-10-04 09:11:18 +02:00
Dmitry Stogov 3ded328bea Fixed bug #78614 (Does not compile with DTRACE anymore) 2019-10-04 10:10:22 +03:00
Joe Watkins 74ca3a5cad Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix #78624: session_gc return value for user defined session handlers
2019-10-04 06:16:18 +02:00
tpfast 8069e1522d Fix typo in CODING_STANDARDS.md [ci skip] 2019-10-04 05:42:27 +02:00
Joe Watkins 5a8e7b95a1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #76809 (SSL settings aren't respected when persistent connection is reused)
2019-10-03 07:13:15 +02:00
Joe Watkins de83036f13 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #76859 stream_get_line skips data if used with data-generating filter
2019-10-03 06:51:56 +02:00
Derick Rethans a46bdcb631 Updated to version 2019.3 (2019c) 2019-10-02 23:39:11 +01:00
Derick Rethans 3f7da44209 Empty merge 2019-10-02 23:39:11 +01:00
Christoph M. Becker 2508131588 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Revert "Fix #78620: Out of memory error"
2019-10-02 19:03:25 +02:00
Christoph M. Becker b262b24beb Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78620: Out of memory error
2019-10-02 18:21:50 +02:00
Nikita Popov d81eb77b4a Fix AArch64 build 2019-10-02 14:41:02 +02:00
Nikita Popov 171d6c3ca7 Merge branch 'PHP-7.3' into PHP-7.4 2019-10-02 12:07:33 +02:00
Nikita Popov d6a77c992f Avoid file clash in root_check skipifs 2019-10-02 11:34:32 +02:00
Nikita Popov e98e1f92c9 Allow SA_RESTART for SIGALRM
If no explicit restart_syscalls is passed, default to
restart_syscalls=0 for SIGALRM only, to reduce BC impact.
2019-10-02 10:09:17 +02:00
Erik Lundin 6462c19689 Fixed #75245 Don't set content of elements with only whitespaces 2019-10-02 08:17:04 +02:00
Dmitry Stogov 3709c03cda Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed test that "fails" from time to time
2019-10-02 00:57:26 +03:00
Dmitry Stogov 5fb2f15824 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed test that "fails" from time to time
2019-10-02 00:49:37 +03:00
Nikita Popov f2e8851245 Remove func copy optimization for private method with static vars
Not NULLing the static_variables pointer for shadow methods during
static var shutdown would be a way to avoid this leak, but unless
there's evidence that inherited private methods with static vars are
actually a common use-case, I don't think we should keep this kind
of fragile edge-case optimization.

Fixes OSS-Fuzz #17875.
2019-10-01 13:04:06 +02:00
Christoph M. Becker 8812350c7a Fix AppVeyor build
`OPENSSL_CONF` must not contain quotes, but actually, we want to test
the default path, so we don't even set `OPENSLL_CONF` anymore.
2019-10-01 11:51:07 +02:00
Christoph M. Becker 73f29a5c5e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add missing skip keyword in tests
2019-10-01 11:17:53 +02:00
Derick Rethans a453258959 Update NEWS for 7.4.0RC4 2019-10-01 08:31:43 +00:00
Derick Rethans c5b4cd6556 Update NEWS for PHP 7.4.0RC3 2019-10-01 08:30:24 +00:00
Christoph M. Becker d596fda993 Fix AppVeyor setup wrt. changed OpenSSL default config path 2019-10-01 10:01:34 +02:00
Christoph M. Becker 59ac81f81e Update regarding changed OpenSSL default config path 2019-10-01 09:14:58 +02:00
Fabien Villepinte 0aa3acc6c4 Fix borked SKIPIFs 2019-09-30 17:51:41 +02:00
Nikita Popov 1f0ffece91 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-30 15:06:43 +02:00
Christoph M. Becker 3d89f92784 Skip tests for old versions instead of marking them XFAIL
According to commit 0eea9a6[1], these tests fail with old Oniguruma
versions; we are not sure which version of Oniguruma is required to let
them pass, but at least 6.9.3 is sufficient.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=0eea9a642941ab5d4c612f8092f186977afbb73e>
2019-09-30 14:14:23 +02:00
Christoph M. Becker 70f367d48a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78609: mb_check_encoding() no longer supports stringable objects
2019-09-30 13:06:57 +02:00
Nikita Popov 27f5785363 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-30 12:54:18 +02:00
Nikita Popov 19e7e4b197 Fixed bug #78604
<?php followed by EOF is valid since PHP 7.4.
2019-09-30 10:41:14 +02:00
Nikita Popov 1806ce9cb0 Add max_depth option to unserialize()
Add a max_depth option to unserialize and an unserialize_max_depth
ini setting, which can be used to control the depth limit. The
default value is 4096.

This option is intended to prevent stack overflows during the
unserialization of deeply nested structures.

This fixes bug #78549 and addresses oss-fuzz #17581, #17589, #17664,
and #17788.
2019-09-30 10:28:24 +02:00
Christoph M. Becker ce769a94a8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix build for libzip < 0.11.2
2019-09-29 13:38:28 +02:00
Tyson Andre 7e0f7b7677 Reduce memory used by token_get_all()
Around a quarter of all strings in array tokens would have a string that's one
character long (e.g. ` `, `\`, `1`)

For parsing a large number of php files,
The memory increase dropped from 378374248 to 369535688 (2.5%)

Closes GH-4753.
2019-09-28 21:29:58 +02:00
Nikita Popov 1b08ab26f7 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-28 17:17:18 +02:00
Fabien Villepinte 8c7b8d75db Fix wrong function name in SKIPIF 2019-09-27 23:01:48 +02:00
Christoph M. Becker 3204d7e0d1 Fix test regarding Reflection::export() deprecation 2019-09-27 16:33:53 +02:00
Christoph M. Becker d90711138b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix SKIPIF in ext/mysqli
2019-09-27 16:04:35 +02:00
Christoph M. Becker 63eed0b6c5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix skipif.inc
2019-09-27 12:52:14 +02:00
Nikita Popov f2826954ac XFAIL sapi/fpm/tests/log-bwd-multiple-msgs-stdout-stderr.phpt
This is supposed to be addressed by GH-4007, but that seems stalled
for now.
2019-09-27 11:18:50 +02:00
Nikita Popov a020d3bbea Enable ubsan stack trace printing on community job
Try to do this using "variables" -- apparently these get uppercased
and are made available as environment variables.
2019-09-27 11:16:22 +02:00
Nikita Popov b154c12cc9 Fix file clash in rename_variation.phpt
rename_variation2.tmp is ... unsurprisingly ... already used by
rename_variation2.phpt. Alternatively it could be placed in the
directory that the test creates, but maybe this is intended to
test cross-directory renames, so I'll leave it.
2019-09-27 11:11:23 +02:00
Nikita Popov a6c9c7c2b8 Handle resources used as array keys consistently
Resources used as array keys are generally handled by throwing a
notice and converting the resource to the resource handle. The only
exception is the [$resource => null] syntax, where this was treated
as an illegal offset type instead. However, this also only happened
for VM evaluations, the AST evaluator did handle resources correctly.
2019-09-27 10:40:41 +02:00
Nikita Popov d71f859a56 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-26 13:47:41 +02:00
Nikita Popov 247d5618aa Merge branch 'PHP-7.3' into PHP-7.4 2019-09-26 10:25:55 +02:00
Dmitry Stogov 23db95e3e5 Fixed GOTO VM 2019-09-26 01:17:54 +03:00
Nikita Popov b8ef7c35ab Increase serialize_lock while decoding session
Avoid leaking state between Serializable::unserialize() and
session_decode().
2019-09-25 11:02:23 +02:00
Nikita Popov b100d51ba2 Remove xfail on bug70219.phpt
Looks like this is working as it's supposed to, the test expectation
just needs to be adjusted.
2019-09-25 10:57:03 +02:00
Nikita Popov a31256d52c Merge branch 'PHP-7.3' into PHP-7.4 2019-09-25 10:34:33 +02:00
Gerard Roche 9cc1bf5628 Fix GCOV not working for PHP-7.4 and master branches
Code coverage reports (`make lcov`), since commit eef8522 (7.4 branch),
generates incorrect coverage and emits warnings. Simplifying the
Makefile.gcov file has the side-effect of resolving the issue.

    Processing sapi/cli/php_http_parser.gcda
    php-src/lcov_data/sapi/cli/php_http_parser.gcda:stamp mismatch with notes file
    geninfo: WARNING: gcov did not create any files for php-src/lcov_data/sapi/cli/php_http_parser.gcda!
    ...
    Processing ext/mbstring/mb_gpc.gcda
    php-src/lcov_data/ext/mbstring/mb_gpc.gcda:stamp mismatch with notes file
    geninfo: WARNING: gcov did not create any files for php-src/lcov_data/ext/mbstring/mb_gpc.gcda!

Closes: https://bugs.php.net/bug.php?id=52718.
See also: https://bugs.php.net/bug.php?id=78288.
2019-09-25 10:19:19 +02:00
Gabriel Caruso 3205ebefa3 Use nproc instead of hardcoded number 2019-09-25 00:02:59 +02:00
Nikita Popov 73115ef873 Fixed bug #78589
Don't protect GC while destroying zvals. We may need to add GC
roots during this phase.
2019-09-24 12:17:21 +02:00
Christoph M. Becker 2a74fedff0 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
2019-09-24 11:15:28 +02:00
Stanislav Malyshev e7befd38d4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78559: Heap buffer overflow in mb_eregi
2019-09-23 21:51:12 -07:00
Christoph M. Becker 6bdde5d479 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix NEWS entry
2019-09-23 23:03:55 +02:00
Nikita Popov dbeeabed9b Merge branch 'PHP-7.3' into PHP-7.4 2019-09-23 17:18:39 +02:00
Nikita Popov 2bb04106be Merge branch 'PHP-7.3' into PHP-7.4 2019-09-23 16:42:59 +02:00
Nikita Popov 41335afed9 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-23 14:52:40 +02:00
Nikita Popov 7b7e04a1b7 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-23 13:47:38 +02:00
Nikita Popov 366f97f070 Remove commented code 2019-09-23 13:34:42 +02:00
Nikita Popov c2add43bbc Merge branch 'PHP-7.3' into PHP-7.4 2019-09-23 13:18:59 +02:00
Nikita Popov 3f0cab53b2 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-23 13:09:01 +02:00
Stephen Reay 7a81505f6f Allow lookup of distro-packaged QDBM headers on Debian 2019-09-23 09:53:31 +02:00
Christoph M. Becker 3a937c46e0 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test to be skipped if dom is not available
2019-09-22 18:43:24 +02:00
Nikita Popov 5e48bb7e1f Merge branch 'PHP-7.3' into PHP-7.4 2019-09-22 12:10:49 +02:00
Nikita Popov 0508a70640 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-22 10:27:07 +02:00
Christoph M. Becker f5b9cc4bcf Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix length of key passed to zend_hash_str_find_ptr
2019-09-21 18:13:06 +02:00
Christoph M. Becker 6dea11acd8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78579: mb_decode_numericentity: args number inconsistency
2019-09-21 16:17:45 +02:00
Remi Collet dc40332bb2 Fixed bug #78574 (broken shared build) 2019-09-20 13:30:13 +02:00
Dmitry Stogov f633c34757 Don't buid static libaraies when only DSO required 2019-09-19 23:44:53 +03:00
Nikita Popov f0f84adf2b Merge branch 'PHP-7.3' into PHP-7.4 2019-09-19 21:14:46 +02:00
Nikita Popov 3fd68fd827 Clean up JSON parser
Don't use <value> type for JSON tokens that don't have a value
and remove the errlex productions -- we're going to get an
unexpected token error anyway, there's no need to handle these
explicitly.

This also removes the awkward workarounds for the unused value
warnings.
2019-09-19 21:00:22 +02:00
Nikita Popov 5bee9c9062 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-19 17:22:28 +02:00
Nikita Popov 8a599c7b74 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-19 14:20:13 +02:00
Nikita Popov 22516b7d8a Merge branch 'PHP-7.3' into PHP-7.4 2019-09-19 11:36:19 +02:00
Christoph M. Becker 9dfbcd7248 Fix #78543: is_callable() on FFI\CData throws Exception
If `Z_OBJ_HANDLER_P(callable, get_closure)` throws, we must not let the
exeception pass to userland, if called through `is_callable()`.
2019-09-19 09:13:22 +02:00
Nikita Popov 38ae522440 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-18 16:37:14 +02:00
Nikita Popov db7702213c Merge branch 'PHP-7.3' into PHP-7.4 2019-09-18 10:45:07 +02:00
Nikita Popov 996292a91d Merge branch 'PHP-7.3' into PHP-7.4 2019-09-18 09:31:44 +02:00
Derick Rethans 7baca20067 Update NEWS for 7.4.0RC3 2019-09-17 16:39:07 +00:00
Derick Rethans 19ac6b2a58 Update NEWS for PHP 7.4.0RC2 2019-09-17 16:37:49 +00:00
Derick Rethans 9ed247b7b1 Revert "Update NEWS for PHP 7.4.0RC2"
This reverts commit 050059cb26.
2019-09-17 17:32:33 +01:00
Derick Rethans 4c39f557e6 Revert "Update NEWS for 7.4.0RC3"
This reverts commit 803dc6b8f2.
2019-09-17 17:32:31 +01:00
Nikita Popov 7c6985d7cb Merge branch 'PHP-7.3' into PHP-7.4 2019-09-17 17:34:24 +02:00
Nikita Popov 66351025c8 Enable --with-mhash on CI 2019-09-17 16:16:31 +02:00
Nikita Popov b50a90867a Merge branch 'PHP-7.3' into PHP-7.4 2019-09-17 15:43:35 +02:00
Dmitry Stogov db094b4b2e Fixed CLI/CGI/FPM build, when they are built together with Apache SAPI 2019-09-17 15:43:00 +03:00
Nikita Popov d266ba4f2d Check for exception after calling count_values()
To avoid a duplicate error if count_values() throws.
2019-09-17 13:13:44 +02:00
David Carlier ce25fa0d24 Monitoring anonymous pages on mac via vmmap tag 2019-09-17 12:54:46 +02:00
Nikita Popov 1a5f04688e Merge branch 'PHP-7.3' into PHP-7.4 2019-09-17 12:19:45 +02:00
Nikita Popov 62b440ffbb Merge branch 'PHP-7.3' into PHP-7.4 2019-09-17 12:09:06 +02:00
Fabien Villepinte 1792adebfd Improve test usleep_basic by inlining its output
Closes GH-4703.
2019-09-17 12:07:06 +02:00
Derick Rethans 803dc6b8f2 Update NEWS for 7.4.0RC3 2019-09-17 07:37:35 +00:00
Derick Rethans 050059cb26 Update NEWS for PHP 7.4.0RC2 2019-09-17 07:36:16 +00:00
Christoph M. Becker 20f73d3d8f Fix #78429: opcache_compile_file(__FILE__); segfaults
We have to ensure that OPcache has been properly started up when
`opcache_compile_file()` is called.
2019-09-16 16:01:09 +02:00
Fabien Villepinte 42046c71ee Fix typo 2019-09-16 15:55:23 +02:00
Nikita Popov 8c0c06da86 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-16 15:01:14 +02:00
Christoph M. Becker 145ffd93fc Fix #78516: password_hash(): Memory cost is not in allowed range
libsodium measures the memory cost in bytes, while password_hash() and
friends expect kibibyte values.  We have to properly map between these
scales not only when calling libsodium functions, but also when
checking for allowed values.

We also refactor to rid the code duplication.
2019-09-16 14:58:39 +02:00
Nikita Popov c3376bf7ae Fix use-after-free due to packed->mixed conversion with __unserialize() 2019-09-16 14:37:16 +02:00
Nikita Popov 0d3da6ac25 Fix segfault when unserializing abstract class 2019-09-16 13:52:52 +02:00
Nikita Popov b29b846863 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-16 13:03:08 +02:00
Nikita Popov c8359fcea2 Fix test after unserialize change 2019-09-16 11:59:43 +02:00
Nikita Popov 4377a8ea41 Sanity-check array/object lengths during unserialization
Avoid OOM conditions in unserialize due to overly large array or
object length specifications.
2019-09-16 11:38:35 +02:00
Dmitry Stogov 6417c507ce Fixed typos 2019-09-16 10:29:29 +03:00
Christoph M. Becker 631dd692a1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Stick with zend_long for ABI compatibility
2019-09-15 15:14:02 +02:00
Christoph M. Becker d0247a63b6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78535: auto_detect_line_endings value not parsed as bool
2019-09-14 18:48:28 +02:00
Nikita Popov 3f76f9416f Fix double-free on invalid large octal with separators
To clean up the mess here a bit, check for invalid octal digits
with an explicit loop instead of mixing this into the string to
number conversion.

Also clean up some type usage.
2019-09-14 12:10:06 +02:00
Nikita Popov ab4f725d83 Use XtOffsetOf() in url_scanner_ex
Instead of a manual implementation.
2019-09-14 00:25:14 +02:00
Nikita Popov fa07a9c223 Fix symtable_cache_limit assignment in phpdbg
The meaning of the limit changed in 7.4, it now points one past the
end. Adjust code accordingly.
2019-09-14 00:25:07 +02:00
David Carlier 711bd0a0fc Fix tautological compare warning
The ZEND_ALLOCATOR() macro compares against constants that are
larger than the unsigned short type, resulting in warnings on
clang. Avoid this by explicitly casting to size_t.
2019-09-14 00:25:00 +02:00
Nikita Popov ee0bf4b24d Define OBJ_PROP_TO_OFFSET() using XtOffsetOf()
This avoids null pointer arithmetic UB.
2019-09-14 00:24:54 +02:00
Nikita Popov ec30a3b171 Include stddef.h in zend_portability.h for offsetof() macro
This makes sure that we use compiler builtins when they are
available and thus avoid ubsan warnings in clang.

And also reindent the fallback implementation.
2019-09-14 00:24:47 +02:00
Nikita Popov 4226c8247f Fix use-after-free in assign-ref compilation
zend_emit_op_data may reallocate the op_array, so the assignment
of the RETURNS_FUNCTION flag may happen on an outdated opline.

Restructure the code a bit to set the flag before calling
zend_emit_op_data().
2019-09-13 18:22:14 +02:00
Nikita Popov c25104bb5b Merge branch 'PHP-7.3' into PHP-7.4 2019-09-13 14:37:15 +02:00
Dmitry Stogov af9b127fed Make constant and copy propagation only for IS_TMP_VAR operands 2019-09-13 12:38:57 +03:00
Dmitry Stogov e45a757bc2 Fixed incorrect usage of QM_ASSIGN instruction 2019-09-13 12:08:59 +03:00
Dmitry Stogov 51d9f32dbe Fixed bug #78531 (Crash when using undefined variable as object 2019-09-13 01:42:02 +03:00
Dmitry Stogov 5a616191f3 Load string once 2019-09-12 18:46:13 +03:00
Dmitry Stogov 697266a84e Eliminate checks using ZEND_CONST_COND() macro 2019-09-12 18:29:19 +03:00
Nikita Popov 4b9ebd837b Allow throwing exception while loading parent class
This is a fix for symfony/symfony#32995.

The behavior is:

* Throwing exception when loading parent/interface is allowed
  (and we will also throw one if the class is simply not found).
* If this happens, the bucket key for the class is reset, so
  it's possibly to try registering the same class again.
* However, if the class has already been used due to a variance
  obligation, the exception is upgraded to a fatal error, as we
  cannot safely unregister the class stub anymore.
2019-09-12 16:41:18 +02:00
Christoph M. Becker 679cbee870 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix exif build
  NEWS
2019-09-12 09:14:08 +02:00
Kalle Sommer Nielsen 89227fba99 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7)
2019-09-12 06:33:40 +03:00
Nikita Popov d88b212ea6 Improve "already declared" error message
If this error is missing because the rtd_key was renamed to lcname,
fetch the class based on lcname and use the class type and cased
name from there.
2019-09-11 17:04:13 +02:00
Nikita Popov fbe287a677 Fix typo in unlinked_instanceof assertion 2019-09-11 16:50:16 +02:00
Nikita Popov 270e5e3c5b Only allow "nearly linked" classes for parent/interface
The requirements for parent/interface are difference than for the
variance checks in type declarations. The latter can work on fully
unlinked classes, but the former need inheritance to be essentially
finished, only variance checks may still be outstanding.

Adding a new flag for this because we have lots of space, but we
could also represent these "inheritance states" more compactly in
the future.
2019-09-11 16:27:28 +02:00
Nikita Popov b7c353c8d0 Specify -fsanitize-no-recover
To make it more obvious when there are ubsan failures.
2019-09-11 11:59:33 +02:00
Nicolas Grekas aee31dd7e4 Improve Symfony test setup
Perform PHPUnit installation under php7.3 -- which will also make
it work on master.

Also properly resolve the tty issue by specifying excluded groups
during the test run.
2019-09-11 11:15:23 +02:00
Nikita Popov f945c82ec6 Free history_get_history_state() result
It's not documented, but per https://bugs.python.org/issue8065
the result is freshly malloc'd and needs to be freed.
2019-09-11 10:59:04 +02:00
Nikita Popov 1ce830a4aa Fix another pointer indexing UB in http_fopen_wrapper
Only compute the gep after checking whether the pointer is NULL.
2019-09-11 10:31:03 +02:00
Nikita Popov 11f3e24190 Fixed bug #78506 2019-09-11 10:27:32 +02:00
Nikita Popov 0a24cd4e7c Preloading: Fix handling of static vars in inherited methods
Part of bug #78512.
2019-09-11 09:53:10 +02:00
Dmitry Stogov 5f555fb19e Fixed bad format string 2019-09-11 00:52:54 +03:00
Sara Golemon e9cb68d4f3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Bump for 7.2.24
2019-09-10 13:05:38 -04:00
Remi Collet d78ffd54ef Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Raise minimal GCC version, Test with 4.8 is OK With 4.4: error: #pragma GCC diagnostic not allowed inside functions
2019-09-10 16:29:44 +02:00
Christoph M. Becker abc564462f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  PHP 7.3.10RC1 has been tagged
2019-09-10 15:13:11 +02:00
Dmitry Stogov 21c3cdf668 NEWS entry, test and minor cleanup for FFI::isNull() 2019-09-10 11:23:12 +03:00
Dmitry Stogov 825dac1445 Merge branch 'PHP-7.4' of git.php.net:php-src into PHP-7.4
* 'PHP-7.4' of git.php.net:php-src:
  Drop regression test
2019-09-10 11:22:05 +03:00
Christoph M. Becker 280e40fadd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Drop regression test
2019-09-10 10:08:42 +02:00
Philip Hofstetter f6ff7eb335 add FFI::isNull() to check whether a FFI\CData is a null pointer 2019-09-10 11:03:51 +03:00
Dmitry Stogov ea92b9b655 Stop after exceptions 2019-09-10 11:01:36 +03:00
Simonov Denis 481f89551e Request #77863: PDO firebird support type Boolean in input parameters 2019-09-10 09:22:26 +02:00
Christoph M. Becker bcf9d1e995 new_variable '{' expr '}' is deprecated as well
Curly brace syntax for accessing array elements and string offsets is
deprecated [1]; this should also be the case for respective `new`
expressions.

This issue has been reported by brzuchal@php.net.

[1] <https://wiki.php.net/rfc/deprecate_curly_braces_array_access>
2019-09-09 19:05:23 +02:00
Nikita Popov 51fd8bd3ee Merge branch 'PHP-7.3' into PHP-7.4 2019-09-09 17:29:49 +02:00
Tyson Andre 3e89e9a636 Add opcache return type for random_int()
random_int() will throw for incorrect argument counts, types (e.g. float
that can't cast to int), or having min > max.

See ext/standard/random.c
2019-09-09 17:19:04 +02:00
Tyson Andre 45e529d673 Fix opcache zend_func_info for microtime/gettimeofday
microtime() doesn't return an array,
and gettimeofday() doesn't return a string.
See _php_gettimeofday in microtime.c (mode is non-zero for gettimeofday)
2019-09-09 17:13:19 +02:00
Nikita Popov 974e77b345 Clarify that our usage of gettimeofday() is infallible
And that false can't be returned for this reason.
2019-09-09 17:11:22 +02:00
Christoph M. Becker d9c0aa038b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix version
2019-09-09 15:44:36 +02:00
Christoph M. Becker 167ea6307b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78510: Partially uninitialized buffer returned by sodium_crypto_generichash_init()
2019-09-09 15:33:02 +02:00
Nikita Popov 7807319b7c Fix typo 2019-09-09 14:24:26 +02:00
Remi Collet a7b00f8787 zip edxtension is now 1.15.5 2019-09-09 14:22:12 +02:00
Remi Collet 766d5ff32f fix type consistency after
8f897f1040
2019-09-09 14:20:57 +02:00
Nikita Popov 36a8cf5182 Fixed bug #78514
The property class may have already been translated as part of
some other class. Only translate if xlat returns non-null.
2019-09-09 11:36:50 +02:00
Nikita Popov 66caca53ce Fix PDO pgsql memory leak with scrollable cursors 2019-09-09 10:50:10 +02:00
Nikita Popov 645b0372e3 Fix double free of DSN credentials 2019-09-09 10:10:41 +02:00
Peter Kokot f5dfea60a2 Update NEWS 2019-09-08 21:49:42 +02:00
Peter Kokot a8c97f0531 Fix #78349: Bundled pcre2 library missing LICENCE file
Most bundled libraries in PHP code already include license information
in the dedicated README.REDIST.BINS file. Instead of complicating
documentation files more this patch only updates the PCRE license info
in the readme file.
2019-09-08 21:46:48 +02:00
Nikita Popov 279f745a60 Fix reporting of redirect test failures in junit
These were being reported under the wrong name ... which means that
they don't show up as failures on azure :(
2019-09-07 22:47:50 +02:00
Dmitry Stogov eef85229d0 Link executable files using non PIC object files. This reduces PIC overhead and improves performance. 2019-09-07 11:59:11 +03:00
Nikita Popov 768c93ed13 Remove defines for specific oraldap versions
These are not used for anything.
2019-09-06 14:59:59 +02:00
Nikita Popov 148ee16ff3 Remove support for umich_ldap
Doesn't seem to exist anymore, and their website now redirects to
openldap.
2019-09-06 14:57:26 +02:00
Nikita Popov 025ff3b5a3 Remove nsldap support
The newest version we're checking (libssldap50) seems to be about
15 years out of date. We could add support for libssldap60 (also
unmainted, but more recent), but given how nobody has expressed any
interest in this, I'm going ahead and dropping this code.
2019-09-06 14:39:42 +02:00
Nikita Popov 34f4ad61dc Fix detection of gmp on clang
Split the default and custom path case. If the default is used,
assume that the library must be on the default include and lib path.
Only check that the version is appropriate.

Something similar is needed for ldap, but the checking code is much
more complex there, so I'm only adding a workaround for now.
2019-09-06 14:35:39 +02:00
Nikita Popov e81751ceac Fixed bug #78502
We need to make sure that the function is fully compiled before we
calculate the stack size. There already was a check for directly
recursive calls, but the same issue exists with indirectly recursive
calls.

I'm using DONE_PASS_TWO as the indication that the function is
fully compiled.
2019-09-06 11:33:28 +02:00
Stanislav Malyshev df35d5cc21 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix version
2019-09-05 09:55:54 -07:00
Nikita Popov 9ec61e43d4 Fix pipe detection and stream position handling
There are two related changes here:
1. Also check for S_ISCHR/FILE_TYPE_CHAR when checking for pipes, so
   that we detect ttys as well, which are also not seekable.
2. Always set position=-1 (i.e. ftell will return false) when a pipe
   is detected. Previously position=0 was sometimes used, depending on
   whether we're on Windows/Linux and whether the FD or FILE codepath
   was used.
2019-09-05 18:29:15 +02:00
Dmitry Stogov 4ecdff2da8 Revert "Microoptimization (avoid code duplication)"
This reverts commit 25d97f5eee.
2019-09-05 15:35:19 +03:00
Dmitry Stogov 25d97f5eee Microoptimization (avoid code duplication) 2019-09-05 13:44:46 +03:00
Dmitry Stogov 7237da27fe Remove HOT attribute from some VM handlers. Comparisons almost always followed by JMPZ/JMPNZ; JMPZNZ is rare used. 2019-09-05 11:40:15 +03:00
Nikita Popov a2c21e10b2 Remove --with-zlib-dir option from mysqlnd config
mysqlnd doesn't actually use this. PDO MySQL uses it, but also
declares it separately.
2019-09-05 10:39:04 +02:00
Nikita Popov b6f76aca54 Improve exception handling for abstract/deprecated calls
Reuse existing arg freeing loop instead of duplicating it.

Additionally also handle deprecated in DO_FCALL_BY_NAME.
2019-09-04 15:19:21 +02:00
Nikita Popov 4bb7282742 Fix handling of abstract/deprecated exception
The exception mechanism assumes that exceptions from DO_FCALL are
already happening after the function call. This means that we are
currently leaking the passed arguments, and I think we can also
corrupt the VM stack due to incorrect frame linking in some cases
(there are assertion failures if the VM stack page size is reduced).

Instead handle the stack frame freeing manually for this special
case.
2019-09-04 12:46:00 +02:00
Dmitry Stogov 1db0bad6a7 Fixed bug #78488 (OOB in ZEND_FUNCTION(ffi_trampoline)). 2019-09-04 12:16:12 +03:00
Tyson Andre 94e2f25f07 Add missing opcache return types for functions in spl
(excluding spl_autoload)

spl_object_id() is of the most interest to me,
since I frequently call it in an application.

This includes false/null types caused by wrong argument types and wrong argument
counts.

I can't rule out iterator_to_array returning null in spl_iterator_apply,
so leave MAY_BE_NULL in.

With review comments by nikic:
Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
2019-09-04 11:12:41 +02:00
Fabien Villepinte ced5bb7d88 Add the last missing SKIPIF 2019-09-04 08:53:35 +02:00
Fabien Villepinte db4f5e44e1 Add missing SKIPIF (mbstring) 2019-09-04 08:51:03 +02:00
Fabien VillepinteandGabriel Caruso 7aece45f4d Add missing SKIPIF (openssl)
Co-Authored-By: Gabriel Caruso <carusogabriel34@gmail.com>
2019-09-04 08:43:32 +02:00
Fabien Villepinte bbf7b8dd69 Add missing SKIPIF (sqlite) 2019-09-04 08:39:15 +02:00
Fabien Villepinte c0c1f9d38c Add missing SKIPIF 2019-09-04 08:36:11 +02:00
Christoph M. Becker 61dcae50d5 Document opcache.preload_user directive 2019-09-03 14:08:17 +02:00
Nikita Popov 6255308624 Report false for inherited private methods in method_exists()
These shadow methods only exist as internal implementation markers.
This mirrors the behavior of property_exists().
2019-09-03 13:59:25 +02:00
Christoph M. Becker fd7309d194 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #41997: SP call yields additional empty result set
2019-09-03 13:33:15 +02:00
Dmitry Stogov 5dc37cc306 Execute preload script under user defined by opcache.preload_user directive 2019-09-03 14:23:13 +03:00
Nikita Popov 518c651c66 Avoid pointer UB in strip_header
Don't calculate header_start if lc_header_start is NULL, as we're
going to overflow the address space in that case.
2019-09-03 12:28:18 +02:00
Nikita Popov 265af40a0a Use unsigned subtraction in php_random_int()
This subtraction may overflow the signed domain, which is UB. Use
an unsigned subtraction instead.
2019-09-03 12:28:18 +02:00
Derick Rethans ac356ba81f Merge branch 'PHP-7.4' of git://github.com/php/php-src into PHP-7.4 2019-09-03 09:11:00 +01:00
Tyson Andre 4de8503c22 Add missing opcache return info for ext/standard.
array_key_first/last returns null for invalid args,
wrong argument counts, and empty arrays.

random_bytes returns a string or throws.
2019-09-03 09:57:51 +02:00
Tyson Andre 1a905bcb1e Add new missing functions from ext/hash 2019-09-03 09:53:41 +02:00
Nikita Popov c0e9b1532e Add zpp check to spl_classes() 2019-09-03 09:50:08 +02:00
Derick Rethans c53da9b631 Update NEWS for 7.4.0RC2 2019-09-03 07:46:16 +00:00
Derick Rethans ba7ae00bde Update NEWS for PHP 7.4.0RC1 2019-09-03 07:44:58 +00:00
Nikita Popov 5acedabfc0 Clarify failure behavior of spl_iterator_apply()
It only fails if it throws, in which case it is meaningless to
set a return value.
2019-09-03 09:43:22 +02:00
Christoph M. Becker de643aaa46 Add missing argument checks
These functions don't expect any arguments, so we check that none are
given.
2019-09-03 09:27:55 +02:00
Nikita Popov 632708ac02 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-03 09:24:05 +02:00
Dmitry Stogov 78aa89a3ee Update PHP_API_VERSION 2019-09-02 19:02:40 +03:00
Christoph M. Becker f597059001 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
2019-09-02 15:21:49 +02:00
Christoph M. Becker 38d2c9bd62 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #76577: outdated documentation concerning track_errors
2019-09-02 15:06:45 +02:00
Dmitry Stogov c739023a50 Free two bits in fn_flags by merging ZEND_ACC_HEAP_RT_CACHE/ZEND_ACC_USER_ARG_INFO and ZEND_ACC_DONE_PASS_TWO/ZEND_ACC_ARENA_ALLOCATED that may be used only for user/internal functions 2019-09-02 14:05:28 +03:00
Dmitry Stogov e6d3a218f0 Fixed information about unused flags 2019-09-02 12:50:05 +03:00
Nikita Popov 0f489db808 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-02 09:37:26 +02:00
George Peter Banyard e895e96286 Drop E_STRICT notice in mysqli extension 2019-08-31 23:14:10 +02:00
Nikita Popov 77a0fa101e Reenable alloca support on ZTS
This got disabled due to an incorrect change in a preprocessor condition
in 2104bea5d7. It was not supposed to
be disabled.
2019-08-30 17:24:06 +02:00
Nikita Popov 1e4cc5bf0b Fix file clashes in copy tests
Create the "*" file in a sub-directory rather than the main test
directory, so that it's different for each test.
2019-08-30 16:36:49 +02:00
Nikita Popov 2f67f32eaa Remove bogus vcwd_open
This is a left-over from the Linux version...
2019-08-30 16:09:55 +02:00
Nikita Popov 27da21d429 Merge branch 'PHP-7.3' into PHP-7.4 2019-08-30 16:07:54 +02:00
Nikita Popov b4088ba509 Avoid accessing undefined index in CLI server test 2019-08-30 11:02:30 +02:00
Nikita Popov 226fd52c76 Don't call Reflection::export() in --rf etc implementation
This method is deprecated ... instead simply directly print the
object.
2019-08-30 11:02:28 +02:00
Fabien Villepinte e1afd9b213 Modernize some connectors in tests to remove env key duplication 2019-08-30 10:33:01 +02:00
Nikita Popov a12ebc295c Add job for community projects
Run some open-source projects through an aggressive debug
configuration with asan and ubsan. We don't care about test results,
only check that we don't assert or crash.

Currently testing laravel, symfony and amp.
2019-08-30 10:07:18 +02:00
Peter Kokot ae59a6d49d Update NEWS 2019-08-30 04:32:05 +02:00
Peter Kokot 18a2f0849f Fix #78460: PEAR installation failure
When building PHP outside of the source tree:

  mkdir custom-build-dir
  cd custom-build-dir
  ../path/to/php-src/configure

The directories need to be manually created including the pear directory
so the pear installation PHAR file doesn't need to be downloaded from
the remote location.

Closes GH-4639
2019-08-30 04:26:05 +02:00
Nikita Popov 48ff226cae Fix potentially uninitialized use in ldap
If ctrl->ldctl_value.bv_len is zero context is uninitialized. Only
free it if the call took place and succeeded.
2019-08-29 19:07:45 +02:00
Nikita Popov 6cc53981e5 Addref static vars when not copying private method
While we don't need to give this method separate static vars, we
do still need to perform an addref, as there will be a corresponding
delref in the dtor.
2019-08-29 14:47:09 +02:00
Nikita Popov a10093eee1 Use explicit unaligned type in md5 implementation 2019-08-29 14:47:03 +02:00
Nikita Popov a12fe30590 Merge branch 'PHP-7.3' into PHP-7.4 2019-08-29 12:34:07 +02:00
Nikita Popov 43551405d5 Set opcache.protect_memory=1 on Azure 2019-08-28 18:17:11 +02:00
Christoph M. Becker 35177027f4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78473: odbc_close() closes arbitrary resources
2019-08-28 17:58:35 +02:00
Nikita Popov f912445eb2 Add missed mutability check 2019-08-28 17:35:25 +02:00
Nikita Popov c45f19590c Remove delref in free_object_storage
This gives us better object leak diagnostics.
2019-08-28 17:04:36 +02:00
Nikita Popov 2709d6a250 Destroy error handlers before final GC run 2019-08-28 17:04:35 +02:00
Nikita Popov ec9a96dc60 Fixed bug #78335
Destroy static properties and variables prior to the final GC run,
as they may hold GC roots.
2019-08-28 12:32:06 +02:00
Stanislav Malyshev 8dfd3af169 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Upgrade oniguruma lib to 6.9.3
2019-08-28 00:11:50 -07:00
Nikita Popov e5c7f71004 Don't specify precedence for T_INC/T_DEC
As these do not operate on expressions, precedence is meaningless
for them.
2019-08-27 21:59:56 +02:00
Nikita Popov c1fbc3900f Add --with-pear to Travis build 2019-08-27 17:03:21 +02:00
Pavel Dyakonov f08095faa5 add ffi to php.ini extension [ci skip] 2019-08-27 15:53:51 +02:00
Anatol Belski 9b5d66bd52 Fix signature and calls 2019-08-27 14:34:35 +02:00
Christoph M. Becker 78e0f85cb5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update SDK version for AppVeyor
2019-08-27 13:36:09 +02:00
Jakub Zelenka 302a1400f3 Merge branch 'PHP-7.3' into PHP-7.4 2019-08-26 18:11:04 +01:00
Nikita Popov fa8565a0f1 Merge branch 'PHP-7.3' into PHP-7.4 2019-08-26 17:52:56 +02:00
Nikita Popov e2b49d6c45 Don't use needs_live_range hook for "special" live ranges
In particular we were disgarding SILENCE live ranges in opcache,
because we decided that a MAY_BE_LONG type does not need a live
range.
2019-08-26 16:12:03 +02:00
Christoph M. Becker 8f897f1040 Replace deprecated libzip functions
We replace all deprecated libzip functions with their recommended
substitutes, and add proper comment length checks including a test
case.
2019-08-26 14:05:28 +02:00
viest 5703943081 Deprecate AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES
These flags have been deprecated in glibc 2.28, so we also
deprecate them in PHP.

As we can't deprecate constants, we can only check for their use
in socket_addrinfo_lookup().
2019-08-26 11:33:18 +02:00
Nikita Popov 774cdb1d59 Merge branch 'PHP-7.3' into PHP-7.4 2019-08-26 11:13:57 +02:00
Nikita Popov 9483c50772 Fixed bug #78456 2019-08-26 11:08:42 +02:00
Nikita Popov bad49e55b9 Merge branch 'PHP-7.3' into PHP-7.4 2019-08-26 10:27:08 +02:00
Stanislav Malyshev c810d3d6ad Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test
2019-08-25 20:06:43 -07:00
Stanislav Malyshev 9f269d0d27 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #75457: heap-use-after-free in php7.0.25
2019-08-25 19:21:08 -07:00
Theodore Brown 1a78bdab27 Fix #78454: Consecutive numeric separators cause OOM error
Resolves out of memory error when consecutive numeric separators follow a binary/hex literal.
2019-08-25 22:46:18 +02:00
Christoph M. Becker ac40d0ffbc Don't modify arrays passed by value 2019-08-25 18:27:35 +02:00
Stanislav Malyshev beb7a0039b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update Oniguruma to 6.9.1
2019-08-25 00:20:40 -07:00
Stanislav Malyshev 377f30acb2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix CVE-2019-13224: don't allow different encodings for onig_new_deluxe()
  set version for release
2019-08-24 23:17:12 -07:00
Nikita Popov d1157cbce1 Relax closure $this unbinding deprecation
Only deprecate unbinding of $this from a closure if $this is
syntactically used within the closure.

This is desired to support Laravel's macro system, see laravel/framework#29482.

This should still allow us to implement the performance improvements
we're interested in for PHP 8, without breaking existing use-cases.
2019-08-23 17:21:23 +02:00
Nikita Popov 8807889ac2 Fix arginfo leak when using disabled_classes
Also remove the hack where scope is set to NULL in order to make
free_internal_arg_info work. Instead explicitly call it for class
methods.

This fixes the asan build for Zend/tests/bug77494.phpt.
2019-08-23 17:00:59 +02:00
Nikita Popov 7910f128e2 Fix noalias violation in select call 2019-08-23 16:18:59 +02:00
Nikita Popov 6534ff13cd Avoid strncat use in proc_open
Instead manually manage the insertion position.
2019-08-23 16:18:59 +02:00
Nikita Popov 724a4662b8 Replace strncat in filter implementation
In this case we already know exactly where we need to write, no
need to use strncat at all.
2019-08-23 16:18:50 +02:00
Nikita Popov 9173c21a35 Support variable element size in spl heap implementation
This allows us to drop the intermediate allocation for
spl_pqueue_elem.

This fixes GC for SplPriorityQueue, because we can now directly
return a well-formed GC child buffer.
2019-08-23 15:29:53 +02:00
Nikita Popov 13e92223c0 Fixed bug #78436 2019-08-23 15:27:28 +02:00
Christoph M. Becker 514be3ff87 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77812: Interactive mode does not support PHP 7.3-style heredoc
2019-08-23 14:04:31 +02:00
Christoph M. Becker eeb910911d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Suppress deprecation warning on IDNA2003 ICU methods for clang
2019-08-23 12:22:28 +02:00
Christoph M. Becker ca265eb545 Fix #78438: Corruption when __unserializing deeply nested structures
When storing two temporary variables for delayed __unserialize() calls,
we have to make sure that both fit into the same linked list element.
To that end we introduce the internal API `tmp_var` which allows to
reserve `num` slots in the same list element.

We also fix the `var_dtor_entries` struct definition to use the proper
size, namely `VAR_DTOR_ENTRIES_MAX`.
2019-08-23 11:41:06 +02:00
Christoph M. Becker 69ba2b98d1 Fix var_unserializer debug code
At least it now compiles and should be free of warnings.
2019-08-22 15:58:51 +02:00
Christoph M. Becker 1eb75f2937 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78441: Parse error due to heredoc identifier followed by digit
2019-08-21 22:54:52 +02:00
George Peter Banyard 01996c4b69 Remove dead code in base64.c 2019-08-20 21:42:06 +02:00
Remi Collet 15dcc1817d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  ensure proper settings for test
2019-08-20 16:31:11 +02:00
Derick Rethans cf678da52d Update NEWS for 7.4.0RC1 2019-08-20 14:10:36 +00:00
Derick Rethans b3561e9329 Update NEWS for PHP 7.4.0beta4 2019-08-20 14:09:17 +00:00
Christoph M. Becker c03114e55c Fix #78386: fstat mode has unexpected value on PHP 7.4
We must not assume that any file which is not a directory is a regular
file.  Therefore we employ `GetFileType()` in this case to properly
distinguish between character special, FIFO special and regular files.
2019-08-20 16:04:14 +02:00
Christoph M. Becker ae923287ca Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Don't use C++ style comments
2019-08-20 13:58:54 +02:00
Christoph M. Becker a18f53ec2c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix the problem for connect_attr, set db condition, and add a new attribute _server_host
2019-08-20 13:35:17 +02:00
Christoph M. Becker 3775d47eee Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78220: Can't access OneDrive folder
2019-08-19 19:58:45 +02:00
Nikita Popov 86d751f696 Merge branch 'PHP-7.3' into PHP-7.4 2019-08-17 10:59:52 +02:00
Sara Golemon bd62f5ac47 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Suppress deprecation warning on IDNA2003 ICU methods
2019-08-16 12:41:32 -04:00
Sara Golemon 4d3be2a995 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Revert "Move to non deprecated API on suitable ICU versions"
2019-08-16 11:40:01 -04:00
Jan Altensen 0b6d869d7c appveyor: exclude some documentation paths
Change-Id: Ifff234133f4437bfe5c31c1f1e00092cd60e1d53
2019-08-15 18:19:15 +02:00
Christoph M. Becker b1c4e0be89 Empty merge 2019-08-15 15:30:03 +02:00
Nikita Popov 34885408db Fixed bug #78409
This removes an incorrect optimization (I think this code used to be
necessary to properly handle references in the Serializable based
implementation, but now this code just avoids an array duplication
in a way that is not sound).
2019-08-15 10:40:28 +02:00
Christoph M. Becker 65ea6bbdc6 Empty merge 2019-08-14 19:25:48 +02:00
Nikita Popov 80a2bfafa4 Merge branch 'PHP-7.3' into PHP-7.4 2019-08-14 17:53:24 +02:00
Nikita Popov c238b5bbef Fix reference printing in GC tracing 2019-08-14 17:51:41 +02:00
Sara Golemon 2f13f65706 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Bump for 7.2.23
2019-08-13 19:34:26 -04:00
Christoph M. Becker 2781e54ef1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Next will be 7.3.10
2019-08-14 00:48:49 +02:00
Christoph M. Becker f25eee2c56 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Bump version numbers
2019-08-13 23:26:29 +02:00
Nikita Popov d891b5f458 Fixed bug #78410 2019-08-13 20:23:56 +02:00
Nikita Popov b0394ba0e5 Add myself to extension maintainer list
Year ranges are wild guesses.
2019-08-13 16:08:04 +02:00
Nikita Popov 60a7e60b61 Fixed bug #72530
For objects with destructors, we will now only call the destructor
in the initial GC run, and remove any nested data. The object is
marked purple so it will be considered a root for the next GC run,
at which point it will be fully destroyed, if possible.

GC counts change on a number of tests, as the objects now get
destroyed later.
2019-08-13 14:53:53 +02:00
Nikita Popov fdfc7ea932 Don't return persistent string from get_cfg_var()
This is not thread-safe.
2019-08-13 14:50:01 +02:00
Nikita Popov 201729840c Mark PCRE locale key as local persistent 2019-08-13 14:49:59 +02:00
Christoph M. Becker eb25176ab3 Remove dead code 2019-08-13 13:29:11 +02:00
Nikita Popov bc690d63f6 Adjust GC count in SPL test 2019-08-13 12:34:48 +02:00
Nikita Popov 72b7d99d0d Remove removed nested data from GC count 2019-08-13 12:17:08 +02:00
Nikita Popov f0f3fe0b6c Don't include non-refcounted structures in GC count 2019-08-13 12:08:59 +02:00
Nikita Popov 7bd2b9d2e6 Generalize delref assertion
The refcount should never become negative, not just during GC.
2019-08-13 11:44:54 +02:00
Nikita Popov 76fecb339f Merge branch 'PHP-7.3' into PHP-7.4 2019-08-13 11:23:06 +02:00
Nikita Popov b01824e596 Fixed bug #78406 2019-08-13 10:22:32 +02:00
Nikita Popov bdf3fa8c3e Merge branch 'PHP-7.3' into PHP-7.4 2019-08-13 09:54:44 +02:00
Christoph M. Becker ce646357bf Fix WS 2019-08-12 17:59:30 +02:00
Nikita Popov b6f1b61f8f Merge branch 'PHP-7.3' into PHP-7.4 2019-08-12 17:17:42 +02:00
Christoph M. Becker b1189b18d2 Add missing argument checks
These functions don't expect any arguments, so we should check that
none are given.
2019-08-12 15:36:35 +02:00
Nikita Popov a18ad194c4 Fixed bug #78396 2019-08-12 10:45:13 +02:00
Derick Rethans f465560a0f Updated to version 2019.2 (2019b) 2019-08-11 16:05:59 +01:00
Derick Rethans 7da140b58e Empty merge 2019-08-11 16:05:59 +01:00
Christoph M. Becker 9818f863c3 Fix parameter order
`imagecopymerge()` and `imagecopymergegray()` expect the destination
image first, not the other way round.
2019-08-11 16:16:39 +02:00
Christoph M. Becker 092571c1cb Extend color component range checks
We also check for alpha components to be within range, and we add yet
missing range checks for other functions as well.
2019-08-11 15:21:05 +02:00
Dmitry Stogov 4ebf527136 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed handling of references in nested data of objects with destructor
2019-08-09 17:47:35 +03:00
Nikita Popov 7b152990b6 Don't short-circuit MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE
Make sure we always go through mbfl_filt_conv_illegal_output(), so
that the number of illegal characters gets counted.
2019-08-09 16:33:21 +02:00
Nikita Popov 699b465da2 Fixed bug #78391 2019-08-09 15:03:40 +02:00
Dmitry Stogov 1456467cfe Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed second part of the bug #78379 (Cast to object confuses GC, causes crash)
2019-08-09 15:58:33 +03:00
Dmitry Stogov b2044cd93e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Added asserts to catch GC errors when refcount goes below zero.
2019-08-09 13:40:39 +03:00
Matteo Beccati 5c8124d311 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Skip test when SIGKILL is not defined
2019-08-09 10:33:15 +02:00
Matteo Beccati 00dd786ba4 Fix test when default TZ is not UTC 2019-08-09 09:58:10 +02:00
Nikita Popov d9dc942011 Merge branch 'PHP-7.3' into PHP-7.4 2019-08-08 10:55:02 +02:00
Nikita Popov 8a4171ac45 Add UPGRADING note about stream_set_option() and includes
[ci skip]
2019-08-08 10:12:16 +02:00
Nikita Popov fc17bfaacf Fixed bug #78383 2019-08-08 09:55:52 +02:00
Dmitry Stogov 720438c8ee Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78379 (Cast to object confuses GC, causes crash)
2019-08-08 10:07:39 +03:00
Christoph M. Becker be794894ef Fix detection of pg_config.h
pg_config.h is supposed to be placed right besides libpq-fe.h, so we
should check the same paths.
2019-08-07 13:25:07 +02:00
Christoph M. Becker ae91f8572e Skip test if ext/json is not available
Otherwise the test fails.
2019-08-07 13:04:13 +02:00
Christoph M. Becker 886be260cb Make extension compatibility check more liberal
Checking for the exact linker version appears to be too restrictive; it
should be fine if the tens match.

We also refactor to avoid repeating ourselves.
2019-08-07 11:31:12 +02:00
Christoph M. Becker 968ed124b2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78282: atime and mtime mismatch
2019-08-06 17:28:36 +02:00
Dmitry Stogov d1fd4607d0 Inline zend_zval_ptr() in executor explicitely (only on hot paths) 2019-08-06 16:28:42 +03:00
Dmitry Stogov ef35556498 typo 2019-08-06 13:58:17 +03:00
Dmitry Stogov d5d76ea6e7 Preloading is not comatible with dl() function 2019-08-06 12:44:55 +03:00
Dmitry Stogov 170a3f871f Don't set GC_HAS_DESTRUCTORS flag if destructors were already called 2019-08-06 11:35:53 +03:00
Derick Rethans 2811e924d1 Update NEWS for 7.4.0beta3 2019-08-06 06:55:20 +00:00
Derick Rethans 6da7f015e1 Update NEWS for PHP 7.4.0beta2 2019-08-06 06:54:01 +00:00
Dmitry Stogov 3fc0e2bb80 Fixed bug #78376 (Incorrect preloading of constant static properties) 2019-08-05 22:55:06 +03:00
Christoph M. Becker 790b0b109a Fix handling of succeeding XFAIL tests
Due to a typo in commit e1151c9[1], succeeding XFAIL test without an
EXPECTF or EXPECTREGEX section have been reported reported as passed
instead of warned.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=e1151c9549cf5a7235c1609019f79bbb1bbcdbea>
2019-08-05 11:38:47 +02:00
Christoph M. Becker 1ed9ebdea5 Support calling convention specific function name mangling
On Windows certain calling conventions cause C function names to be
mangled, so to import them we have to use the properly mangled names.
2019-08-04 12:14:11 +02:00
Christoph M. Becker f12dc90e5e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78346: strip_tags no longer handling nested php tags
2019-08-02 17:04:36 +02:00
Christoph M. Becker e60c507362 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78179: MariaDB server version incorrectly detected
2019-08-02 16:45:29 +02:00
Nikita Popov a4a535d8de Merge branch 'PHP-7.3' into PHP-7.4 2019-08-02 10:38:26 +02:00
Nikita Popov bf53d30fae Fix forwarding of extra args in opcache server tests 2019-08-01 17:00:11 +02:00
Christoph M. Becker 61e1147146 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Remove upgrade-pcre.php script
2019-08-01 10:50:08 +02:00
Nikita Popov bab8b3a8be Add test for bug #78356 2019-08-01 10:10:28 +02:00
Nikita Popov afd96392a3 Revert "Use RW fetch for argument unpacking"
This reverts commit 6913ec3282.
This reverts commit a9e332e027.

Causes https://bugs.php.net/bug.php?id=78356, which I don't have
a good solution for.
2019-08-01 10:06:53 +02:00
Christoph M. Becker 1f9a77baef Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix 78213: Empty row pocket
2019-07-31 18:08:05 +02:00
Peter Kokot 3e8774e57a Update NEWS 2019-07-30 22:09:00 +02:00
Peter Kokot 09b108246a Fix #78348: Remove -lrt from pdo_sqlite.so
The fdatasync check has been removed since PHP 5.3.

The Solaris fix was introduced via
8d63360fc4
and is today no longer relevant since the sqlite library is neither
bundled in php-src anymore neither the check needs to be done via the
PHP build system.

Closes GH-4485
2019-07-30 22:06:23 +02:00
Christoph M. Becker 053df4ac3b Fix tests
Apparently, nobody is testing with MySQL < 5.6 for quite a while.  We
should consider dropping support for these very old versions.
2019-07-30 16:32:49 +02:00
Nikita Popov a9e332e027 Handle RW UNPACK in inference 2019-07-30 10:31:51 +02:00
Nikita Popov 0ed6c37140 Fix FPM timer event re-registration
Make sure that fpm_event_add calls inside a timer callback work by
unregistering the event from the queue before invoking its callback.

The read timeout in tester.inc is increased because the added test
needs two seconds (one for SIGTERM, one for SIGKILL) until the
reload succeeds, so we should wait longer than that for a response.
2019-07-30 10:16:57 +02:00
Nikita Popov 6913ec3282 Use RW fetch for argument unpacking
Argument unpacking may need to create references inside the array
that is being unpacked. However, it currently can only do this
if a plain variable is unpacked, not for any nested accesses,
because the value is fetched for read. Resolve this by fetching
the operands for RW.
2019-07-30 10:07:08 +02:00
Christoph M. Becker 8413df5e55 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add security related NEWS entries [ci skip]
2019-07-30 09:51:37 +02:00
Remi Collet 88cc70eb94 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  add security NEW entries + reorder [ci skip]
2019-07-30 09:27:20 +02:00
Stanislav Malyshev fd6874c64d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78338: Array cross-border reading in PCRE
2019-07-29 14:51:21 -07:00
Stanislav Malyshev 4adf3dc109 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77919: Potential UAF in Phar RSHUTDOWN
  Update NEWS
  Fix bug #78256 (heap-buffer-overflow on exif_process_user_comment)
  Fix bug #78222 (heap-buffer-overflow on exif_scan_thumbnail)
2019-07-29 13:20:52 -07:00
Nikita Popov 76c2bef9b0 Don't explicitly install homebrew
It is already installed on azure, and this installation step is
very unreliable lately.
2019-07-29 21:08:29 +02:00
Christoph M. Becker 3429370d69 Fix build for --disable-signals 2019-07-29 18:49:44 +02:00
Nikita Popov 536c91c535 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-29 17:34:37 +02:00
Nikita Popov 6df1665bb3 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-29 17:14:40 +02:00
Christoph M. Becker 94924841ac Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS [ci skip]
2019-07-29 14:48:57 +02:00
Christoph M. Becker 07286d2fb4 Document how to generate ffi_parser.c 2019-07-29 13:38:53 +02:00
Nikita Popov a22a06c351 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-29 13:03:53 +02:00
Nikita Popov 92273bef66 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-29 11:27:39 +02:00
Nikita Popov 2eb159d589 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-29 11:26:31 +02:00
Nikita Popov 4ae807e84e Fixed bug #78344
When performing a constant visibility check during compilation we
might be dealing with unlinked classes and as such should account
for the possibility of unresolved parents.
2019-07-29 11:12:00 +02:00
Nikita Popov 9bfda013d3 Fixed bug #78340
Even if we know the file size, we still need to read in a loop in
case the read call returns an incomplete result.

This was less of an issue previously because we did not use the
"one large read" approach for non-plain stream wrappers.
2019-07-29 10:07:12 +02:00
Christoph M. Becker fec71e3f25 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78342: Bus error in configure test for iconv //IGNORE
2019-07-29 08:51:33 +02:00
Tyson Andre 99fe0471ed nit: Fix a typo in UPGRADING
Closes GH-4481
2019-07-27 23:14:07 +02:00
Sebastian Jennen a2b2aaa67a file encoding cleanup: remove bom in win32 files
These two files have been: "UTF-8 Unicode (with BOM) text".
By applying `dos2unix` on these files the BOM has been removed.

I checked the whole source code with dos2unix:
These were the only two text files affected.
2019-07-27 10:12:54 +02:00
Peter Kokot f1c4b48c84 Mention also API versions bumps
Closes GH-4470
2019-07-26 01:48:01 +02:00
Theodore Brown 0e6e2297fc Fix typos in UPGRADING and improve wording in a few places
Closes GH-4478
2019-07-26 01:16:49 +02:00
Christoph M. Becker e1c80d8ea7 Remove duplication 2019-07-25 19:09:21 +02:00
Levi Morrison d758691b9b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Remove .post files only for passing tests
2019-07-25 09:50:47 -06:00
Matteo Beccati 5d3d2b9827 Addded missing NEWS/UPGRADING entries for PDO "??" escape 2019-07-25 16:30:28 +02:00
Remi Collet 946a1e4314 Fix build warnings
- switch from strncpy to memcpy for -Wstringop-truncation
2019-07-25 11:50:44 +02:00
Nikita Popov 1cbcf0f4f1 Throw notice for plain wrapper fread/fwrite errors
Similar to what is done for socket read/write errors.
2019-07-25 10:42:10 +02:00
Peter Kokot dee243d475 Bump PHP_JSON_VERSION to PHP_VERSION
Closes GH-4459
2019-07-24 22:19:33 +02:00
Peter Kokot a3169964c0 Remove AC_FPM_POLL
AC_FPM_POLL defines HAVE_POLL symbol which is already checked by
configure.ac and function poll in AC_CHECK_FUNCTIONS.

Closes GH-4449
2019-07-24 22:03:47 +02:00
Peter Kokot 793dfa91bb Remove outdated Libtool hack for macs
This was once relevant for older versions of macs and autoconf 2.13.

Closes GH-4435
2019-07-24 21:40:21 +02:00
Nikita Popov 99d4b2bddc Mark _get_zval_ptr_deref as unused 2019-07-24 20:51:19 +02:00
Dmitry Stogov 853b426ecf Avoid over-specialization 2019-07-24 19:51:56 +03:00
Dmitry Stogov d7e8abb4aa Reordering 2019-07-24 18:49:46 +03:00
Dmitry Stogov 22e7ee3bb3 Delay dereference 2019-07-24 18:36:50 +03:00
Nikita Popov 626bc0e7cc Remove php_openssl_cipher_get_version()
This was added in 7.1 when add_assoc_string mistakenly accepted
a char* rather than const char* parameter and is no longer needed.
We can use SSL_CIPHER_get_version() directly.
2019-07-24 16:41:20 +02:00
Dmitry Stogov 6191df7553 Avoid reloading 2019-07-24 17:30:38 +03:00
David Carlier b05f364333 Fix bindpath mem leak in cgi
Closes GH-4451.
2019-07-24 12:06:40 +02:00
Derick Rethans 126dd8e1eb Update NEWS for 7.4.0beta2 2019-07-24 09:39:54 +00:00
Derick Rethans 5dae0eae62 Update NEWS for PHP 7.4.0beta1 2019-07-24 09:38:35 +00:00
Nikita Popov a49d53baa2 Don't skip uninitialized typed props in get_class_vars()
For bug #78319.
2019-07-24 10:52:01 +02:00
Nikita Popov d9680272c7 Revert "Drop free_filename field from zend_file_handle"
This reverts commit e0eca26285.

free_filename is used by the wincache extension, restore this
field for PHP 7.4.
2019-07-24 10:43:37 +02:00
Nikita Popov 1eb706179f Avoid references in TMP var
Make sure we deref the OBJ_IS result, because we store it in a TMP
var, which is not allowed to contain references and will cause
assertion failures in the unspecialized VM.

This also partially reverts fd463a9a60,
which merged the TMP and VAR specializations of COALESCE to work
around this bug.

An alternative would be to change the result type of OBJ_IS back
to VAR.
2019-07-24 10:07:26 +02:00
Nikita Popov 9e4603f772 Try to fix macos build
By avoiding unused variable opline warnings. Also clean up the
replacement of ZEND_VM_SPEC -- we were sometimes treating it as
an always-defined constant with a value (what it actually is) and
sometimes as a conditionally defined constant (which it isn't, but
which still worked thanks to the specializer). Switch to only
treating it as a constant with a value.
2019-07-24 09:44:55 +02:00
Dmitry Stogov 8d51af9bc2 Fixed CALL VM 2019-07-24 01:52:05 +03:00
Dmitry Stogov eaa9048973 Fixed unspecialized executor 2019-07-24 01:43:01 +03:00
George Peter Banyard 6d6d954d0d Cleanup of remaining E_STRICT in tests 2019-07-23 11:27:23 +02:00
Derick Rethans a07e85f93f Update NEWS for 7.4.0beta2 2019-07-23 08:06:23 +00:00
Derick Rethans 2b540b2f52 Update NEWS for PHP 7.4.0beta1 2019-07-23 08:05:05 +00:00
Peter Kokot 1fa238a7b3 Update NEWS 2019-07-23 02:32:38 +02:00
Peter Kokot e3236d8847 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
  Update NEWS
2019-07-23 02:13:54 +02:00
Matteo Beccati b19fdc18a9 Fix FR #71885 (Allow escaping question mark placeholders) 2019-07-22 19:35:03 +02:00
Peter Kokot 5d827c89cf Remove HAVE_OCILOBISTEMPORARY and HAVE_OCICOLLASSIGN
Symbols are not used in the current code.

Also remove not needed ocijdbc8 library addition and checks whcih were
removed also via b8e1d4d4e5 so Oracle 8
is no longer supported.

Closes GH-4454
2019-07-22 19:13:24 +02:00
Nikita Popov 845d07b343 Add upgrading entries
[ci skip]
2019-07-22 17:56:16 +02:00
Nikita Popov 5664035ffe Also report errors from Zend stream reader operation 2019-07-22 17:49:08 +02:00
Nikita Popov d59aac58b3 Report errors from stream read and write operations
The php_stream_read() and php_stream_write() functions now return
an ssize_t value, with negative results indicating failure. Functions
like fread() and fwrite() will return false in that case.

As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams
should not be regarded as error conditions, and be reported as
successful zero-length reads/writes instead. The handling of EINTR
remains unclear and is internally inconsistent (e.g. some code-paths
will automatically retry on EINTR, while some won't).

I'm landing this now to make sure the stream wrapper ops API changes
make it into 7.4 -- however, if the user-facing changes turn out to
be problematic we have the option of clamping negative returns to
zero in php_stream_read() and php_stream_write() to restore the
old behavior in a relatively non-intrusive manner.
2019-07-22 17:17:28 +02:00
Nikita Popov c817b8020c Special-case rc=1 self-referential arrays in ReflectionReference
New fix for bug #78263. This is special-cased elsewhere in the engine,
so we need to mirror it here.
2019-07-22 16:59:23 +02:00
Nikita Popov 19588a8f3b Revert "Add ReflectionReference::getRefcount()"
This reverts commit 428cfdd181.
2019-07-22 16:49:08 +02:00
Remi Collet 31d85b8417 cleanup gd build with system libgd - drop need to use libpng with system libgd - drop need to use libjpeg with system libgd - drop need to use libXpm with system libgd - drop need to use libfreetype with system libgd - improve configure comments 2019-07-22 16:14:19 +02:00
Peter Kokot a2b758dab5 Remove HAVE_PQPUTCOPYEND
Symbol is not used anywhere in the code and also Postgresql 7.x is
EOL anyway.

Closes GH-4453
2019-07-22 16:05:26 +02:00
Peter Kokot 9b8bf13b3a Fix internals upgrading log 2019-07-22 16:04:07 +02:00
Peter Kokot 4b03e102c5 Remove HAVE_DSA_DEFAULT_METHOD
Last usage removed via 6a81363405.

Closes GH-4455
2019-07-22 16:02:55 +02:00
Christoph M. Becker f8202b5513 Remove superfluous HAVE_GD_BUNDLED checks
If we're compiling the bundled libgd, `HAVE_GD_BUNDLED` is set, so
there is no need to check for this macro again.
2019-07-22 15:59:44 +02:00
Nikita Popov 72b9105d30 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-22 12:41:15 +02:00
Nikita Popov 6572c00b81 Merge branch 'PHP-7.4' of git.php.net:/php-src into PHP-7.4 2019-07-22 12:29:00 +02:00
Christoph M. Becker d3d3404db7 Drop superfluous ENABLE_GD_TTF
If we `HAVE_LIBFREETYPE`, we define `ENABLE_GD_TTF` if it is not
defined.  Therefore we can check for `HAVE_LIBFREETYPE` in the first
place.
2019-07-22 12:01:24 +02:00
Nikita Popov 23bb9f4e2f Add deprecations to UPGRADING 2019-07-22 11:53:50 +02:00
Nikita Popov 28cf080701 Deprecate unbinding $this from non-static closure 2019-07-22 11:39:52 +02:00
Nikita Popov b3f74b0b7d Deprecate allow_url_include 2019-07-22 11:39:52 +02:00
Nikita Popov 964de035a7 Deprecate restore_include_path() 2019-07-22 11:39:52 +02:00
Nikita Popov b3668aabf7 Deprecate convert_cyr_string() 2019-07-22 11:39:52 +02:00
Nikita Popov e41b7f6db4 Deprecate (real) cast 2019-07-22 11:39:52 +02:00
Nikita Popov 46b982409a Deprecate implode() with swapped parameter order 2019-07-22 11:39:52 +02:00
Nikita Popov cd2f2cd7d0 Deprecate FILTER_SANITIZE_MAGIC_QUOTES 2019-07-22 11:39:52 +02:00
Nikita Popov 4e190691e2 Deprecate is_real() function 2019-07-22 11:39:52 +02:00
Nikita Popov b1cdf06673 Deprecate money_format() 2019-07-22 11:39:52 +02:00
Nikita Popov 4e4d8a4a6c Deprecate hebrevc() 2019-07-22 11:39:52 +02:00
Nikita Popov e9e2fa4ad4 Deprecate ezmlm_hash() 2019-07-22 11:39:52 +02:00
Nikita Popov 39e756e7fe Deprecate encoding as 3rd param to mb_strrpos() 2019-07-22 11:39:52 +02:00
Nikita Popov 3121b7174f Deprecate Reflection export() methods
And remove the Reflector::export() interface method.
2019-07-22 11:39:52 +02:00
Nikita Popov 0ba7c3eadf Deprecate array_key_exists() on objects 2019-07-22 11:39:52 +02:00
Nikita Popov b2ea507bea Deprecate get_magic_quotes_gpc() and get_magic_quotes_runtime() 2019-07-22 11:39:52 +02:00
Nikita Popov b2915fc332 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-22 11:19:24 +02:00
Dmitry Stogov 60dca2295d Initialize static_members_table 2019-07-22 12:02:16 +03:00
Dmitry Stogov 2f51764e5d Evaluate constant in class scope 2019-07-22 11:59:24 +03:00
Nikita Popov 97b80bd83b Merge branch 'PHP-7.3' into PHP-7.4 2019-07-22 10:34:32 +02:00
Remi Collet fff6b18657 improve temporary fix for system libgd
- PHP_GD_PNG needed to set include path for png.h
- PHP_GD_JPEG needed to set include path for jpeglib.h
2019-07-22 09:11:32 +02:00
Peter Kokot ef165b4422 Remove build.mk usage
First step when creating the `configure` script is currently using
make. This is helpful when developing buildsystem to only rebuild
`configure` and `main/php_config.h.in` files when one of the *.m4
or configure.ac file changes and saves the developer time a little.

Realistically however, it is not needed that much considering the
times of several seconds to fully rebuild the configure script and
configuration header. The next step when running the `configure`
script is much more time consuming so performance on buildconf
level is a bit questionable and won't be noticed on today's
systems.

Additionally:
- buildconf now removes cache and all targets and uses -f option on
  the first step i.e. autoconf. The autoheader does not need the -f
  option in this case.

Closes GH-4437
2019-07-21 11:40:23 +02:00
Peter Kokot 1b969a74d0 Remove some unused HAVE_* symbols
- HAVE_NET_SNMP removed via cab643f615
- HAVE_CRYPTO_AEAD_AES256GCM ad120c5ae9
- Remove HAVE_FREETDS and HAVE_LIBDNET_STUB (not used in current
  extension; copy paste from other removed extensions)

Closes GH-4448
2019-07-21 11:34:18 +02:00
Peter Kokot 15782b27b8 Remove HAVE_LIBZIP
The libzip library is now always used from the system.

Closes GH-4450
2019-07-21 11:32:13 +02:00
George Wang 30de357fa1 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-21 00:01:39 -04:00
George Peter Banyard 1a031a242c Renamed MySQLi test to remove duplicate 'mysqli_'
Closes GH-4441
2019-07-21 01:10:31 +02:00
Markus Staab 577ed5bfa4 Fix typos
Closes GH-4447
2019-07-21 01:01:36 +02:00
Peter Kokot b1643e166d Fix failed tests for phar
- when $status is boolean, E_NOTICE appears and tests fail
- opcache is never enabled on these tests anyway.
- Add opcache.revalidate_freq=0 to testing script

  Instead of checking this in the tests files it can be used directly in
  the main testing script. Also this fixes failed tests.

- Use opcache_invalidate() instead of sleep() delay in some tests. Some
  delays are still used since the opcache_invalidate seems to be buggy
  and not working as expected.

Closes GH-4392
2019-07-21 00:49:35 +02:00
Peter Kokot f5227c5863 Move HAVE_SQLITE3_CLOSE_V2 to pdo_sqlite
Closes GH-4444
2019-07-21 00:40:59 +02:00
Remi Collet a85e4d5336 Fixed bug #78314 (missing freetype support/functions with external gd) 2019-07-20 07:57:13 +02:00
Peter Kokot 6de97402b5 Remove unused sqlite symbols
- HAVE_SQLITE3_KEY is no longer used in php-src
- SQLITE_ENABLE_COLUMN_METADATA is no longer used in php-src

Closes GH-4443
2019-07-20 00:27:10 +02:00
Peter Kokot 81fd1c5206 Fix typos in FFI
Closes GH-4438
2019-07-19 23:07:04 +02:00
Christoph M. Becker 737c1b492c Put oniguruma include path to proper CFLAGS 2019-07-19 20:04:47 +02:00
Christoph M. Becker 504cd03fc3 Move Oniguruma related config stuff to where it belongs
Oniguruma is exclusively used by ext/mbstring, and only if mbregex is
enabled.  Therefore it is unnecessary and confusing to have Oniguruma
related config stuff scattered elsewhere.

While we're at it, we also remove the referral to the bundled libonig
which is removed as of PHP 7.4.0, and the duplicated call to
`PHP_INSTALL_HEADERS()`.
2019-07-19 19:30:41 +02:00
Nikita Popov aa2e2c3f93 Merge Linux & Windows fwrite test
The test files are the same, just with a different OS check...
2019-07-19 10:59:02 +02:00
Dmitry Stogov 445d51347d Use run-time cache to avoid repeatable hash lookups in ZEND_DECLARE_CLASS_DELAYED 2019-07-19 11:46:03 +03:00
rjhdby d574df63dc Deprecate alternative array access syntax
RFC: https://wiki.php.net/rfc/deprecate_curly_braces_array_access
2019-07-19 10:06:10 +02:00
Dmitry Stogov d5943f5a11 Use run-time cache to avoid repeatable hash lookups when creating anonymous functions and classes 2019-07-19 10:43:49 +03:00
Dmitry Stogov b065fbde19 ZEND_DECLARE_ANON_CLASS doesn't need to skip anything now. It's immediatelly followed by ZEND_NEW. 2019-07-19 10:09:26 +03:00
Peter Kokot 7cbc6b6546 Remove safe_mode directive when installing ext/phar
Closes GH-4436
2019-07-19 00:02:12 +02:00
Dmitry Stogov 7cf651c39e Merge common code 2019-07-18 16:46:25 +03:00
Nikita Popov be7f405f6b Merge branch 'PHP-7.3' into PHP-7.4 2019-07-18 14:42:20 +02:00
Christoph M. Becker 55d34f7023 Remove remaining lightnings from run-tests.php
The classic Windows console only supports the Unicode BMP, so it can't
handle the LIGHTNING MOOD character (U+1F5F2).  It also seems that
common fonts do not support the LIGHTNING (U+2607) character, so a
general removal is appropriate.

However, Windows is already "ready for the future"[1], but PHP for
Windows is not (yet).

[1] <https://devblogs.microsoft.com/commandline/windows-command-line-unicode-and-utf-8-output-text-buffer/>
2019-07-18 12:15:25 +02:00
Peter Kokot bbdbc2658c Remove duplicate socklen_t check
- Use Autoconf's default AC_CHECK_TYPES

Closes GH-4418
2019-07-18 12:11:19 +02:00
Nikita Popov 562591f5eb Remove lightning
Windows is not quite ready for the future.
2019-07-18 11:16:24 +02:00
George Peter Banyard 3a5664fdfe Convert E_STRICT into E_NOTICE for htmlentities() function 2019-07-18 11:13:18 +02:00
Christoph M. Becker 3f23380361 Update NEWS and UPGRADING wrt. opcache.cache_id [ci skip] 2019-07-18 09:16:56 +02:00
Christoph M. Becker f34db7fc2a Use regedit to register event source
ext/win32std is unmaintained for years, so it is highly unlikely that
it is available.  We therefore use regedit instead to register the
event source.  We also remove the bundled syslog.reg, since it is of no
use, unless generated for the respective installation.
2019-07-18 09:10:48 +02:00
Peter Kokot b35b9eb1d6 Update changelogs 2019-07-18 02:27:14 +02:00
Peter Kokot 8db732155f Fix typo 2019-07-18 02:23:39 +02:00
Peter Kokot 359a78b16c Remove unused defines
Used in php-src the past and today removed and not used anymore:
- HAVE_CURL_EASY_STRERROR
- HAVE_CURL_MULTI_STRERROR
- HAVE_NEW_MIME2TEXT
- HAVE_MBSTR_CN
- HAVE_MBSTR_JA
- HAVE_MBSTR_KR
- HAVE_MBSTR_RU
- HAVE_MBSTR_TW

Part of oniguruma which doesn't use these anymore
- NOT_RUBY
- HAVE_STDARG_PROTOTYPES

Unused:
- HAVE_MPIR

Closes GH-4427
2019-07-18 02:21:39 +02:00
Peter Kokot 7dc6c3960b Update changelog 2019-07-18 02:18:14 +02:00
Peter Kokot 53299d610a Remove unused MISSING_MSGHDR_MSGFLAGS
Closes GH-4426
2019-07-18 02:17:14 +02:00
Peter Kokot daa243d1a0 Remove duplicate AC_PROG_CPP call
AC_PROG_CPP is already called in configure.ac.

Closes GH-4425
2019-07-18 02:14:31 +02:00
Peter Kokot fa7fbfd518 Update changelog 2019-07-18 02:13:13 +02:00
Peter Kokot 6afc3cede8 Remove unused HAVE_SHM_MMAP_ZERO and HAVE_SHM_MMAP_FILE
Closes GH-4424
2019-07-18 02:11:19 +02:00
Christoph M. Becker e2ed7e6716 Allow multiple cache instances per user/host on Windows
Formerly, there was at most a single OPcache instance per user and the
so called system ID (which is determined from the PHP version).
Sometimes multiple OPcaches might be desired, though, particularly for
unrelated CLI scripts, which may even be necessary (e.g. for our test
suite in parallel mode).

We therefore introduce a new INI directive `opcache.cache_id` which
allows to configure independent OPcache instances for the same user.

We also use `GetUserNameW()` instead of `php_win32_get_username()`,
because the latter retrieves the user name encoded in the
`default_charset`, which can obviously yield different results for
different charsets, leading to OPcache "incompatibilities".  Slightly
worse, some characters may not even be encodeable in the
`default_charset` and would be replaced by question marks, which could
result in different users sharing the same OPcache.

We also refactor, and re-use existing APIs to avoid duplicated code.
2019-07-17 19:51:07 +02:00
Christoph M. Becker 6f617b7759 Revert "Remove Windows syslog script and syslog.reg"
This reverts commit cc44bad1f6, since its
assumptions were not correct.  Actually, the classic event logging is
still used by PHP, because Windows 7 is still to be supported for a
while.  Without the respective registry entries, the event log entries
show an error message regarding missing ID descriptions.

Thanks to ab@php.net for hinting at this!

Obviously, the part depending on ext/win32std has still to be
overhauled, and further improvements are conceivable; we will address
this in due course.
2019-07-17 19:36:56 +02:00
Nikita Popov 56a2ea7aa2 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-17 15:59:22 +02:00
Nikita Popov 07a4d134ab Avoid duplicate fstat() for includes
By adding a flag to avoid forced fstat for includes. The two fstats
will happen back to back and we don't care about a possible
invalidation.

I was hoping to move this higher up in the stack and make the
ISREG check somewhere in fsizer of fixup, but this doesn't really
seem to be possible. E.g. an FP stdin handle will not be a regular
file but of course needs to be allowed. Additionally custom stream
wrappers may not implement this functionality.
2019-07-17 14:48:51 +02:00
Dmitry Stogov b30e4a5aa6 Avoid extra specialization for cold opcodes 2019-07-17 14:03:48 +03:00
Nikita Popov c2c5c9a973 Use reported fstat filesize for PHP streams 2019-07-17 11:56:00 +02:00
Nikita Popov 856c5d2837 Revert "Avoid unused fstat() call"
This reverts commit 5a90dc77b8.

Let's try to go with the reverse direction here and actually trust
the reported size...
2019-07-17 11:49:10 +02:00
Nikita Popov 5a90dc77b8 Avoid unused fstat() call
If we're including a file via PHP streams, we're not going to trust
the reported file size anyway and populate in a loop -- so don't
bother determining the file size in the first place. Only do this
for non-tty HANDLE_FP now, which is the only case where this
information was used.
2019-07-17 11:22:31 +02:00
Dmitry Stogov 6fbab09ef0 Remove old hack 2019-07-17 12:05:23 +03:00
Nikita Popov a986e70991 Avoid double buffering in Zend streams
Disable buffering in PHP streams, to avoid storing and copying the
file contents twice.

This will call stream_set_option() on custom stream wrapper as
well, so the method needs to be implemented to avoid a warning.
2019-07-17 10:40:04 +02:00
Dmitry Stogov 918f09f72a Added specialization for comparison instructions and QM_ASSIGN 2019-07-17 09:12:01 +03:00
Peter Kokot e7fcc45c43 Fix typo 2019-07-17 03:54:54 +02:00
Peter Kokot 476339646c Simplify functions checks in m4
- AC_CHECK_FUNCS already automatically defines belonging HAVE_function
  symbols and executes given shell code.
2019-07-17 03:50:47 +02:00
Dmitry Stogov ee5828205e Separate "cold" and common unspecialized code 2019-07-17 00:52:26 +03:00
Peter Kokot a520974740 Update changelog 2019-07-16 22:46:46 +02:00
Peter Kokot 63d6a2b697 Remove unused build checks
- yp_get_default_domain was part of ext/yp
- functions checks produce HAVE_function_name symbols. These checks are
  currently not used in php-src neither in the extensions out there.
- Removed symbols because they are not used in the code:
  - HAVE_GCVT
  - HAVE_PUTENV
  - HAVE_PUTENV
  - HAVE_SETVBUF
  - HAVE_TEMPNAM
  - HAVE_SIN (sin is also defined in C89 standard)
  - HAVE_SETSOCKOPT
  - HAVE_LOCKF
  - HAVE_ISASCII
  - HAVE_YP_GET_DEFAULT_DOMAIN (and other yp extension related unused checks)
  - HAVE_LINK
- HAVE_USLEEP is already defined in Windows configuration header
- HAVE_LIBBIND has not been used in php-src for a while anymore
- HAVE_GETHOSTNAME is duplicated in Windows configuration header

Closes GH-4417
2019-07-16 22:39:09 +02:00
Dmitry Stogov a6812c0c84 Provide type info 2019-07-16 22:56:20 +03:00
Nikita Popov b317f0eb59 Remove ZEND_HANDLE_MAPPED
The buf/len members are now simply used in addition to the main
stream, without changing the handle kind.
2019-07-16 17:44:32 +02:00
Nikita Popov e0eca26285 Drop free_filename field from zend_file_handle
free_filename was always zero.
2019-07-16 17:07:26 +02:00
Nikita Popov 49bac9b77b Introduce zend_stream_init_filename()
Avoid more ad-hoc initialization of zend_file_handle structures.
2019-07-16 16:44:37 +02:00
Nikita Popov 46faf8f018 Introduce zend_stream_init_fp() API
Reduce the amount of code that mucks around with zend_file_handle
initialization.
2019-07-16 16:44:37 +02:00
Dmitry Stogov 349a388b90 Slit INC/DEC opcodes into hot/cold parts and remove specialized versioins for LONG_OR_DOUBLE. 2019-07-16 17:39:25 +03:00
Nikita Popov a0f450a023 Remove unused _get_zval_ptr_cv_BP_VAR_UNSET function
To fix the macos -Werror build.
2019-07-16 15:53:55 +02:00
Nikita Popov e08cc4d921 Remove ZEND_HANDLE_FD
This handle type was unused.
2019-07-16 15:47:10 +02:00
Nikita Popov 5161cebe28 Fix bug #52752 by not using mmap() to lex files
Using mmap() is unsafe under concurrent modification. If the file
is truncated, access past the end of the file may occur, which will
generate a SIGBUS error. Even if the length does not change, the
contents may, which is a situation that the lexer certainly is not
prepared to deal with either.

Reproduce with test.php:

    <?php
    file_put_contents(__DIR__ . '/test.tpl',
        'AAA<?php $string = "' .
        str_repeat('A', mt_rand(1, 256 * 1024)) .
        '"; ?>BBB' . "\r\n");
    require_once __DIR__ . '/test.tpl';

And:

    for ((n=0;n<100;n++)); do sapi/cli/php test.php & done
2019-07-16 15:47:10 +02:00
Christoph M. Becker 292354f73a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Convert short tag to standard tag in Zend test file
2019-07-16 15:29:10 +02:00
Christoph M. Becker 20320598e5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS [ci skip]
2019-07-16 13:45:23 +02:00
Remi Collet b8ed9ac140 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  move NEWS entry [ci skip]
2019-07-16 13:00:44 +02:00
Dmitry Stogov c1b9088903 Replace deprecated conditions by ZEND_ASSERT. 2019-07-16 13:50:25 +03:00
Nikita Popov 290e520c03 Use ZEND_HASH_FOREACH APIs in a few more places 2019-07-16 12:20:16 +02:00
Nikita Popov c9acc90186 Support <?php followed by EOF
This is an annoying edge-case for canonicalization.
2019-07-16 11:53:48 +02:00
Nikita Popov ebfa05677b Merge branch 'PHP-7.3' into PHP-7.4 2019-07-16 11:11:00 +02:00
Remi Collet a91fb18da4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  next is 7.2.22
2019-07-16 10:39:24 +02:00
Nikita Popov 26977fdfdd Fix name collisions in fputcsv tests 2019-07-16 10:25:06 +02:00
Nikita Popov e2e3ddac7d Canonicalize file-names in zip tests
There were a number of name collisions in there.
2019-07-16 10:25:06 +02:00
Dmitry Stogov 1d4c38421a Delay IS_UNDEF checks 2019-07-16 11:16:45 +03:00
Dmitry Stogov 2e26b063b6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed incorrect specialization (missed IS_INDIRECT handling)
2019-07-16 01:54:22 +03:00
George Peter Banyard 548d1ec27c Small typo and proto name fix
Closes GH-4415
2019-07-15 18:15:17 +02:00
Peter Kokot 24f4dff075 Remove win32/php_stdbool.h
File usage was removed via 33fc7d77d7.

Closes GH-4411
2019-07-15 18:00:04 +02:00
Peter Kokot 59ba991b9c Remove unused files
These were introduced in 504b9beae6
and their usages were removed via
4b3e198023.

Closes GH-4410
2019-07-15 17:58:46 +02:00
Peter Kokot cc44bad1f6 Remove Windows syslog script and syslog.reg
These were used on old Windows systems before Vista and also were
used together with unmaintained win32std extension.

https://docs.microsoft.com/en-us/windows/win32/eventlog/event-logging

Closes GH-4409
2019-07-15 17:57:11 +02:00
Peter Kokot 07daf6cd62 Remove some *.dsp/*.dsw leftovers
Usage of this was removed via 4b3e198023

Closes GH-4408
2019-07-15 17:55:37 +02:00
Nikita Popov fcdb12ed4d Combine SKIP_TOKEN+RETURN_TOKEN into one macro 2019-07-15 17:29:27 +02:00
Nikita Popov c5f1b384b5 Move shebang handling into the lexer
Instead of handling shebang lines by adjusting the file pointer in
individual SAPIs, move the handling into the lexer, where this is
both a lot simpler and more robust. Whether the shebang should be
skipped is controlled by CG(skip_shebang) -- we might want to do
that in more cases.

This fixed bugs #60677 and #78066.
2019-07-15 16:25:49 +02:00
Nikita Popov 17d4e86dda Merge branch 'PHP-7.3' into PHP-7.4 2019-07-15 15:20:36 +02:00
Christoph M. Becker 37043e07df Sync mysqlnd version with PHP version
Since mysqlnd is solely developed in the php-src repository, it makes
not much sense to have its own version number, particularly since
nobody cares to update it.  Therefore we use PHP's version number, but
stick with the "mysqlnd" prefix which can be important to distinguish
the mysqli driver (libmysqlclient vs. mysqlnd).
2019-07-15 14:20:58 +02:00
Remi Collet da1816c3d3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  typo [ci skip]
2019-07-15 14:17:23 +02:00
Remi Collet c77f0506d0 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78269 password_hash uses weak options for argon2
  Fix #78269 password_hash uses weak options for argon2
2019-07-15 14:11:57 +02:00
Nikita Popov d60d16bda6 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-15 13:49:29 +02:00
Nikita Popov 9ad094e371 Emit T_BAD_CHARACTER for unexpected characters
Avoid having holes in the token stream which are annoying and
inefficient to reconstruct on the consumer side.
2019-07-15 12:51:01 +02:00
Sebastian Pop af7639683f vectorize string-escape with NEON
On this benchmark:
function simple_string_escape() {
    $a = "test'asd'asd'' asd\'\"asdfasdf";
    for($i=0; $i<512; $i++) {
        $a .= chr($i%256);
    }
    for ($i = 0; $i < 100000; $i++) {
        if ($a === stripslashes(addslashes($a)))
            $a .= chr($i%256);
        else {
            echo "error at i=".$i."\n";
            return;
        }
    }
}
the execution time goes from 21.619s to 8.139s (165% speedup) on an A1 Graviton instance.

When removing the characters that need escaping, i.e., this benchmark:
function simple_string() {
  $a = "testasdasd asdasdfasdf";
  for ($i = 0; $i < 10000; $i++) {
      if ($a === stripslashes(addslashes($a)))
          $a .= "test dedeasdf";
      else {
          echo "error at i=".$i."\n";
          return;
      }
  }
}
the execution time goes from 2.932s down to 0.516s (468% speedup) on an A1 Graviton instance.
2019-07-15 11:35:08 +03:00
Nikita Popov a520c24269 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-15 10:29:37 +02:00
Peter Kokot 93b3d2f6ee Remove usage of PHP_AIX_LDFLAGS
These are currently not defined since their usage has been removed via
51ca2dba53
and
53349d69dd
2019-07-14 23:44:01 +02:00
Peter Kokot 94421e5724 Remove conditional calls of always available macros
These checks were once relevant for these extensions in PECL and PHP
versions without availability of the checked macros.

Closes GH-4405
2019-07-14 22:24:21 +02:00
Peter Kokot e39296d10b Remove unsed zts check for sqlite3
This check was relevant with bundled sqlite library. Removed via
6083a387a8

Closes GH-4403
2019-07-14 21:06:15 +02:00
Peter Kokot 66c02cc0a1 Remove duplicate PTHREADS template define
The undef PTHREADS converts to define if thread safety is configured.
This step is already done by pthreads m4 macros from TSRM so this now
removes duplicated PTHREADS defines from php_config.h.
2019-07-14 14:45:27 +02:00
Peter Kokot c72d6da461 Remove timelib outdated defines
- TIMELIB_OMIT_STDINT is not used anymore since
  https://github.com/derickr/timelib/commit/a171f99cf02baf39549ab7209e37565b8b8f6529
- HAVE_GETTIMEOFDAY was defined multiple times in Windows headers
- ext/date/lib/timelib_config.h.win32 does not seem to be used

Closes GH-4400
2019-07-14 13:50:05 +02:00
Peter Kokot 7a6d737de7 Remove PHP_MYSQL variable
PHP_MYSQL variable was once defined by the ext/mysql (--with-mysql).

Closes GH-4399
2019-07-14 13:48:44 +02:00
Peter Kokot f573ba1948 Update changelogs
- PHP-7.4 alpha, beta, RC versions already include bugs logged in the
  NEWS
- some links to RFCs
- php_error_docref0
2019-07-13 15:37:36 +02:00
Peter Kokot 4e0af6d862 Remove php_multiple_shlib_versions_ok
Variable usage was removed via
913cec6551
2019-07-13 15:06:35 +02:00
Peter Kokot f3cf8966be Remove unused recode extension artefacts
Closes GH-4395
2019-07-13 14:52:36 +02:00
Peter Kokot f5e4771824 Remove checks for always enabled spl and pcre
Closes GH-4397
2019-07-13 14:47:37 +02:00
Peter Kokot 499f2ac132 Remove WARNING_LEVEL fix for QNX
Fix is no longer relevant since the environment variable WARNING_LEVEL
is no longer used to define the value of the -w option for cc.

Closes GH-4398
2019-07-13 14:39:29 +02:00
Christoph M. Becker 8c76d898a9 Fix #78283: no output for explicit environment
This test does not work on Windows, if the child process has OPcache
enabled via php.ini, since TEMP is not set in the environment, so
OPcache can't find the base address file, and terminates the childs.

To avoid this (and potentially some other issues regarding missing
environment variables, such as PATH), we force the child process to
ignore any ini files.
2019-07-13 12:03:03 +02:00
Christoph M. Becker bf242d58e7 Fix #78282: atime and mtime mismatch
The fix for bug #78241 assumed that `time_t` would always be 64bit, but
actually is 32bit for x86.  We therefore enforce 64bit arithmetic to
avoid wrapping.
2019-07-13 09:44:46 +02:00
George Peter Banyard 1c1de0c41a Convert all php_error_docref0 to php_error_docref
Closes GH-4394
2019-07-13 02:05:17 +02:00
Peter Kokot 33994ebd95 Remove tsrm_config_common.h
- Checks and defines are not relevant for files that include it anymore
- Some code is not used anymore
- Defines are a bit duplicated in zend_portability.h and TSRM.h file
- MAXPATHLEN defs moved to zend_virtual_cwd.h
2019-07-13 01:58:01 +02:00
Christoph M. Becker a6fa097ceb No more need to cater to pre-PHP-5.3 or PHP-6 versions 2019-07-12 18:55:34 +02:00
Nikita Popov 0d568b9fd5 Don't split T_INLINE_HTML at partial PHP tag
If <?php occurs without required trailing whitespace, we should keep
it as part of a single T_INLINE_HTML region.
2019-07-12 17:22:11 +02:00
Nikita Popov 79b5b1a97f Merge branch 'PHP-7.3' into PHP-7.4 2019-07-12 16:51:52 +02:00
Nikita Popov 608f2112e9 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-12 16:30:47 +02:00
Christoph M. Becker 76783a9bcc Update NEWS and UPGRADING wrt. ext/recode unbundling 2019-07-12 14:35:44 +02:00
Christoph M. Becker 58b607c9ea Removed ext/recode
Cf. <https://wiki.php.net/rfc/unbundle_recode>.
2019-07-12 13:58:17 +02:00
Christoph M. Becker 8aa7865997 Swap implode() argument order in the test helper 2019-07-12 13:26:54 +02:00
Nikita Popov e2c3bc80e3 Remove duplicate XtOffsetOf() definitions in php.h
These are already defined in zend_portability.h.
2019-07-12 13:18:18 +02:00
Nikita Popov 709897c2a5 Remove unused tsrm_strtok_r() function
There is also a php_strtok_r() function, which is actually used,
but nothing uses the tsrm_strtok_r() variant...
2019-07-12 13:14:24 +02:00
Nikita Popov 94d37a5dd7 Remove unnecessary uses of allow_url_include in tests 2019-07-12 12:54:34 +02:00
Nikita Popov 9345c191db Remove unnecessary uses of restore_include_path() in tests 2019-07-12 12:54:26 +02:00
Nikita Popov 2e56e14e39 Swap implode() argument order in some tests 2019-07-12 12:54:10 +02:00
Nikita Popov 9a274de4f4 Improve bless_tests
If a string var_dump contains a wildcard, also make the length a
wildcard.
2019-07-12 12:54:01 +02:00
Dmitry Stogov 0793af0673 Use common code for double math 2019-07-12 11:40:56 +03:00
Christoph M. Becker d0d02ecc4e Revert "Temporarily skip test"
This reverts commit 4e5a717866.

As of commit 17f7fb7605 the test should
no longer hang.
2019-07-11 23:33:34 +02:00
Dmitry Stogov 350f2212ff Allow GOTO style helpers in HYBRID VM 2019-07-12 00:00:55 +03:00
Dmitry Stogov ef1a1a0698 Separate "cold" parts of comparison instructions 2019-07-11 20:44:39 +03:00
Dmitry Stogov be94c0c3c6 Separate "cold" parts of binary op instructions 2019-07-11 18:23:08 +03:00
Nikita Popov 59852c0321 Remove redundant 64-bit ezmlm_hash() test
This test is the same as the as ezmlm_hash_basic.phpt. This function
does not behave differently on 32-bit and 64-bit.
2019-07-11 17:09:18 +02:00
Nikita Popov cbda1b1c6a Add ZEND_DEP_ME macro 2019-07-11 17:09:03 +02:00
George Peter Banyard e6c2b28865 Convert short tag to standard tag in Zend test file
Closes GH-4389.
2019-07-11 16:20:05 +02:00
Nikita Popov 17f7fb7605 Switch to using shell-less proc_open() in various server tests 2019-07-11 15:48:10 +02:00
Nikita Popov 6285bb52fa Support redirect+null descriptors in proc_open
This adds support for doing something like:

    [1 => ['pipe', 'w'], 2 => ['redirect', 1]]

This will make descriptor 2 on the child end a dup'd descriptor 1.
This is mainly useful in conjunction with shell-less mode, because
we don't have an easy way to do "2>&1" there.

Additionally we support:

    [1 => ['pipe', 'w'], 2 => ['null']]

Which would be the same as a >/dev/null or >nul redirect, depending
on platform.
2019-07-11 15:48:10 +02:00
Nikita Popov 42cac9d7d7 Don't call Reflection::export() internally
export() methods were implemented in a roundabout way, where they
would call Reflection::export(), which would then call __toString().
Cut out the middleman by directly calling __toString().
2019-07-11 14:14:55 +02:00
Christoph M. Becker 17997a908d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78212: Segfault in built-in webserver
2019-07-11 13:11:08 +02:00
Nikita Popov c02dfddda3 Include test name in JUnit testcase name
Azure does not show the classname attribute in any convenient way,
and the file name is the part we usually care about.
2019-07-11 12:46:56 +02:00
Nikita Popov d20fc5a192 Make proc_open_bug64438.phpt more robust
The test currently assumes that we'll first read the data of
stdout and stderr and then see eof on stdout and stderr. However
we could also read stdout, see eof on stdout, read stderr and see
eof on stderr, depending on timing.

Avoid output ordering issues by collecting events into a per-pipe
array, so interleaving is not visible.
2019-07-11 12:46:56 +02:00
Sebastian Pop 3b73c9fb86 neon vectorization for base64
A similar algorithm is used to vectorize on x86_64, with a good description in
https://arxiv.org/abs/1704.00605 . On AArch64 the implementation differs in that
instead of using multiplies to shift bits around, it uses the vld3+vst4 and
vld4+vst3 combinations to load and store interleaved data.  This patch is based
on the NEON implementation of Wojciech Mula:
https://github.com/WojciechMula/base64simd/blob/master/encode/encode.neon.cpp
https://github.com/WojciechMula/base64simd/blob/master/encode/lookup.neon.cpp
and
https://github.com/WojciechMula/base64simd/blob/master/encode/encode.neon.cpp
https://github.com/WojciechMula/base64simd/blob/master/encode/encode.neon.cpp
adapted to php/ext/standard/base64.c and vectorized with factor 16 instead of 8.

On a Graviton A1 instance and on the synthetic benchmarks in
https://github.com/lemire/fastbase64 I see 175% speedup on base64 encoding and
60% speedup on base64 decode compared to the scalar implementation.

The patch passes `make test` regression testing on aarch64-linux.
2019-07-11 12:04:29 +03:00
Sebastian Pop 2a535a9707 [AArch64] Use crc32 instructions when available
The time goes from 0.838s down to 0.029s (a 28x speedup) on a Graviton A1
instance and the following benchmark:

function simple_crc32() {
  $a = "foo";
  for ($i = 0; $i < 10000; $i++) {
      crc32($a);
      $a .= "o".$i;
  }
}
2019-07-11 10:29:45 +02:00
Nikita Popov ba8c4894d8 Add server conflict to soap custom content type test 2019-07-11 10:26:53 +02:00
Peter Kokot a6daded1a4 Refactor undefining PACKAGE_* symbols
Instead of patching configuration headers template generated by
the given tools - autoheader, this moves patching these symbols to
the configure step before creating and invoking the config.status
and before the configuration header file is generated from the
patched template.

Closes GH-4374
2019-07-11 02:00:51 +02:00
Peter Kokot d63fdced2e Remove TSRM/tsrm_config.w32.h
The tsrm_config.w32.h file is a simple wrapper for already defined
symbols and includes elsewhere.

Closes GH-4383
2019-07-10 21:19:44 +02:00
Dmitry Stogov 0e3d4911fa Set expectation to reduce hot code fragmentation 2019-07-10 18:29:35 +03:00
Nikita Popov a54ee8a947 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-10 17:28:37 +02:00
Cyril Pascal 6791107319 Align segments on huge page boundary only for x86
Closes GH-4387.
2019-07-10 15:19:24 +02:00
Nikita Popov ee18687f97 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-10 13:10:07 +02:00
Nikita Popov 07bbc54658 Fix file collisions in phar tests 2019-07-10 12:55:40 +02:00
Nikita Popov 852e35317d Additional fix for mysqli_fork test 2019-07-10 12:42:17 +02:00
Nikita Popov c42b7dd6d3 Throw notice on array access on illegal type
No notice is thrown for list() accesses, because we did not come
to an agreement regarding patterns like

    while ([$key, $value] = yield $it->next()) { ... }

where silent null access may be desirable.

No effort is made to suppress multiple notices in access chains
likes $x[0][0][0], because the technical complexity this causes
does not seem worthwhile.

RFC: https://wiki.php.net/rfc/notice-for-non-valid-array-container
2019-07-10 12:02:14 +02:00
Nikita Popov a63422029e Fix invalid array access in mysqli_fork test 2019-07-10 11:59:27 +02:00
Dmitry Stogov d57d74b271 Reduce cost for references to strings and resources 2019-07-10 12:27:59 +03:00
Nikita Popov 2bca35eacc Rename support_strings to !is_list
In preparation for more behavior that depends on whether it it is
a list() access. Using support_strings for that would be
confusing.
2019-07-10 11:10:17 +02:00
Nikita Popov 0c450967e1 Simplify two unserialize() tests
unserialize() returns false for these now, so it doesn't make sense
to try and do something with the result.
2019-07-10 11:09:54 +02:00
Nikita Popov a207b3574b Fix iteration limits in SXE test
Test doesn't look like it's specifically testing out of bounds
access, just two different iteration patterns, so make sure the
limits are correct.
2019-07-10 11:09:47 +02:00
Nikita Popov 9d82a01d01 Clean up DateTimeZone::getLocation() test
And avoid invalid array access.
2019-07-10 11:09:41 +02:00
Nikita Popov dfe5fd2a37 Avoid invalid array access in fcgi.inc 2019-07-10 11:09:34 +02:00
Remi Collet db0eaa8cf1 improve libargon2/libsodium compatibility 2019-07-10 09:00:41 +02:00
Peter Kokot 48abed7fd8 Use e.g. instead of less common f.e. [ci skip] 2019-07-09 17:53:46 +02:00
Sara Golemon f65956e4fb Relax argon2 mem_cost down to 64k, bump time_cost to 4 2019-07-09 11:36:48 -04:00
David Carlier aa0e29a668 CGI: Fix memory leak on error paths 2019-07-09 16:19:41 +02:00
Dmitry Stogov 8f0c87e1b6 Avoid unintended inlining 2019-07-09 14:01:48 +03:00
Nikita Popov ba05b2c6b0 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-09 11:05:54 +02:00
Derick Rethans 432ad35b55 Merge remote-tracking branch 'origin/PHP-7.4' into PHP-7.4 2019-07-09 09:14:01 +01:00
Christoph M. Becker 726c07e9af Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Upgrade to SQLite 3.28.0
2019-07-09 10:08:09 +02:00
Dmitry Stogov e1f418dd18 Remove duplicated code for (PRE|POST)_DEC_(OBJ|STATIC_PROP) opcodes 2019-07-09 10:46:04 +03:00
Derick Rethans 086b476c27 Update NEWS for 7.4.0beta1 2019-07-09 07:41:09 +00:00
Derick Rethans 3fd7c478a5 Update NEWS for PHP 7.4.0alpha3 2019-07-09 07:39:49 +00:00
Peter Kokot d094ca83df Catch up with current procedures
- Git is used for moving existing extensions to PECL
- PHP versions with the PHP 7.4 examples
- Some minor tweaks here and there
- Mention re2c also
- Mention Docker image as a helper tool
2019-07-08 23:28:02 +02:00
Peter Kokot 5017676438 Add zend.exception_ignore_args [ci skip] 2019-07-08 19:34:47 +02:00
Peter Kokot e180290a1e Update NEWS [ci skip] 2019-07-08 18:50:59 +02:00
Peter Kokot fa37cfe8cc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS [ci skip]
  Update NEWS [ci skip]
2019-07-08 18:49:15 +02:00
Dmitry Stogov 1804fd634e Fixed dispatch from inlined hybrid opcode to another opcode 2019-07-08 18:01:46 +03:00
Nikita Popov 428cfdd181 Add ReflectionReference::getRefcount()
And don't return null for rc=1 references. Leave it to the user
to decide whether or not they want to consider these as references
or not.

Fixes bug #78263.
2019-07-08 16:54:03 +02:00
Peter Kokot 0f0c6c617f Catch up with recent changes [ci skip]
- RFC about password_hash portability improvements added
- build system minor updates noted
- typos
2019-07-08 16:23:27 +02:00
Peter Kokot 4b864c2ebb Remove APACHE symbol
The APACHE symbol was used in very early PHP versions to indicate the
Apache module usage. Since PHP 4 this is no longer used in the code.
2019-07-08 15:05:54 +02:00
Peter Kokot 900de30b0f Refactor genif.sh
Changes:
- Coding style fixes
- ${1+"$@"} replaced with "$@" [1]
- EXTRA_MODULE_PTRS variable is not used anymore
- awk tool defined via environment variable
- srcdir determined automatically from the genif.sh location

[1] https://www.in-ulm.de/~mascheck/various/bourne_args/

Closes GH-4372
2019-07-08 14:58:26 +02:00
Nikita Popov 392398bfe6 Make busy wait busier
Another stab in the dark to fix the intermittent failures of timeout
tests on macos CI: We're using ITIMER_PROF, which means that the
timer counts against user+system time. The "busy" wait loop counts
against real time. Currently it calls microtime() on every iteration.
If that call is implemented as a syscall rather than going through
vDSO or commpage we might be seeing many context switches here which
drive up the real time, but not user or system time.

See if making the loop busier and calling microtime() less helps the
situation.
2019-07-08 13:35:29 +02:00
Dmitry Stogov 9a833438d1 Delay EG(exception) check on slow path 2019-07-08 13:56:34 +03:00
Scott Dutton d90cdbd9df Deprecate passing invalid character to base_convert etc
RFC: https://wiki.php.net/rfc/base_convert_improvements
2019-07-08 12:49:21 +02:00
Peter Kokot 550c2aa89b Remove C89 checks for signal.h and strerror
These are part of the C89 and on today's systems not needed to be
checked anymore. This removes symbols HAVE_SIGNAL and HAVE_STRERROR.

- http://port70.net/~nsz/c/c89/c89-draft.html
- locale.h is also part of C89 but will be removed per request in PHP 8
2019-07-08 12:46:51 +02:00
Peter Kokot f002761e08 Update libmagic patch
This simplifies the libmagic patch:
- in upstream the HAVE_STRERROR check has been removed
- in upstream library the HAVE_SIGNAL_H has been removed
- indentations syncs with the upstream library
- some irrelevant changes removed from the patch (log comment), upstream
  has this correctly logged already so no need to patch the comment.

Closes GH-4298
2019-07-08 12:38:47 +02:00
Christoph M. Becker 338e1b245d Implement FR #77230: Support custom CFLAGS and LDFLAGS from environment
While it is already possible to *set* CFLAGS and LDFLAGS (actually all
variables) from the environment for `nmake` (by passing the `/E`
option), it is not possible to *add* any (C|LD)FLAGS, which can be
useful in some cases.  Instead of allowing this for `nmake`, we add
support for additional custom (C|LD)FLAGS to `configure`, similar to
how that works on Linux, so one could actually write:
````
set CFLAGS=foo & set LDFLAGS=bar & configure
````
This also allows us to use these flags during configure.
2019-07-08 10:46:51 +02:00
Christoph M. Becker 98b6330ab4 Fix TsHashTable related race conditions
Although TsHashTable and the according API are supposed to easily make
a HashTable thread-safe, they do not; for instance, there can be race
conditions between finding and updating entries.  We therefore avoid
the usage of TsHashTable in favor of a HashTable with our own mutex
management.

The patch has been provided by krakjoe@php.net; I only did some minor
fixes and tweaks.
2019-07-08 10:31:36 +02:00
Peter Kokot a39ea91753 Simplify PHP_CHECK_PDO_INCLUDES calls
Conditional checks were once used for backwards compatibility with
phpize from PHP versions that didn't have this macro call yet.

Closes GH-4376
2019-07-08 10:24:41 +02:00
Dmitry Stogov 1305d9c0d2 Fixed opcode description 2019-07-08 11:20:46 +03:00
Peter Kokot 5ba69ab3ad Remove some unused variables
- Variables php_abs_top_srcdir php_abs_top_builddir are no longer used.
- ZEND_EXT_TYPE is always zend_extension and variable is no longer used.

Closes GH-4378
2019-07-08 10:18:17 +02:00
Sara Golemon 0ba1db7a4a Provide argon2i(d) password hashing from sodium when needed 2019-07-07 21:53:43 -04:00
Stanislav Malyshev 57e7c3aac1 Simplify expression and remove the possibility of div by 0
Maybe should use exp2() but not sure about how supported it is.
2019-07-07 16:16:05 -07:00
Peter Kokot 3bde4838f4 Remove PHP_DEBUG_MACRO
The macro is no longer used. The warning at the end of the configure
script therefore is also no longer used.
2019-07-07 12:15:36 +02:00
Peter Kokot 49cc2a63b3 Remove some more Apache 1 left overs
- warning in configure.ac is relevant for the sapi/apache
- errors output redirected to /dev/null when checking Apache version
2019-07-07 12:09:19 +02:00
Nikita Popov 7514b5d91c Mention that zend_parse_parameters should not be tested
Also mention that --CREDITS-- section should not be included
anymore. We should also change qa.php.net to stop advertising
these.

[ci skip]
2019-07-07 11:24:26 +02:00
Peter Kokot 539b577827 Move footer to the end of configure output 2019-07-06 01:00:24 +02:00
Peter Kokot 1c9e8e8f6a Remove PTHREADS_ASSIGN_VARS
This simplifies TSRM build steps a bit and avoids doing unnecessary
steps:
- The `PTHREADS_CHECK_COMPILE` can called inside the for loops only
  since this is only where the `$pthreads_checked` variable is used.
- Assigning variables can be then done only in the configure.ac
  once.
- use `m4_include()` instead of the `sinclude()` in the middle of
  the build steps.
- The `$threads_result` variable is not used in the code or in
  extensions.
2019-07-05 23:26:20 +02:00
Christoph M. Becker 30441e65dd Remove superfluous assignment 2019-07-05 15:56:26 +02:00
Dmitry Stogov 55f7d3b70a Eliminate useless checks 2019-07-05 14:21:18 +03:00
Christoph M. Becker 4e5a717866 Temporarily skip test
This test hangs on Windows for ~10 minutes as of commit 30019f4, so we
temporarily skip it.  The issue will be investigated by Joe and myself
in due course.
2019-07-05 12:48:10 +02:00
Nikita Popov 201673d1a6 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-05 12:07:45 +02:00
Nikita Popov 73fd2da754 Make sure all cases of fetch_dim_w adjustment are handled
Use EMPTY_SWITCH_DEFAULT_CASE() to trigger an assertion in case
we miss something.

Add missing FE_RESET_RW case.
2019-07-05 12:02:26 +02:00
Nikita Popov 1086198711 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-05 11:41:57 +02:00
Nikita Popov ea86a9209c Optimize integer in_array with strict=true
It doesn't make sense that using in_array with strict=false is
much faster for this case, due to lack of a specialized codepath.
2019-07-05 11:20:29 +02:00
Dmitry Stogov 48ca5a1e17 Replace ZEND_ASSIGN_ADD (and others) by ZEND_ASSIGN_OP, ZEND_ASSIGN_DIM_OP, ZEND_ASSGIN_OBJ_OP and ZEND_ASSIGN_STATIC_PROP_OP 2019-07-05 12:03:25 +03:00
Nikita Popov 24ecfcc833 Add test
Forgot to commit this.
2019-07-05 11:00:27 +02:00
Nikita Popov ea43624972 Fix wrong size calculation related to function name
It would be nice if we could drop this manual function name reuse
code altogether and rely on interning for it.
2019-07-05 10:46:41 +02:00
Nikita Popov d3c4841b18 Preloading: Don't move conditional functions to back to scripts
Conditional function declaration may be referenced by functions or
classes that have been preloaded, so we should not move them back
to scripts.

What we probably should be doing though is to discard conditional
functions that are not used in the optimizer. This is probably
reasonably common for polyfills, where we will be able to const-eval
the conditions and drop the BBs declaring the functions, but won't
delete the function declarations themselves.
2019-07-05 10:46:41 +02:00
George Wang 6a403504e7 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-04 12:14:48 -04:00
Nikita Popov a0e7624059 Compact literals: Don't insert unmergeable keys
LITERAL_VALUE with related literals cannot be merged, avoid inserting
them in the literals hash in the first place. Otherwise we may end up
inserting the same key multiple times. We may also miss merging
opportunities due to the duplicate keys.
2019-07-04 17:12:55 +02:00
Nikita Popov 6a9127c100 Assert that HT entries using add_new APIs are really new 2019-07-04 17:12:55 +02:00
Dmitry Stogov ef05eab432 Improve zend_binary_assign_op helpers.
Reorder opcode numbers to make ADD-POW and ASSIGN_ADD-ASSIGN_POW opcodes sequencional.
2019-07-04 17:25:43 +03:00
Dmitry Stogov 925fd0fe6f Introduce and use ZEND_VM_INLINE_HANDLER() to avoid ZEND_RETURN exception 2019-07-04 15:54:45 +03:00
Christoph M. Becker 27e1a95098 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Remove NEWS entry
2019-07-04 14:50:51 +02:00
Christoph M. Becker 976a323ab8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix typo in NEWS [skip ci]
2019-07-04 14:44:38 +02:00
Nikita Popov b250f89b92 Preloading: Relax known type restrictions
Check whether there is a parent/interface/trait method with the same
name and only then require the type to be known. This reduces the
number of cases where this triggers in practice a lot.
2019-07-04 12:20:32 +02:00
Nikita Popov 4a2646cf45 Preloading: Also handle trait methods outside main script 2019-07-04 12:20:31 +02:00
Dmitry Stogov e3d35b6434 Split destructor 2019-07-04 13:07:47 +03:00
Nikita Popov df243f19be Preloading: Prevent autoloading while resolving constants 2019-07-04 11:05:01 +02:00
Nikita Popov 1fea887cc0 Set PROPERTY_TYPES_RESOLVED flag for internal classes
Also make sure that the resolution happens before preloading runs.
2019-07-04 10:32:36 +02:00
Dmitry Stogov 09041151de Better optimization in RELEASE build. ZEND_ASSERT(s) prevented optimization 2019-07-03 20:19:56 +03:00
Joe Watkins 87249091d5 Merge branch 'php-cli-server-improvements' into PHP-7.4
* php-cli-server-improvements:
  improvements to cli server
2019-07-03 16:31:40 +02:00
Joe Watkins 30019f47a5 improvements to cli server 2019-07-03 16:30:51 +02:00
Nikita Popov f857648270 Improve unlinked class diagnostics during preloading 2019-07-03 14:05:10 +02:00
Nikita Popov d6d9024cb8 Avoid use of random ports in some socket tests 2019-07-03 12:47:49 +02:00
Nikita Popov a023eb3967 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-03 12:37:12 +02:00
Nikita Popov 959c84b249 Remove curl_basic_017.phpt
The output of the three handles may be interleaved. We already have
curl_basic_018.phpt which uses curl_multi_getcontent() and thus
has predictable output. As such, I'm dropping this test altogether.
2019-07-03 11:38:24 +02:00
Nikita Popov 6dd4cccef8 Fix file conflict in fgets test 2019-07-03 11:27:02 +02:00
Nikita Popov aff0b77d15 Skip pcntl_sigwaitinfo() test under asan/msan
This test often fails under asan/msan with a timeout for unknown
reasons.
2019-07-03 11:03:27 +02:00
Nikita Popov 2bf880db2c Fixed bug #78239 2019-07-03 11:00:12 +02:00
Nikita Popov c0924cf67d Merge branch 'PHP-7.3' into PHP-7.4 2019-07-03 10:20:32 +02:00
Christoph M. Becker b4c81be9c5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78241: touch() does not handle dates after 2038 in PHP 64-bit
2019-07-03 10:03:14 +02:00
Dmitry Stogov 56b8b165f8 Optimization of INC/DEC helpers 2019-07-03 10:33:03 +03:00
Pieter Hordijk 6ab04a6eef Removed mysqlnd stats from phpinfo page
All information can already be retrieved using the APIs at https://www.php.net/manual/en/mysqlnd.stats.php. Closes https://bugs.php.net/bug.php?id=60594
2019-07-03 08:20:54 +02:00
Peter Kokot a45192e183 Enable option checking on CI
This adds the Autoconf's --enable-option-checking=fatal option so
when non existing option from the PHP's configure options is used
a fatal error happens.
2019-07-03 08:16:31 +02:00
Peter Kokot 6f558c9508 Remove libtool and automake from azure installs
These two deps are not needed to build PHP.
2019-07-03 08:14:07 +02:00
Peter Kokot 16df718251 Remove PHP_CHECK_CONFIGURE_OPTIONS
Instead of building a custom macro for checking configure options,
Autoconf 2.62+ already outputs a warning at the beginning and the end
of the output of configure script. It automatically detects correct
and wrong options better.

This is related also to bug #55634.

So now instead a better way is the default Autoconf approach:

This outputs a warning at the beginning and end of the configure output:

    ./configure --with-non-existing

This results in fatal error:

    ./configure --non-existing

    configure: error: unrecognized option: `--non-existing'
    Try `./configure --help' for more information

The `--enable-option-checking=fatal` results in fatal error for all non
existing options:

    ./configure --with-non-existing --enable-option-checking=fatal

    configure: error: unrecognized options: --with-non-existing

Closes GH-4348
2019-07-02 22:15:24 +02:00
Peter Kokot b1ef50091d Remove some old BeOS artefacts
- checking for beos systems is no longer relevant in configure.ac
- usage of undefined constant BETHREADS removed.

Closes GH-4346
2019-07-02 22:08:54 +02:00
Peter Kokot 534351c014 Remove check for ApplicationServices/ApplicationServices.h
The symbol HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H is not used
and check not needed.

Closes GH-4336
2019-07-02 22:05:00 +02:00
Jan Altensen f8788eb7f3 azure: exclude some documentation paths
Closes GH-4352.
2019-07-02 16:22:01 +02:00
Nikita Popov 1c8988c5f3 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-02 16:12:36 +02:00
Christoph M. Becker db72a19ed4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix NEWS
2019-07-02 15:09:27 +02:00
Joe Watkins 0819e6dc9b simple ignore arguments in exceptions implementation 2019-07-02 13:18:39 +02:00
Robert Kopack b546ae986a Implement SQLite extended result code functionality 2019-07-02 13:03:35 +02:00
SjonHortensius 615ce0b099 update NEWS [ci skip]
add #2684
2019-07-02 12:32:42 +02:00
Nikita Popov 4a08885ed9 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-02 12:28:46 +02:00
Sjon Hortensius a7881df281 PDO: support username & password specified in DSN 2019-07-02 12:09:38 +02:00
David Carlier 7f1fef9fe0 Fix opcache huge page mapping on FreeBSD
Too much room were given process mappings and were not unmapped.

Closes GH-4345.
2019-07-02 11:59:08 +02:00
Nikita Popov 03846afdf7 Fix clang build 2019-07-02 10:16:55 +02:00
Nikita Popov 1e06a8ef95 Update proto comment for proc_open 2019-07-02 10:10:51 +02:00
Nikita Popov b88ef3dc58 Remove unused (module|request)_shutdown_for_exec 2019-07-02 10:10:51 +02:00
Dmitry Stogov baa883d3fc Fixed build without global register variables 2019-07-02 11:03:22 +03:00
Dmitry Stogov cbbd473bdd Separate slow code 2019-07-02 01:16:34 +03:00
Dmitry Stogov 2d4bb4f44a Use string destructor instead of general zval_ptr_dtor_nogc() 2019-07-02 01:14:33 +03:00
Dmitry Stogov f58c645dcc Eliminate exception checks 2019-07-02 01:11:41 +03:00
Christoph M. Becker 52a0630cd4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add missing SKIPIFs
2019-07-01 18:13:52 +02:00
Nikita Popov 0dfca74be2 Setup msan on azure
This uses a separate job template, because msan requires all used
libraries (apart from glibc) to be instrumented, so we can't link
any external libraries unless we recompile them. As such, we need
a much more minimal configure.
2019-07-01 17:27:42 +02:00
Nikita Popov 59522c5a85 Generate less code in compile time binary op test
Don't generate try {} blocks for the operations that don't throw.
2019-07-01 17:27:42 +02:00
Nikita Popov 7acc828abf Skip perf-sensitive fileinfo tests 2019-07-01 17:27:42 +02:00
Christoph M. Becker 42bedcfb50 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add missing SKIPIFs
2019-07-01 17:24:33 +02:00
David Carlier 994a01ea43 opcache huge pages: Little fix for FreeBSD
Calculating the vm entries size beforehand, as we could
possibly miss few entries.

Closes GH-4344.
2019-07-01 16:55:23 +02:00
Christoph M. Becker 237f07ea9d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix brittle test
2019-07-01 16:44:54 +02:00
Nikita Popov af3e2d3186 Initialize last_line in phpdbg globals 2019-07-01 16:14:45 +02:00
Dmitry Stogov f2b6b2eee8 Micro-optimization 2019-07-01 16:57:25 +03:00
Dmitry Stogov 39a0854307 Fixed GOTO VM 2019-07-01 15:50:53 +03:00
Peter Kokot 30c1c53164 Remove TSRM_BASIC_CHECKS
This macro is not needed anymore. The AC_PROG_CC is done in the main
configure.ac file and the ranlib check is done by the bundled libtool
macros.

Closes GH-4339
2019-07-01 13:23:41 +02:00
Peter Kokot e558ee7999 Remove not needed checks for functions
The following functions don't need to be checked anymore since the
they are not used across the code or the symbols aren't used anymore:
- cuserid (not used)
- lrand48 (not used and removed via
  6d6ef7aacc)
- random (check is not used)
- srand48 (not used)
- srandom (not used)
- strdup (check is not used)

and the unused check symbols:
- HAVE_CUSERID
- HAVE_LRAND48
- HAVE_RANDOM
- HAVE_SRAND48
- HAVE_SRANDOM
- HAVE_STRDUP

Closes GH-4338
2019-07-01 13:21:28 +02:00
Peter Kokot c70d9cdb11 Remove unused check for struct cmsghdr
The result of this check is to whether to define the HAVE_CMSGHDR symbol
or not. The HAVE_CMSGHDR is never used in the code and it has been
removed via 90289924c0.

Closes GH-4337
2019-07-01 13:13:51 +02:00
Nikita Popov 01e1e1991d Clarify #if indentation in time limit implemementation 2019-07-01 12:18:21 +02:00
Nikita Popov 83ee7b4c07 Run file_put_contents_variantion8 in separate directory
There are other tests that try to read these files.
2019-07-01 11:54:05 +02:00
Nikita Popov 7defd5f69c Fix unused variable warnings when mbregex disabled 2019-07-01 11:14:35 +02:00
Nikita Popov da06f7f383 Msan: Unpoison buffer written by file cache
It would be great if this were fully initialized, but it's not
really a problem either (as long as we don't care about reproducible
file cache), so ignore this for now.
2019-07-01 11:14:28 +02:00
Nikita Popov c8af6a7fa7 Don't use fast_memcpy under msan 2019-07-01 11:14:23 +02:00
Nikita Popov 7e6db70064 Msan: Unpoison getrandom() syscall result 2019-07-01 11:14:17 +02:00
Nikita Popov 5c0a9a4096 Add some tolerance to time_sleep_until() test
This has been sporadically failing on macos for a while. We've tried
a couple of things (using int arithmetic, normalizing to gettimeofday),
but this issue remains. I'm adding some tolerance to the test to
avoid CI failures.
2019-07-01 09:43:16 +02:00
Nikita Popov 736172d23d Disable RTLD_DEEPBIND under memory sanitizer
This was already done for address sanitizer.
2019-07-01 09:37:34 +02:00
Peter Kokot 3c472909c0 Update NEWS [ci skip] 2019-07-01 03:10:09 +02:00
Peter Kokot ec8bf3bc97 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS [ci skip]
2019-07-01 02:55:02 +02:00
Peter Kokot 6363f7a0c1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78197: PCRE2 version check
2019-07-01 02:53:10 +02:00
Peter Kokot aeaee62d92 Update changelogs [ci skip] 2019-07-01 01:35:29 +02:00
Peter Kokot 9a3c8e51e3 Sync functions checks
Removed unused checks:
- mbsinit check removed, HAVE_MBSINIT removed (not used in php-src)
- mempcpy check removed, HAVE_MEMPCPY removed (not used in php-src anymore since
  560ed89bfb which uses PHP's own implementation)
- strpncpy check removed, added via a8c9e893b6 and
  not used.
- setpgid check removed since HAVE_SETPGID is not used

Moved to a central configure.ac:
- fpclass
- mbrlen moved to configure.ac (since the HAVE_MBRLEN is used accross the php-src)
- sigprocmask
- getcwd
- getwd
- glob
- strfmon
- nice

Duplicated checks removed:
- gethostname
- getlogin
- getpwuid_r
- socketpair

- mprotect check simplified
2019-06-30 23:57:54 +02:00
Peter Kokot 8bc59a62c4 Remove unused build specific symbols
These were part of the following decomissioned extensions:
- PHP_SYBASE part of the sybase extension
- PHP_MSQL_* part of the msql extension
- PHP_APACHE_* symbols were used in apache and apache_hooks sapis
- PHP_FHTTPD_* symbols part of old sapi/fhttpd
- PHP_MYSQL_* symbols were part of the legacy mysql extension

- Remove PHP_ORACLE_* symbols
  These were part of the obsolete oracle extension that was moved to PECL
  via f35af61ef8.

- PHP_OCI8_SHARED_LIBADD and PHP_OCI8_DIR were removed via
  c33f88ccb0

And other are not used anywhere across the php-src codebase
2019-06-30 23:55:03 +02:00
Peter Kokot 839ff378bc Fix phar tests with hash extension
- The hash extension is now always available.

- Remove unfinished test
  The Phar::PGP currently doesn't exist yet.
2019-06-30 23:51:56 +02:00
Peter Kokot 778f08ff06 Fix missing file and remove SKIP section
Test now passes on VC 14, 15 and 16 with current MSVC runtimes.
2019-06-30 23:50:09 +02:00
Peter Kokot 6c1c66befe Remove HAVE_LIMITS_H check
The limits.h header is part of the C89 and is today available
everywhere. There is no need to check for presence of this header
anymore.

The timelib has already been patched upstream via
aae5907cb7

PHP extensions out there shouldn't rely on symbols defined during the
build anyway and neither they do on this particular symbol anymore.
2019-06-30 23:44:45 +02:00
Peter Kokot 1925102fe4 Remove HAVE_DEV_ARANDOM
The arandom check is not needed anymore since the implementations of:
3467526a65
and
6554f721f7
2019-06-30 23:39:44 +02:00
Derick Rethans a60128c503 Merge branch 'PHP-7.3' into PHP-7.4 2019-06-30 15:50:55 +01:00
Anatol Belski 846c0e7233 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS [ci skip]
2019-06-29 17:41:29 +02:00
Anatol Belski 0e148789c3 Update NEWS [ci skip] 2019-06-29 17:40:58 +02:00
Anatol Belski dacf9ecc46 Update libmagic.patch [ci skip] 2019-06-29 17:36:11 +02:00
Anatol Belski 5ae0a6b784 Set buffer to NULL to prevent double free (Kamil Dudka at redhat)
Based on the upstream patch d13204e8da43f1d8a98cf3f74591cde02ecdb2f7.
2019-06-29 17:13:21 +02:00
Anatol Belski 02fc2fe8c9 Fix magic data 2019-06-29 16:51:41 +02:00
Christoph M. Becker 8357a696ab Fix memory leak in COM ctor
We have to free strings returned from php_com_olestring_to_string().
2019-06-29 14:51:13 +02:00
Anatol Belski 885cb79201 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix typo
  Add tests from fix #78183 from PHP-7.2
  Fix #78183: finfo_file shows wrong mime-type for .tga file
2019-06-29 13:31:22 +02:00
Joe Watkins 82effb3fc7 implement support for workers in cli-server on platforms supporting fork 2019-06-29 05:27:35 +02:00
Joe Watkins 2d5f277a2d add ini config details to php-config 2019-06-29 05:26:21 +02:00
Peter Kokot 57424f272c Clean up files after the tests are run 2019-06-28 20:19:00 +02:00
Peter Kokot df4bb13c55 Update changelogs [ci skip] 2019-06-28 20:14:22 +02:00
Peter Kokot a014e50513 Remove HAVE_ERRNO_H from libgd
The check for errno.h has been removed via
50b9ef8d94

Upstream libgd library is also patched via
https://github.com/libgd/libgd/commit/1e7f93922fb3adf9f131d7e94aa13386062ffe11
2019-06-28 20:02:11 +02:00
Nikita Popov 45ab57339e Use strcmp() in phpdbg_eol_global_update
memcmp() only makes sense on equal length strings, and here we don't
know anything about the length of the input.
2019-06-28 17:24:30 +02:00
Nikita Popov 2c8819b89c Disable ifunc resolvers if memory sanitizer is used
Just marking them as no_sanitize("memory") is unforunately not
sufficient, as the function still gets instrumented -- the attribute
only disables reporting.
2019-06-28 17:15:56 +02:00
Nikita Popov cf29c0f212 Remove phpdbg_xml_asprintf()
Clang doesn't like the use of promoted zend_bool in va_start. As
the function isn't used anyway, I'm simply dropping it...
2019-06-28 16:59:52 +02:00
Nikita Popov 88d52ae7aa Mark ifunc resolver functions as unused
It looks like clang doesn't see that these are used through
__attribute__((ifunc)) and generates a warning.
2019-06-28 16:55:54 +02:00
Nikita Popov 3698303540 Fix arginfo leak in disable_functions
Arginfo is allocated if types are used, we need to free it.
2019-06-28 16:38:46 +02:00
Nikita Popov 345a3b277c Merge branch 'PHP-7.3' into PHP-7.4 2019-06-28 16:09:23 +02:00
Nikita Popov 54dd762f59 Set up asan+ubsan scheduled build on azure
Also adds an --asan flag to run-tests.php to setup all the necessary
environment variables. Some tests are marked as skipped because they
are incompatible with asan or too slow.

I'm basing this on the DEBUG_ZTS build, which seems to give us the
most mileage.
2019-06-28 15:00:54 +02:00
Nikita Popov ca6f41aa5a Fix out of bounds read in sccp 2019-06-28 14:47:49 +02:00
Nikita Popov 50cce5eb4f Avoid reliance on arena details on phpdbg oplog
Instead of guessing what the address of the first arena allocation
is going to be, embed the sentinel in the oplog_list structure
directly.
2019-06-28 14:47:42 +02:00
Nikita Popov c0bf3bc50c Update error message in libmysql test 2019-06-28 14:46:30 +02:00
Sebastian Pop 70ef87539d Fix compilation errors when building against libmysql
Closes GH-4316.
2019-06-28 14:46:12 +02:00
Nikita Popov 9f81c56e42 Fix out-of-bounds read in array compilation
UNPACK elements only have one child. Don't access the second one
until we have excluded this case.
2019-06-28 12:44:46 +02:00
Nikita Popov 7632a411e3 Add tracked arena allocator
Available under -DZEND_TRACK_ARENA_ALLOC. This will use the system
allocator combined with arena checkpointing & release semantics
and allows analyzing arena usage under asan/valgrind.

I've sacrificed the duplicate arena implementation in mysqlnd, as
the integration with mysqlnd alloc is not worth the code duplication
to me.
2019-06-28 12:44:18 +02:00
Christoph M. Becker 645ca710d7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78192 PDO SQLite SegFault when reuse statement after schema has changed
2019-06-28 12:37:49 +02:00
Nikita Popov 8be051015e Add support for proc_open() with a command array
In this case the progarm will be executed directly, without a shell.
On Linux the arguments are passed directly to execvp and no escaping
is necessary. On Windows we construct a command string using escaping
with the default Windows command-line argument parsing method described
at https://docs.microsoft.com/en-us/cpp/cpp/parsing-cpp-command-line-arguments.

Apart from avoiding the issue of argument escaping, passing an array
and bypassing shell has the advantage of allowing proper signal
delivery to the opened process (rather than the shell).
2019-06-28 11:09:55 +02:00
Dmitry Stogov 143f4e3b5c Reduce overhead 2019-06-28 12:03:01 +03:00
Joe Watkins 68485f8ab4 implement tsrm_is_shutdown API 2019-06-28 10:27:19 +02:00
Christoph M. Becker bc0db8ce45 Use the portable zend_strndup() instead of strndup() 2019-06-28 10:23:38 +02:00
Dmitry Stogov ba8033feb0 Fixed use-after-free 2019-06-28 10:43:56 +03:00
Nikita Popov f365d0e00e Fix mysqlnd memory leak
The actual leak is observed in ext/pdo_mysql/tests/bug_74376.phpt.
The persistent connection leaks because a refcount decrement on a
result is missed. The refcount decrement is missed because
free_result_contents is used, rather than free_result.

Looking at other uses of free_result_contents, it looks like they
could also suffer from this problem. Apart from one case,
free_result_contents is always used to release the result entirely
(I've adjusted the one differing case to only free meta), so I'm
moving most of the logic from free_result into free_result_contents.
The only difference is now that free_result will skip_result first.
2019-06-28 09:18:32 +02:00
Nikita Popov a78adce5cb Free ZTS lock in opcache
For some reason this only shows up as a leak when using phpdbg.
2019-06-28 09:18:14 +02:00
Nikita Popov 8c4d199851 Fix init_file leak in phpdbg 2019-06-28 09:17:26 +02:00
Nikita Popov b195412bf3 run-tests: Don't pass --INI-- settings to --SKIPIF--
If we're testing ini settings that cause startup failures, we'll
never get to that SKIPIF block...

Also change settings2param to return a value instead of modifying
(to a different type no less!) in place.
2019-06-28 09:17:09 +02:00
Nikita Popov 70fa4715a4 Fix custom heap free
This seems to be designed around the use-case where the custom
allocator is a wrapper around ZMM.
2019-06-28 09:13:45 +02:00
Sara Golemon 27f1f3ed1a Bugfix #78208 Needs rehash with an unknown algo should always return true. 2019-06-27 19:26:03 -04:00
Peter Kokot 35b6a9f75a Catch up with some recent changes [ci skip]
- Mention mysqli::stat()
- Mention removal of HAVE_* for always defined extensions
- Mention removed symbols defined during the build
2019-06-28 00:29:50 +02:00
Peter Kokot 638c21765c Remove HAVE_STRCOLL check
The strcoll function is defined in the C89 standard and should be
on today's systems always available via the <string.h> header.

https://port70.net/~nsz/c/c89/c89-draft.html#4.11.4.3

- Remove also SKIPIF strcoll check in test
2019-06-28 00:05:55 +02:00
Peter Kokot 033cafacbd Sync HAVE_HASH, HAVE_HASH_EXT, PHAR_HASH_OK symbols
The hash extension is always available since PHP-7.4. The symbol
HAVE_HASH_EXT is kept for BC reasons and removed in PHP-8.0.

This patch also removes the PHAR_HASH_OK since it is no longer
relevant.
2019-06-27 23:25:33 +02:00
Nikita Popov 08027e85fa Remove posix_getlogin_basic.phpt test
The premise of this test (that the getlogin user has to be the same
as the geteuid user) is incorrect.
2019-06-27 16:15:13 +02:00
Nikita Popov 40d6147dd0 Fix opcache blacklist leak
Don't recompute (and leak) the regex for every glob element, only
do this once at the end.
2019-06-27 16:11:58 +02:00
Nikita Popov c3132781ec Fix phpdbg shutdown order
In particular, make sure that everything using zmm is released
before zmm is shut down. phpdbg currently gets away with this,
because either a) its custom handlers are used and no auto-free
happens or b) the system allocator is used and no auto-free happens.
With the tracking allocator for asan this no longer works.
2019-06-27 14:20:51 +02:00
Nikita Popov 2149ed7072 Don't use zmm for PHPDBG_G(exec)
Uses system allocator when backing up settings ... let's avoid
unnecessary confusion.
2019-06-27 14:20:30 +02:00
Nikita Popov 78375aa52f Fix persistent XML memory leaks in SOAP
SOAP uses a horrible bailout based error handling approach -- avoid
leaking persistent XML memory by catching bailouts in a number of
places.
2019-06-27 14:20:10 +02:00
Nikita Popov cfeda978df Add tracked allocator mode
In this case we will use the system allocator, but still remember
all allocations and free them the same way that Zend MM does. This
allows us to accurately model leak behavior.

Enabled using USE_ZEND_ALLOC=0 USE_TRACKED_ALLOC=1.
2019-06-27 14:19:48 +02:00
Christoph M. Becker 218c18530a Show actual enchant version if possible
As of libenchant 1.6.0 there is enchant_get_version()[1], so we use it,
if available, to show the actual enchant version in the PHP info.  We
also drop the fake ENCHANT_VERSION_STRING altogether, but stick with
showing version 1.5.x if at least HAVE_ENCHANT_BROKER_SET_PARAM is
defined.

Future scope: we may consider requiring enchant 1.6.0 (or later), since
this has been released in April 2010, and likely is available
everywhere.

[1] <https://www.abisource.com/projects/enchant/>
2019-06-27 13:04:49 +02:00
Dmitry Stogov e7446c1b2d Separate common code abd eliminate useless checks 2019-06-27 13:11:08 +03:00
Dmitry Stogov a58964be82 Inline hot path 2019-06-27 11:27:53 +03:00
Nikita Popov 2f0f895284 Fix persistent connection leak in mysqli 2019-06-27 09:45:32 +02:00
Nikita Popov 6bebe833a2 Fix use-after-free in stream freeing during shutdown
Streams will be freed in an unpredictable order during shutdown.
Ignore explicit calls to php_stream_close() entirely to avoid
use-after-free -- instead let the stream resource destructor
deal with it. We have to account for a few special cases:

 * Enclosed streams should be freed, as the resource destructor
   will forward to the enclosing stream.
 * Stream cookies also directly free streams, because we delegate
   to the cookie destruction if one exists.
 * Mysqlnd also directly frees streams, because it explicitly
   removes stream resources (because mysqlnd!)
2019-06-27 09:45:23 +02:00
Peter Kokot 2079b09854 Clean headers checks
Some headers were checked multiple times in the main configure.ac file
and in the bundled extensions or SAPIs themselves. Also many of these
checks are then used accross other extensions or SAPIs so a central
configure.ac makes most sense for these checks.
2019-06-27 02:45:09 +02:00
Dmitry Stogov 83b99527df Avoid double checks on early binding 2019-06-27 02:13:06 +03:00
Peter Kokot 798fed3b0d Remove warnings for bison and re2c checks
This patch removes warnings when lexer and parser files are already
generated. For example, when downloading a PHP release. Realistically,
it is not so trivial to rebuild lexer and parser files without removing
them first. And considering that tarballs don't have cleaning tools
such as Git, this would require manual removali.

Related also to https://bugs.gentoo.org/593278
2019-06-27 00:59:59 +02:00
Peter Kokot 4ff44a9161 Fix concurrent testing of bug 61964
When tests are run concurrently using the -j option there might be a
change of failure and writing to the same directory from both tests.

Use test filenames for generated temp dirs
2019-06-27 00:27:10 +02:00
Peter Kokot a29bf46b68 Fix posix_errno test without PCNTL dep
When PCNTL extension is not enabled, the SIGKILL constant is also not
available.
2019-06-27 00:24:37 +02:00
Peter Kokot 6ef2f04a75 Remove unused HAVE_DATE and HAVE_SPL symbols
These two are never defined anymore since PHP 7.4 and can be
considered to have always available date and hash extensions.
2019-06-26 23:30:58 +02:00
Peter Kokot cc4134c04e Remove HAVE_STRTOD and strtod check
There is no need to check for the strtod function. It is part of C89
standard which PHP-7.4+ supports.

http://port70.net/~nsz/c/c89/c89-draft.html#4.10.1.4
2019-06-26 23:10:55 +02:00
Peter Kokot 537844cb1d Set Computer English language for credits sorting
This makes the script a bit more portable when used on systems with
different LC_ALL and LANG settings.
2019-06-26 22:35:55 +02:00
Christoph M. Becker 81a403211e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Remove stream_socket_sendto.phpt
2019-06-26 17:02:08 +02:00
Dmitry Stogov 36b7021e2c Private methods don't have to be duplicated 2019-06-26 13:27:13 +03:00
Nikita Popov 788a68900d Fix xml doc leak in soap 2019-06-26 11:43:11 +02:00
Nikita Popov 80958d0f90 Use ldap_destroy instead of ldap_unbind_ext 2019-06-26 11:43:11 +02:00
Nikita Popov 698dd32b03 Fix fpm limit_extensions leak
The logic here is somewhat ugly because the worker pool structure
gets freed early, so we need to explicitly transfer ownership.
2019-06-26 11:40:39 +02:00
Dmitry Stogov f7faa62c43 Reorder conditions to minimize number of checks on fast path 2019-06-26 01:00:31 +03:00
Dmitry Stogov 6288fc19dd Remove always true/false conditions, remove dead conde and simplify code. 2019-06-26 00:32:22 +03:00
Dmitry Stogov 215b5a7db8 Replace previosly checked conditions by ZEND_ASSERT() 2019-06-25 18:26:56 +03:00
Dmitry Stogov f09d41ffc0 Fixed variance check for abstract constructor during erlay binding 2019-06-25 17:43:46 +03:00
Dmitry Stogov ccbc121cb1 Cleanup 2019-06-25 16:37:42 +03:00
Nikita Popov 0f3ca15bb7 FFI: Perform bitfield operations byte-wise
Otherwise we may perform reads/writes outside the allocation, as
already happens in 032.phpt.
2019-06-25 14:28:58 +02:00
Nikita Popov 42b22d3a94 Fix out of bounds write in phpdbg
It seems that this code has a peculiar interpretation of "len",
where it actually points to the last character, not one past it.
So we need +1 here for that extra char and another +1 for the
terminating null byte.
2019-06-25 14:28:58 +02:00
Nikita Popov 8757f30cc7 Fix CURLINFO_COOKIELIST leak 2019-06-25 14:28:58 +02:00
Nikita Popov 8277acefbd Fix leak on sqlite3 open error
sqlite3_open creates the database object even if the operation
fails.
2019-06-25 14:28:58 +02:00
Nikita Popov 6fcae63f61 Fix SSL_CTX leak in ftp extension
SSL_CTX is a refcounted structure, which will be held by the SSL
handle, so we can free it here.
2019-06-25 14:28:58 +02:00
Nikita Popov b53bb3c15b Fix UConverter leak 2019-06-25 14:28:58 +02:00
Nikita Popov 77f7ec5152 Fix TimeZone leak in intl MessageFormat
I'm just giving each format a distinct owned object here ... sharing
it looks complicated.
2019-06-25 14:28:58 +02:00
Nikita Popov c7962207d7 Fix stream leak in phar cache_list 2019-06-25 14:28:58 +02:00
Nikita Popov 74a7d00846 run-tests: Don't die unnecessarily
die/exit leak memory, don't use them if we don't need to.
2019-06-25 14:28:58 +02:00
Dmitry Stogov 1d534b9da5 Set ZEND_ACC_LINKED flag after early binding (for consistency) 2019-06-25 15:05:27 +03:00
Dmitry Stogov e8f1f70101 Reduce overhead of delayed early binding 2019-06-25 14:20:41 +03:00
Christoph M. Becker ead40e31e9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78202: Opcache stats for cache hits are capped at 32bit NUM
2019-06-25 13:06:20 +02:00
Dmitry Stogov bd0cb99d8c Prevent useless hash lookups 2019-06-25 12:41:06 +03:00
Derick Rethans d8e6054f46 Update NEWS for 7.4.0alpha3 2019-06-25 09:03:00 +00:00
Derick Rethans 7657741997 Update NEWS for PHP 7.4.0alpha2 2019-06-25 09:01:40 +00:00
Dmitry Stogov 759f4ecd8b Keep lowercased parent class name as second argument of DECLARE_CLASS to avoid extra work at run-time 2019-06-25 11:30:58 +03:00
Nikita Popov 43dd1ac570 Avoid confusing gotos in phar_split_cache_list 2019-06-25 10:25:44 +02:00
Nikita Popov 31123de0c8 Fix EVP_PKEY leak in phar 2019-06-25 10:25:44 +02:00
Nikita Popov 3a36e68c49 Don't force USE_ZEND_ALLOC=0 in run-tests.php
USE_ZEND_ALLOC=0 is useful not just for valgrind ... we should not
force USE_ZEND_ALLOC=1 if the user explicitly disabled it.
2019-06-25 10:25:44 +02:00
Nikita Popov 46bad1d679 Fix region leak in mb_ereg_replace 2019-06-25 10:25:44 +02:00
Dmitry Stogov 0f29fb5cd8 Fixed bug 78175 (Preloading must store default values of static variables and properties) 2019-06-24 20:32:27 +03:00
Christoph M. Becker 94df6dc3fd Split test case
This test is failing on AppVeyor almost all of the time, so splitting
it seems appropriate.  This also allows us to rid php_cli_server_stop()
which was only used by this test case.
2019-06-24 14:08:11 +02:00
Nikita Popov df27bfe58b Add debugging code to time_sleep_until test 2019-06-22 10:19:49 +02:00
Derick Rethans d3112adf7f Merge branch 'bug67348-mysqli-stat' into PHP-7.4 2019-06-21 16:52:15 +01:00
Derick Rethans 579562176b Fixed bug #67348: Reading $dbc->stat modifies $dbc->affected_rows 2019-06-21 16:51:52 +01:00
Nikita Popov 152ccfb08d Fix stack leak in phpdbg 2019-06-21 17:01:25 +02:00
Nikita Popov a7bcfee9c9 Fix prompt leak in phpdbg 2019-06-21 17:01:18 +02:00
Christoph M. Becker eec5d2a25f Properly shut down font cache mutex
Since the font cache mutex in set up in MINIT, we have to shut it down
in MSHUTDOWN.
2019-06-21 16:00:47 +02:00
Andrey Hristov 1da15600ae Merge branch 'PHP-7.3' into PHP-7.4 2019-06-21 16:33:01 +03:00
Nikita Popov 021bb35aec Merge branch 'PHP-7.3' into PHP-7.4 2019-06-21 15:08:12 +02:00
Nikita Popov 1de7c4b919 Fix memory leaks in browscap parsing
Also make the interning a bit more efficient, no need to check for
a "real" interned string every time, we can also store that in the
HT.
2019-06-21 12:56:37 +02:00
Nikita Popov f781c8f110 Fix leak in bcpowmod 2019-06-21 12:56:28 +02:00
Nikita Popov e7ef2b52db Merge branch 'PHP-7.3' into PHP-7.4 2019-06-21 12:56:12 +02:00
Dmitry Stogov e1e8e670df Cleanup 2019-06-21 11:43:17 +03:00
Nikita Popov a84771573d Make ZEND_SEND_* flags unsigned
These may be shifted to the limit for the arg mask.
2019-06-21 10:24:34 +02:00
Nikita Popov 8227e0f747 Avoid ub in shift overflow check
Also fix an off-by-one error. While 1 << 63 overflows, -1 << 63 does
not.
2019-06-21 10:24:27 +02:00
Christoph M. Becker 81fd113506 Support TGA reading
We add PHP bindings for libgd's features to read TGA files, which are
available as of libgd 2.1.0.

As PHP's bundled libgd doesn't yet include the respective features of the
external libgd, we add these.

Since TGA has no easily recognizable file signature, we don't add TGA
support for imagecreatefromstring() or getimagesize() and friends.
2019-06-20 23:40:51 +02:00
Christoph M. Becker 2b4fc9eb9c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78189: file cache strips last character of uname hash
2019-06-20 18:01:02 +02:00
Nikita Popov 59974000eb Remove leftover check
This is checked below now in a way that handles misaligned pointers.
2019-06-20 17:24:22 +02:00
Nikita Popov dd6d471834 Handle misaligned ifreq on macos 2019-06-20 17:24:16 +02:00
Nikita Popov d80f0ff6c0 Handle gr_mem misalignment on macos 2019-06-20 17:24:06 +02:00
Christoph M. Becker a768271d91 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
2019-06-20 17:00:33 +02:00
Christoph M. Becker ecae9100dc Rename test file to reflect the appropriate ticket number 2019-06-20 16:54:17 +02:00
Nikita Popov 6165c23475 Check for dlsym as well
For some reason, when using GCC with address sanitizer, dlopen
is available without -ldl, but dlsym still needs it. Explicitly check
dlsym so we add the library.
2019-06-20 16:23:04 +02:00
Nikita Popov 26ac6cb6be Handle gethostbyname misalignment on macos 2019-06-20 16:22:40 +02:00
Nikita Popov 27d3373496 SOAP: Avoid indexing into null pointer 2019-06-20 16:22:34 +02:00
Nikita Popov f127d77eef FFI: Use signed arithmetic for pointer offset
offset can be negative here, using signed arithmetic avoids ubsan
warnings.
2019-06-20 16:22:26 +02:00
Nikita Popov d4de127dd8 In php_needle_char() use well-defined double->integer cast
...by going through zval_get_long(). Generally out of range double
casts are undefined.
2019-06-20 16:22:10 +02:00
Nikita Popov e8ae19223c Avoid address calculation overflow 2019-06-20 16:22:04 +02:00
Nikita Popov e4455c32ed Bail out earlier in zend_memnrstr
To avoid decrementing a null pointer lateron. As we need to check
for NULL here anayway, we should take the chance to bail out right
away.
2019-06-20 16:21:53 +02:00
Nikita Popov a59e0cfce5 Disable float division by zero sanitizer for div_function
We intentionally divide by zero here and want to get IEEE-754
semantics.
2019-06-20 16:21:47 +02:00
Nikita Popov eaafb69eea Change indexing scheme for symtable_cache
symtable_cache_ptr now points to the first unused symtable_cache
entry, rahter than the last used one. This avoids taking a pointer
to the minus first element of the array, which is UB. Instead we
take a pointer to the end plus one, which is not UB.
2019-06-20 16:21:39 +02:00
Remi Collet 961935fde2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix test for Windows and for parallel run
2019-06-20 11:59:04 +02:00
Remi Collet 522cf62906 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  improve test clean section
  move NEWS entry
2019-06-20 11:52:25 +02:00
Nikita Popov e162a1c02e Fix maybe uninit warning 2019-06-20 10:35:22 +02:00
Remi Collet fa70aedf03 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  add test for #78185
2019-06-20 10:28:26 +02:00
Nikita Popov 4488475a3e imagecolorallocate(): Check that RGB components are in-range
Instead of letting them bleed over into other components.
2019-06-20 10:09:54 +02:00
Nikita Popov 117c7b3f65 Avoid overflow in mul range calculation
By using ZEND_SIGNED_MULTIPLY_LONG, which already implemented
efficient overflow checking logic.
2019-06-20 09:57:55 +02:00
Nikita Popov 3a97b8b4f9 Backport "Avoid UB in overflow checks"
Cherry-pick of bb940d9969 without
the JIT parts.
2019-06-20 09:51:05 +02:00
Nikita Popov ccfe6c862a Avoid memset/memcpy null ub in block pass
The arena allocator has no problem with zero-size allocations (and
will just return the same pointer for each in this case), so just
do that to avoid null pointers.
2019-06-20 09:49:07 +02:00
Dmitry Stogov 05c8f1ff2e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78185 (File cache no longer works)
2019-06-20 09:07:39 +03:00
Nikita Popov 8743d5e99a Avoid signed shift ub in php_sdl 2019-06-19 17:27:09 +02:00
Nikita Popov 608097a901 Fix various instances of memcpy null ub 2019-06-19 17:27:09 +02:00
Nikita Popov 7cbd4f31c4 Remove copy argument from php_glob_stream_get_path/pattern
This is unused, and shouldn't be part of the API.
2019-06-19 17:27:09 +02:00
Nikita Popov 9b3b07cd26 Suppress shift UB in gd_itofx()
There doesn't seem to be a corresponding upstream fix for this.
2019-06-19 17:27:09 +02:00
Andrey Hristov 10afeead62 Merge branch 'PHP-7.4' of https://git.php.net/push/php-src into PHP-7.4 2019-06-19 18:17:35 +03:00
Nikita Popov 268b5fec8e Fixed bug #78182 2019-06-19 16:35:12 +02:00
Nikita Popov b8cba88904 Suppress overflow UB in zend_strtod 2019-06-19 15:57:57 +02:00
Nikita Popov 555d68be10 Fix shift UB in hash_snefru 2019-06-19 15:55:56 +02:00
Nikita Popov 88b603768f imageloadfont: Perform overflow check before calculation
Instead of afterwards...
2019-06-19 15:50:52 +02:00
Andrey Hristov 65915d44cb Merge branch 'PHP-7.3' into PHP-7.4 2019-06-19 16:43:15 +03:00
Nikita Popov 2a9fc31021 Fix buffer underflow in gd_gif_in.c
This has been fixed upstream in
https://github.com/libgd/libgd/commit/939d49a3a9d1cbcd2a37cea9eac9f9e5e9f9de78.
2019-06-19 15:41:45 +02:00
Nikita Popov c10cb47b5f Fix uninitialized variable
I mistakenly moved len1 initialization into the conditional as well.
2019-06-19 15:34:51 +02:00
Nikita Popov ea97fc9c1f Fix shift UB in gd_io.c
This has already been fixed upstream in
https://github.com/libgd/libgd/commit/24d352576c024769d18113a28f3be03d54fa1e66
and
https://github.com/libgd/libgd/commit/772d0107a6b00a0d6d7191383fe984f8c018b48c.
2019-06-19 15:09:00 +02:00
Nikita Popov 1c018af682 Fix shift UB in php_ifd_get32s 2019-06-19 15:09:00 +02:00
Nikita Popov b1196e2128 Phar: Avoid negative zip dates
The zip date/time encoding format is incredibly stupid.
2019-06-19 15:09:00 +02:00
Nikita Popov 7bf6326259 Fix memcpy null UB in phar 2019-06-19 15:09:00 +02:00
Nikita Popov ae2bc6297e Fix shift UB in mbfilter_utf32.c 2019-06-19 15:09:00 +02:00
Nikita Popov f65046b951 Fix shift UB in sint4korr() 2019-06-19 15:09:00 +02:00
Nikita Popov 22765160da Fix incorrect shift in mysqlnd_wireprotocol
This one looks like a genuine bug: We're shifting a uint16_t by
16 bits. On x86 that likely results in no shift happening.
2019-06-19 15:09:00 +02:00
Nikita Popov 4ae87f4bf9 Fix overflow UB in range() 2019-06-19 15:09:00 +02:00
Nikita Popov f26e77b05f Avoid memcpy UB in streams 2019-06-19 15:09:00 +02:00
Nikita Popov 8740533ddf Avoid more UB in round() 2019-06-19 15:09:00 +02:00
Nikita Popov 4b5e824aae Use unsigned char in _crypt_extended_r
Avoid signed shift UB.
2019-06-19 15:09:00 +02:00
Nikita Popov bee7973e52 Use unsigned chars in php_uuencode()
Avoid shift UB on signed integers.
2019-06-19 15:09:00 +02:00
Nikita Popov 0c0659dc50 Fix _php_math_round UB
php_intlog10abs() is ill-defined for a zero value. Avoid calling it
altogether as there's nothing to round with a zero value.
2019-06-19 15:09:00 +02:00
Nikita Popov 317dfab81b Fix memcpy null arg UB 2019-06-19 15:09:00 +02:00
Nikita Popov ed2a242317 Fix signed shift UB 2019-06-19 15:09:00 +02:00
Nikita Popov 82a34e71c5 Avoid overflow UB in is_numeric_string
We intentionally overflow the signed space here, so make this an
unsigned variable and only cast to signed at the end.
2019-06-19 15:09:00 +02:00
Nikita Popov 3d4298697b Fix shift UB in constants
We were shifting out the top bit of a signed integer.
2019-06-19 15:09:00 +02:00
Joe Watkins 11f30d67ea Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix setcookie Max-Age to use php_time
2019-06-19 12:43:17 +02:00
Joe Watkins 5f9ee161ec Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  export php_time
2019-06-19 12:40:54 +02:00
Joe Watkins eda5d8afcf refactor a little more to add some more useful error messages and raise the limits on waiting for slow machines 2019-06-19 11:41:24 +02:00
Joe Watkins d6480fa231 Separate check for process creation and ability to accept connections 2019-06-19 11:09:26 +02:00
Christoph M. Becker 571c6bc3f3 Document removal of uint and ulong typedefs 2019-06-19 09:45:15 +02:00
Joe Watkins fb95043acf Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Resolve discrepencies between second value yielded by gettimeofday and time, fixes #69044
2019-06-19 09:01:20 +02:00
Christoph M. Becker 5a1ffefbc1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78173: XML-RPC mutates immutable objects during encoding
2019-06-18 17:09:49 +02:00
Dmitry Stogov 148eb20226 Fixed bug #78175 (Preloading segfaults at preload time and at runtime) 2019-06-18 17:18:49 +03:00
Christoph M. Becker 04a6aac59b Turn system_id into a true global
The system_id is identical for all threads and can be computed during
module startup, so there is no need to calculate and store it for each
thread.
2019-06-18 10:27:35 +02:00
Christoph M. Becker c2c33aaaaa Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
2019-06-18 09:34:24 +02:00
Joe Watkins 68785c00ef fix flaky socket test 2019-06-18 08:30:46 +02:00
Remi Collet a31f362b75 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  move NEWS entry
2019-06-18 07:51:17 +02:00
BohwaZ ce22ccc77b Implement SQLite3 backup API 2019-06-17 23:34:51 +02:00
Nikita Popov d924b426c9 Fix file clash in fgetcsv test 2019-06-17 17:25:43 +02:00
Christoph M. Becker e58e2fd0d4 Improve create_verify_dir() diagnostics
If create_verify_dir() fails[1], we need more info why that happened.

[1] <https://ci.appveyor.com/project/cmb69/php-src/builds/25324138/job/dm1n12gqhdqa3ln5#L5753>
2019-06-17 16:49:52 +02:00
Nikita Popov 4e9a65447f Fix file conflicts in SplFileObject fputcsv tests 2019-06-17 15:08:52 +02:00
Dmitry Stogov 938d2359ae Remove XFAIL mark 2019-06-17 14:56:28 +03:00
Dmitry Stogov eda916cc98 Avoid uninitilized field access 2019-06-17 14:53:44 +03:00
Dmitry Stogov 1e0b0467b6 Fixed memory leaks in ext/ffi/tests/100.phpt on Mac OSX 2019-06-17 14:40:19 +03:00
Nikita Popov ad1b62fca7 Merge branch 'PHP-7.3' into PHP-7.4 2019-06-17 13:31:04 +02:00
Freddie Leeman 482784284a Simplify pm.start_servers calculation in docs
This makes it more obvious that this is just the average.
2019-06-17 13:24:22 +02:00
Nikita Popov 1b63528d38 Merge branch 'PHP-7.3' into PHP-7.4 2019-06-17 13:14:18 +02:00
Nikita Popov d584f92195 Add debug output to posix_getlogin() test 2019-06-17 13:05:59 +02:00
Nikita Popov 6381b1ee82 Make ext/curl/tests/bug48203_multi.phpt more robust
We don't have a guarantee in which order the output here will
occur. And it's not really relevant for the test anyway, so use a
wildcard.
2019-06-17 12:43:45 +02:00
George Peter Banyard b2d6d29632 Remove unnecessary short_open_tags use in tokenizer test 2019-06-17 12:43:00 +02:00
Nikita Popov 36d94f73bb Enable intl on macos 2019-06-17 11:52:26 +02:00
Joe Watkins 116d42d990 bugs in fpm logging #4273 #4007 2019-06-17 07:48:37 +02:00
Nikita Popov 4befe320e3 Use uint64_t for time_sleep_until calculations 2019-06-16 19:20:08 +02:00
Christoph M. Becker 11c3215251 Prevent parallel test conflict
Cf. <https://travis-ci.org/php/php-src/jobs/546112543#L2865-L2866>.
2019-06-16 11:48:48 +02:00
Joe Watkins 2283884475 this mtime comparison makes assumptions that cannot always hold true 2019-06-16 08:29:04 +02:00
Joe Watkins 7e1972796b gettimeofday cannot be used to reliably implement high precision process synchronization
The use of gettimeofday in time_sleep_until is technically incorrect, it's not possible
to use gettimeofday in this way reliably on any platform: It relies on operating system
global structures, which may be modified by any other process on the system at any time.

While in practice, users may be ignoring this flaw, it entirely depends on the other software
running on the system to which the application is deployed, there is no possible way to write
a test that will always pass on any system, therefore it must be marked XFAIL.
2019-06-16 07:02:28 +02:00
Anatol Belski 5a83bfb37d Set correct default version 2019-06-15 17:39:13 +02:00
Joe Watkins 91f0ef04af PHP-7.4 branch should not run JIT tests, ever [ci skip] 2019-06-15 10:07:01 +02:00
Joe Watkins 3852a35fdb This test is flaky, and some of it doesn't make sense.
I've refactored based on the original bug report, related bugs, and commits
to php-src that were related to them.

It is supposed to be testing windows specific behaviour related to non-blocking pipes,
nevertheless the test runs everywhere.
2019-06-15 09:57:51 +02:00
George Peter Banyard cfdca10910 Remove dead code in sockets extension [ci skip] 2019-06-15 08:39:35 +02:00
Joe Watkins afdf7ed5ba fix flaky socket tests 2019-06-15 08:08:08 +02:00
Nikita Popov 7410155dab Remove file/005_variation.phpt
As this test doesn't check differences in times before and after
operations, it doesn't actually verify anything and just wastes
30 seconds of test time.

As we already have other tests that do check how stat times change,
I'm removing it entirely.
2019-06-14 17:06:47 +02:00
Nikita Popov 8a5ce6f16f Make curl_multi_info_read.phpt more robust
I don't think there's any need to make remote connections here
(and bugs.php.net is down right now...) so just use local files
instead.
2019-06-14 16:55:51 +02:00
George Peter Banyard 6bd66f77fc Remove useless param in php_snmp_error()
It is always NULL.
2019-06-14 16:15:38 +02:00
Rosen Penev 32e6d08dcd Fix compilation without deprecated OpenSSL 1.1 APIs 2019-06-14 15:38:12 +02:00
Joe Watkins 8f4e24eeef disable this test temporarily 2019-06-14 14:22:25 +02:00
twosee 42cc58ff7b Turn add_index_zval and add_next_index_zval into inline function
Avoids expression warnings and allows explicitly namespaced use in
C++.

Closes GH-4250.
2019-06-14 13:10:27 +02:00
Joe Watkins dd10bf5450 Merge branch 'mac-tests' into PHP-7.4
* mac-tests:
  fix mac tests on azure
2019-06-14 12:56:08 +02:00
Joe Watkins f16b012116 fix mac tests on azure 2019-06-14 12:55:00 +02:00
Nikita Popov e6aec81470 Fix SNMP build warnings 2019-06-14 12:45:46 +02:00
Dmitry Stogov 6e397e9887 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Backport 96a12578c1
2019-06-14 13:29:40 +03:00
Dmitry Stogov cfa3866578 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Backport 91a6cdbff5
2019-06-14 13:26:04 +03:00
Dmitry Stogov 96a12578c1 More edge case fixes that may cause bug #78106 2019-06-14 13:10:02 +03:00
Dmitry Stogov 91a6cdbff5 Attempt to fix edge conditions that may cause bug #78106 2019-06-14 12:47:22 +03:00
Theodore Brown f74109d9a4 Implement numeric literal separators
RFC: https://wiki.php.net/rfc/numeric_literal_separator
2019-06-14 11:37:04 +02:00
Nikita Popov ec77cca5f3 Merge branch 'PHP-7.3' into PHP-7.4 2019-06-14 11:13:43 +02:00
Nikita Popov 646b64b119 Fix skipif syntax errors
Apparently I did this only on masster...
2019-06-14 09:29:14 +02:00
Joe Watkins 8b6b4870e7 disable phpdbg on i386 builds [ci skip] 2019-06-14 08:30:20 +02:00
Côme Chilliet 9684d5f282 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Some more string conversion handling, fixing bug #77958
  Avoid converting zval when not needed
2019-06-13 22:15:13 +02:00
Nikita Popov 19e2101dfa Revert "ext/standard: Use PKG_CHECK_MODULES to detect the Argon2 library"
This reverts commit bdcef51bcb.

It seems that pkg-config support for libargon2 is still flaky:
 * No pc file on Alpine.
 * Custom builds of released libargon2 versions create a broken
   pc file. This is fixed in master, but not released.

Go back to the old detection code for now.
2019-06-13 16:53:05 +02:00
Nikita Popov ce2b36bc48 Condition some azure jobs on schedule trigger 2019-06-13 14:20:47 +02:00
Christoph M. Becker 3c5bb06536 Add BMP support to PHP info 2019-06-13 13:07:01 +02:00
Nikita Popov e5be58f57c Merge branch 'PHP-7.3' into PHP-7.4 2019-06-13 12:54:10 +02:00
Nikita Popov da275e6214 Merge branch 'PHP-7.3' into PHP-7.4 2019-06-13 12:41:01 +02:00
Nikita Popov cac6b04113 Fixed bug #78154 2019-06-13 10:59:01 +02:00
Nikita Popov b64107531b Fixed bug #78151 2019-06-13 09:37:30 +02:00
Nikita Popov 4603ce731b Don't throw warning if testing multiple ports 2019-06-13 09:34:23 +02:00
Joe Watkins b2b0e52466 test for bug #78151 2019-06-12 22:39:00 +02:00
Joe Watkins 175c7bf6fe Revert "micro-optimization"
This reverts commit 374f769982.
2019-06-12 20:04:47 +02:00
Nikita Popov da56e77357 Enable -Werror on macos builds 2019-06-12 16:14:23 +02:00
Nikita Popov 7b8299893e Fix ext/exif/tests/bug76557.phpt for 32-bit builds
The error message is different there.
2019-06-12 15:40:18 +02:00
Nikita Popov bc8fece0cf Don't warn if libcurl SSL library not detected
libcurl may link against 7 different ssl libraries, all of which
are thread-safe -- apart from openssl, of course. We check for
openssl and register locking callbacks in that case, but we should
not warn if any other library is used.
2019-06-12 15:26:50 +02:00
Joe Watkins e1f65e2d97 Merge branch 'PHP-7.4' of git://github.com/php/php-src into PHP-7.4 2019-06-12 15:10:49 +02:00
Joe Watkins 3b6d36435f we are not running database tests on macos, there is no need to install mysql or start pg 2019-06-12 15:09:41 +02:00
Joe Watkins a7f8a2b731 we are not running database tests on macos, there is no need to install mysql or start pg 2019-06-12 15:09:28 +02:00
Nikita Popov 6fcb469991 Fix unsigned char mismatch 2019-06-12 14:58:06 +02:00
Nikita Popov 8f63e7e324 Make ATTRIBUTE_UNUSED more portable 2019-06-12 14:29:23 +02:00
Nikita Popov cc89d26096 Fix ifdef position
Hopefully fixes the release build...
2019-06-12 13:50:30 +02:00
Nikita Popov cdefeb715b Use memset instead of brace initialization
Apparently {{0}} is not enough ... let's not rely on structure
layout specifics here.
2019-06-12 13:50:23 +02:00
Derick Rethans 945e5d35d7 Update NEWS for 7.4.0alpha2 2019-06-12 12:24:35 +01:00
Derick Rethans ec57ba5edd Update CREDITS for PHP 7.4.0alpha1 2019-06-12 12:24:35 +01:00
Derick Rethans 53bfa33ef5 Update NEWS for PHP 7.4.0alpha1 2019-06-12 12:24:35 +01:00
Nikita Popov 65ff4dddba Remove always true condition 2019-06-12 13:17:25 +02:00
Nikita Popov 080e2316cf Mark some operand fetching funs as ATTRIBUTE_UNUSED
Whether these are used depends on VM specialization.
2019-06-12 13:17:25 +02:00
Nikita Popov 16f79129c7 Fix unused variables in fpm_env.c 2019-06-12 13:17:25 +02:00
Nikita Popov 93c728b77c Try to control ZEND_MM_ALIGNED_SIZE type 2019-06-12 13:17:25 +02:00
Nikita Popov be36d92294 Fix unused value warnings in snprintf.c 2019-06-12 13:17:25 +02:00
Nikita Popov 52d80ccd24 Remove MYSQLND_LLU_SPEC/MYSQLND_LL_SPEC
No longer used, replaced by PRIu64/PRIi64.
2019-06-12 13:17:25 +02:00
Nikita Popov e1e275eefd Fix mysqlnd printf modifiers
By moving the the standard macros...
2019-06-12 13:17:25 +02:00
Nikita Popov 4d65d53805 Enable -Werror on m32 build
This one is clean now.
2019-06-12 13:17:25 +02:00
Nikita Popov 3e4b9659d3 Fix warnings in mysqlnd_alloc.c
And also separate the PHP_DEBUG codepaths more, to avoids having an
ifdef every other line...
2019-06-12 13:17:25 +02:00
Nikita Popov 9fa552f393 Fix incorrect enum value uses in xmlrpc 2019-06-12 13:17:25 +02:00
Nikita Popov fdfb390f07 Remove unused php_mbX_int_to_char() functions 2019-06-12 13:17:25 +02:00
Nikita Popov 5be772a19c Fix incorrect printf modifiers 2019-06-12 13:17:25 +02:00
Nikita Popov 2134cc25d2 Guard functions by SO_PASSCRED 2019-06-12 13:17:25 +02:00
Christoph M. Becker 37d0c7b0e4 Simplify GD null byte injection tests
These tests actually check that no file with a name containing a NUL is
created by the GD image output functions.  This is superfluous, since
it is sufficient to check that the function failed, and that an
appropriate warning has been raised.

We also add missing nullbyte injection tests.
2019-06-12 12:04:01 +02:00
Nikita Popov 2f1d822d78 Preserve CFLAGS/LDFLAGS for curl ssl check
We need to add the curl-specific flags, but we also need to preserve
the general flags, to keep around important stuff like -m32.
2019-06-12 11:54:13 +02:00
Nikita Popov 365a905e00 Suppress int to char conversion warnings 2019-06-12 11:54:13 +02:00
Nikita Popov d2921af348 Use labs() on long integer 2019-06-12 11:54:13 +02:00
Nikita Popov 1d8c323b64 Don't use sqlite3_aggregate_count()
This function has been deprecated, with the recommendation that
the count should be explicitly tracked in the aggregate context,
if it is needed.
2019-06-12 11:54:12 +02:00
Nikita Popov 26a1b2e28e Fix type mismatch in two get_col callbacks 2019-06-12 11:54:12 +02:00
Nikita Popov f601eb15e6 Fix -Wmissing-braces warnings
Unfortunate that = {} is a GNU extension.
2019-06-12 11:54:12 +02:00
Derick Rethans 06ddc025ac Update credits pre-release 2019-06-12 08:58:11 +01:00
Joe Watkins e2eb1ee1e3 fix flaky zip tests, order is OS dependent 2019-06-12 09:47:47 +02:00
Remi Collet 66bd7875f8 add comment about pg_config/pkgconfig 2019-06-12 09:39:11 +02:00
Nikita Popov b654a07492 Revert option rename
Let's keep this at --with-password-argon2 to avoid churn, I don't
think we have a strong motivation to rename this one.
2019-06-12 09:28:25 +02:00
Nikita Popov 852ab5d83f Use %define api.pure instead of %pure-parser
%pure-parser is deprecated. In our case there is no difference between
true & full, as we don't use locations.
2019-06-12 09:26:34 +02:00
Joe Watkins c54a247cb0 fix flaky sockets test - form of response is OS dependent 2019-06-12 08:47:35 +02:00
Joe Watkins abe38b5e48 fix flaky test on OSX 2019-06-12 08:33:07 +02:00
Joe Watkins eac238fb6c Revert "ext/pgsql: Use PKG_CHECK_MODULES to detect the pq library"
This reverts commit 1e265174ed.
2019-06-12 08:00:55 +02:00
Joe Watkins 2dfa495311 fix flaky gd tests 2019-06-12 07:52:28 +02:00
Joe Watkins 8ab3e7bc0c disable phpdbg on macosx, it's not well tested there and is skewing results [ci skip] 2019-06-12 06:58:53 +02:00
Hugh McMaster bdcef51bcb ext/standard: Use PKG_CHECK_MODULES to detect the Argon2 library 2019-06-12 06:54:54 +02:00
Hugh McMaster 9d61036651 ext/ldap: Use PKG_CHECK_MODULES to detect the libsasl2 library 2019-06-11 17:11:53 +02:00
Nikita Popov fa5513aefe Remove unused gmp_unary_ui_op() function 2019-06-11 17:01:29 +02:00
Nikita Popov e5411e17c7 Remove unused _setEdgePixel() and getPixelOverflowColorTC() functions 2019-06-11 16:59:12 +02:00
Nikita Popov 5c844c1d36 Fix fabs warning in gd_interpolation.c
Matches upstream code.
2019-06-11 16:57:24 +02:00
Nikita Popov 2290102172 Remove safeboolean use in gd_jpeg.c
This is a backport of
https://github.com/libgd/libgd/blob/e5502c7a3f1fe60536ec060f0211d97066c006ea/src/gd_jpeg.c.
2019-06-11 16:54:45 +02:00
Nikita Popov 0849a621fd Fix abs(long) warnings in gd.c
I'm fixing this using (int) casts instead of labs() because this is
what upstream GD does.
2019-06-11 16:50:25 +02:00
Nikita Popov fc65da5c59 Fix 32-bit warnings in timelib
This has already been fixed upstream in
https://github.com/derickr/timelib/commit/4df262e7585b2ad2c6b01a23190974f9aea298ed
so I'm backporting this change.
2019-06-11 16:14:10 +02:00
George Peter Banyard 7f5f277cf2 Remove unnecessary short_open_tag INI directive in tests
Closes GH-4249.
2019-06-11 16:14:10 +02:00
Nikita Popov e5aba0f518 Build with ldap and ldap sasl on azure
We don't set up an ldap server, so this is mainly about testing
that the build works.
2019-06-11 15:48:40 +02:00
Nikita Popov 8d3a2a4a12 Remove ext/ldap/tests/bug76248.phpt
I wasn't able to make this test work reliably in CI, and the thing
it's testing does not seem worth spending more time on it.
2019-06-11 15:47:01 +02:00
Nikita Popov 83e0bfb50c Merge branch 'PHP-7.3' into PHP-7.4 2019-06-11 15:41:05 +02:00
Joe Watkins 0cfa2e51d4 Merge branch 'PHP-7.4' of git://github.com/php/php-src into PHP-7.4 2019-06-11 15:16:16 +02:00
Joe Watkins 69190ce5c0 This reverts 0e5d4ea555 to fix the build on MacOSX
On Mac thread_local and __thread are not ABI compatible, in addition, thread_local
comes with additional overhead, __thread seems to be the most suitable linkage to use
regardless of c++/c
2019-06-11 15:13:27 +02:00
Christoph M. Becker fc9d452a17 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Next is 7.3.8
2019-06-11 13:32:14 +02:00
Nikita Popov 8f8fcbbd39 Support full variance if autoloading is used
Keep track of delayed variance obligations and check them after
linking a class is otherwise finished. Obligations may either be
unresolved method compatibility (because the necessecary classes
aren't available yet) or open parent/interface dependencies. The
latter occur because we allow the use of not fully linked classes
as parents/interfaces now.

An important aspect of the implementation is we do not require
classes involved in variance checks to be fully linked in order for
the class to be fully linked. Because the involved types do have to
exist in the class table (as partially linked classes) and we do
check these for correct variance, we have the guarantee that either
those classes will successfully link lateron or generate an error,
but there is no way to actually use them until that point and as
such no possibility of violating the variance contract. This is
important because it ensures that a class declaration always either
errors or will produce an immediately usable class afterwards --
there are no cases where the finalization of the class declaration
has to be delayed until a later time, as earlier variants of this
patch did.

Because variance checks deal with classes in various stages of
linking, we need to use a special instanceof implementation that
supports this, and also introduce finer-grained flags that tell us
which parts have been linked already and which haven't.

Class autoloading for variance checks is delayed into a separate
stage after the class is otherwise linked and before delayed
variance obligations are processed. This separation is needed to
handle cases like A extends B extends C, where B is the autoload
root, but C is required to check variance. This could end up
loading C while the class structure of B is in an inconsistent
state.
2019-06-11 13:09:33 +02:00
Nikita Popov 89b2d88659 Register class before fetching parent
We want the class declaration to be available while compiling the
parent class.
2019-06-11 13:09:33 +02:00
Joe Watkins 9ecc0a4f29 use XFAILIF rather than XFAIL to avoid warnings [ci skip] 2019-06-11 12:55:28 +02:00
Nikita Popov 51fb8dc422 Add specialized pair construction API
Closes GH-3990.
2019-06-11 12:29:55 +02:00
Remi Collet 67ecc8a326 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  next is 7.2.21
2019-06-11 12:19:39 +02:00
Joe Watkins a36e381e57 drop docker until tested locally 2019-06-11 11:09:06 +02:00
Joe Watkins e52f63bea3 Merge branch 'PHP-7.4' of git://github.com/php/php-src into PHP-7.4 2019-06-11 10:45:41 +02:00
Joe Watkins 3ef151127f checkout depth of one doesn't always work with batched builds, it seems 2019-06-11 10:42:25 +02:00
Nikita Popov eecd8961d9 Add get_mangled_object_vars() function 2019-06-11 10:28:29 +02:00
Joe Watkins 3ff489d8e8 Merge branch 'i386-azure' into PHP-7.4
* i386-azure:
  i386 build
2019-06-11 10:24:51 +02:00
Joe Watkins c2a78c7cac i386 build 2019-06-11 10:23:37 +02:00
Tyson Andre 5c8b702e77 Fix typo in opcache function flag info (mage->image)
ext/gd/gd.c seems to return null for wrong parameter count, false for
error, and long otherwise. See https://php.net/imagecolorallocate

In php 8.0, the MAY_BE_NULL can probably be removed.
2019-06-11 09:08:23 +02:00
Tyson Andre b921564a35 Clean up opcache func flags for set_socket_blocking
It was removed in php 7.0. See https://php.net/set_socket_blocking
2019-06-11 09:05:57 +02:00
Tyson Andre 98b487e244 Fix a typo in opcache func info for "get_parrent_class"
This should only have one r.
http://php.net/get_parent_class mentions that it returns string|false

Also, I'm not 100% sure if this is right - should this include
MAY_BE_NULL to handle the case of too many parameters?
(then again, get_called_class() also returns null in the global scope)

```
php > var_export(get_parent_class(2,3));
Warning: get_parent_class() expects at most 1 parameter, 2 given in php
shell code on line 1
NULL
```
2019-06-11 08:59:12 +02:00
Hugh McMaster 1e265174ed ext/pgsql: Use PKG_CHECK_MODULES to detect the pq library 2019-06-11 08:53:49 +02:00
Christoph M. Becker 27e592d3ce Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77937: preg_match failed
2019-06-11 08:44:54 +02:00
Dmitry Stogov 374f769982 micro-optimization 2019-06-10 16:43:20 +03:00
Joe Watkins 1e5004060e watchpoints have flaws in implementation 2019-06-10 14:23:37 +02:00
Joe Watkins 42d60addef BIND_LEXICAL has a meaningless line number 2019-06-10 14:19:39 +02:00
Dmitry Stogov 46df9a858c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed possible misalignment in 32-bit build.
2019-06-10 12:53:04 +03:00
Joe Watkins 52ca8ca7d5 fix flaky ipv4 loopback test 2019-06-10 10:35:31 +02:00
Peter Kokot 05a434c9c7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Extend wildcard files section in EditorConfig [ci skip]
2019-06-09 22:55:21 +02:00
Peter Kokot 2dd6ec07d1 Simplify LiteSpeed SAPI module version
This patch syncs versioning of the LiteSpeed SAPI module by making it in
sync with the rest of the bundled PHP extensions and SAPIs.

Closes #4145
2019-06-09 22:32:47 +02:00
Peter Kokot 5b36c9fef6 Use PHP_VERSION for zend modules
Closes #4147
2019-06-09 22:32:47 +02:00
Jan Altensen 0741494f30 azure macos
Change-Id: I3465dcc865c254cea02feb619f6706fa0d164757
2019-06-09 22:21:46 +02:00
Joe Watkins d116343818 azure image update [not skipping on purpose to test new configuration] 2019-06-09 13:39:35 +02:00
Joe Watkins 006b191126 Fix #78132 wrong line number on ZEND_BIND_STATIC for lexical vars 2019-06-08 21:47:07 +02:00
Dmitry Stogov f76d83ab15 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Restored NEWS entry
2019-06-07 12:39:24 +03:00
Nikita Popov d831f10724 Merge branch 'PHP-7.3' into PHP-7.4 2019-06-07 10:57:51 +02:00
Dmitry Stogov 8fbfd8872a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #77135 (Extract with EXTR_SKIP should skip $this)
2019-06-07 11:50:19 +03:00
Nikita Popov c72bc4475e Use batch mode on Azure 2019-06-07 09:53:35 +02:00
Nikita Popov 1c4e93e8bd Merge branch 'PHP-7.3' into PHP-7.4 2019-06-07 09:49:09 +02:00
Hugh McMaster d4c275d8ac ext/xsl: Use PKG_CHECK_MODULES to detect the EXSLT library 2019-06-07 09:35:14 +02:00
Hugh McMaster ab66179227 ext/xsl: Use PKG_CHECK_MODULES to detect the XSLT library 2019-06-07 09:35:12 +02:00
Peter Kokot 30a34eab81 [ci skip] Catch up with 642b8d00e0 2019-06-07 01:24:02 +02:00
Christoph M. Becker 3b05bdedcd Use zero port in socket_(export|import)_stream-4-win.phpt
These regularly fail due to port clashes, though we don't seem to
use those ports in any other tests.

As we don't care about the specific port that is used here, pass
zero so that a random ephemeral port is used.
2019-06-06 16:19:19 +02:00
Christoph M. Becker f5b44c7e8a Fix bug #78094: File Search Problem Excessive Time
Instead of checking GetBinaryType() for each file, we do a much cheaper
pre-check whether the filename extension matches .exe or .com, and call
GetBinaryType() only in this case.  For BC we also report .bat and .cmd
files as executables again.

The patch has been provided by @weltling.
2019-06-06 15:55:46 +02:00
Christoph M. Becker c358c280df Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test regarding Unix Domain Sockets on Windows
2019-06-06 15:02:41 +02:00
Nikita Popov 7780ba9660 Try to fix Windows build 2019-06-06 14:56:42 +02:00
Dmitry Stogov 741468d145 Use ZEND_ASSUME() to perform the following check only on "slow" path. 2019-06-06 14:22:10 +03:00
Dmitry Stogov be74ca4976 Support for exceptions thrown during "Array to string conversion" error processing 2019-06-06 14:09:42 +03:00
Dmitry Stogov a95014dc10 Reduce over-specialization for quite seldom instructions 2019-06-06 13:13:09 +03:00
Nikita Popov 3372f2cf2c php_zip_pcre: Match pattern before stating for directories
For two reasons: First, it's generally cheaper to match a regex than
perform a stat (especially on Windows). Second, it will not fail on
concurrent modification of a directory in parts that are not matched
by the pattern, such as the spurious failure in ext/zip/tests/bug72660.phpt.
2019-06-06 11:46:23 +02:00
Christoph M. Becker b2b528b973 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78114: segfault when calling sodium_* functions from eval
2019-06-06 10:01:12 +02:00
Dmitry Stogov 457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03:00
Dmitry Stogov 90a2e4ba66 Fixed reference-counting 2019-06-06 01:40:40 +03:00
Joe Watkins bed8ae1d0f junit testcase classname is used as filename on azure 2019-06-05 19:27:50 +02:00
Joe Watkins 6f9a06cb74 this test is flaky on azure, and can't see why from current output
so refactored, and restored an accidentally removed check (resource)
2019-06-05 19:24:41 +02:00
Dmitry Stogov 3f4dfe1877 Prevent generation of specialized ZEND_ASSIGN_OP_..._STATIC_PROP handlers, that call unspecialized helper, anyway. 2019-06-05 17:38:13 +03:00
Joe Watkins 829d046241 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix flaky posix test
2019-06-05 16:35:55 +02:00
Nikita Popov b964298c19 Deprecate ReflectionType::__toString()
We weren't able to do this in 7.1 because the deprecation notice
may be converted to an exception and __toString() can't throw,
which means that it ultimately become a fatal error. This issue
is resolved now, so we can mark the method as deprecated.
2019-06-05 15:33:52 +02:00
Nikita Popov a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Nikita Popov 528aa7932a Use zero port in socket_(export|import)_stream-5.phpt
These regularly fail due to port clashes, though we don't seem to
use those ports in any other tests.

As we don't care about the specific port that is used here, pass
zero so that a random ephemeral port is used.
2019-06-05 11:58:11 +02:00
Remi Collet a0ce1df024 ignore first gets time which is usually a few ms only
in previous version, max_ms was "1" and "10" in travis/appveyor
having 10 by default make it fails on fast computer
2019-06-05 11:48:48 +02:00
Nikita Popov 9cf6a5413a Make mysqli_connect arguments explicitly nullable
It should be possible to skip any of these (and use the ini configured
defaults) by passing null, independently of strict_types settings.

Noticed while working on GH-4227.
2019-06-05 11:30:13 +02:00
Remi Collet 8f854c1099 keep DIR option to --with-unixODBC for old versions without libodbc.pc 2019-06-05 10:56:10 +02:00
Peter Kokot ac9ce0f895 Fixed bug #78102 2019-06-05 10:04:57 +02:00
Nikita Popov 46d5a9bef9 Avoid concurrent directory writes in FilesystemIterator test
The test directory is often used for temporary files, let's use
the source directory, which should be more stable. If that doesn't
work we need to create a temporary directory.
2019-06-05 09:58:59 +02:00
Joe Watkins cb9bb146d9 add azure pipelines badge to readme [ci skip] 2019-06-04 17:11:16 +02:00
Nikita Popov 524dbee15b Merge branch 'PHP-7.3' into PHP-7.4 2019-06-04 16:28:08 +02:00
Nikita Popov f4bac9a438 Actually load opcache on Azure 2019-06-04 16:14:34 +02:00
Nikita Popov 18060e5923 Merge branch 'PHP-7.3' into PHP-7.4 2019-06-04 16:14:26 +02:00
Nikita Popov d512075ff8 Fix potential port conflicts 2019-06-04 16:11:52 +02:00
Hugh McMaster c9830f1c2c ext/zip: Replace $LIBZIP_LIBDIR with $LIBZIP_LIBS
Closes GH-4220.
2019-06-04 15:31:35 +02:00
Nikita Popov a982125561 Try to fix phpdbg + opcache compatibility 2019-06-04 15:08:55 +02:00
Christoph M. Becker 79ff867ed2 PHP 7.4 is built with Visual Studio 2019 on Windows 2019-06-04 14:41:25 +02:00
Nikita Popov 3f7210efa8 Try to make 17result.php more robust
This is our most common intermittent failure. I don't understand
why it happens and can't reproduce it, but defining an explicit
sort order seems worth a shot...
2019-06-04 12:18:21 +02:00
Nikita Popov 40f2cfe258 Azure: Don't build zend-test as shared
This is shared on Travis to perform a dl() sanity check. Revert to
building it statically here so we don't need to explicitly load it.
2019-06-04 10:18:00 +02:00
Hugh McMaster 32114b57f3 Use a common setup macro to detect the Expat library
Closes GH-4221.
2019-06-04 10:10:50 +02:00
Joe Watkins 550f95e645 should be or 2019-06-04 08:23:43 +02:00
Joe Watkins 666cc8d5da always run 2019-06-04 08:12:53 +02:00
Joe Watkins 47a953919f run/publish test on success and failure 2019-06-04 08:10:52 +02:00
Joe Watkins b2aef9e47a always run/publish tests, even when failing 2019-06-04 08:06:53 +02:00
Joe Watkins d37c335118 always run/publish tests 2019-06-04 07:50:46 +02:00
Remi Collet e0f7e7aff9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  this was in 7.3.5, not 7.3.6
2019-06-04 07:19:46 +02:00
Joe Watkins b4c1369768 correct zts flags for 7.4 2019-06-04 05:04:24 +02:00
Joe Watkins 068dd5afa8 get the name of the branch right 2019-06-03 22:47:12 +02:00
Joe Watkins 74ce812007 Set up CI with Azure Pipelines 2019-06-03 22:27:50 +02:00
Nikita Popov 117f7720be Prevent use of TLS 1.3 in stream_server_reneg_limit.phpt
TLS 1.3 does not support renegotiation, make sure this test does
not use it.
2019-06-03 18:58:52 +02:00
Nikita Popov 829f18b48d Merge branch 'PHP-7.3' into PHP-7.4 2019-06-03 15:15:22 +02:00
Nikita Popov 2856afc70e Make "MySQL server has gone away" errors more consistent
Don't generate explicit warnings for these in two places, use usual
error handling mechanism. Additionally suppress a number of warnings
if the server has gone away.
2019-06-03 14:27:47 +02:00
Joe Watkins cf9fd3735a remove reverted commit from changelog 2019-06-03 11:25:33 +02:00
Joe Watkins ff96f25b12 Revert "Fix bug #62397 - disable_functions does not work with eval."
This reverts commit 050d299364.
2019-06-03 11:20:12 +02:00
Hugh McMaster f349d790b4 ext/zip: Remove un-needed symbol check for zip_open
Closes GH-4189.
2019-06-03 09:20:31 +02:00
Hugh McMaster 310f96fd13 ext/zip: Add PHP_EVAL_LIBLINE to replace PHP_ADD_LIBRARY_WITH_PATH 2019-06-03 09:20:12 +02:00
Hugh McMaster 7ec50c24bb ext/ffi: Remove symbol check for ffi_open
Closes GH-4215.
2019-06-03 09:19:25 +02:00
Hugh McMaster d39638a4ac ext/enchant: Pass $ENCHANT_LIBS to PHP_CHECK_LIBRARY to fix shared builds
Closes GH-4216.
2019-06-03 09:18:51 +02:00
Hugh McMaster 72fe2b16f6 ext/skeleton: Update use of PHP_CHECK_LIBRARY
Closes GH-4218.
2019-06-03 09:18:22 +02:00
Jakub Zelenka 4feddd59dc Merge branch 'PHP-7.3' into PHP-7.4 2019-06-02 19:14:37 +01:00
Anatol Belski 7a64150921 Don't involve output check in the test 2019-06-01 23:31:05 +02:00
Anatol Belski 7faaeec942 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix expect section
2019-06-01 14:51:11 +02:00
Anatol Belski c4414992be Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update SDK version for AppVeyor
2019-06-01 13:44:44 +02:00
Christoph M. Becker 637d8677b3 Fix ZTS issue regarding new Windows CTRL handling API
php_win32_signal_system_ctrl_handler() is called from a kernel thread,
so the former initialization of `vm_interrupt_flag` has no effect,
since it is defined as thread-local.  This is, however, not necessary,
since the CTRL signal handling is supposed to work only for the main
thread anyway.  We therefore change `vm_interrupt_flag` and the related
variables to true globals.

This also allows us to unmark the respective test case as XFAIL.

Furthermore, `vm_interrupt_flag` is declared as `zend_bool *`, so we
better treat it such.
2019-06-01 09:35:47 +02:00
Joe Watkins d669d55fe1 skip where no groups available 2019-06-01 07:36:03 +02:00
Joe Watkins 22213de179 only clear when showing in parallel runner 2019-06-01 06:13:30 +02:00
Anatol Belski b165672e9c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Change ZPP only if compiled with ICU >= 64
  Update tests for ICU 64
2019-06-01 02:27:08 +02:00
Anatol Belski d632bede91 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix var name
2019-05-31 20:50:53 +02:00
Thomas Gerbet bfc10978ef SimpleXMLElement and ResourceBundle implement Countable
Both classes already have a count() method and are considered
countable by \is_countable().
2019-05-31 18:59:19 +02:00
Nikita Popov 7f26171445 Remove confusing spkstr checks
This is a required parameter, it can never be NULL.
2019-05-31 17:00:00 +02:00
Nikita Popov 8a8bc5c452 Update tests for ICU 64 2019-05-31 15:39:03 +02:00
Nikita Popov 4ef7f70987 Fix NO_INTERACTION handling in parallel test runner
This printing shouldn't depend on NO_INTERACTION, the variable that
controls this is SHOW_ONLY_GROUPS.
2019-05-31 14:03:22 +02:00
Nikita Popov 67b84e4548 Fixed uninitialized var warning
Causes build failure on release+zts azure build. I'm rewriting this
code to separate the if/else handling, because they don't really
have anything in common anyway...
2019-05-31 12:55:13 +02:00
Nikita Popov dd2bf44869 Add junit support for parallel test runner 2019-05-31 12:38:06 +02:00
Nikita Popov 137747bdaf run-tests: Remove redundant 'suites' key
We don't have nestead testsuites or similar, so drop this confusing
key.
2019-05-31 12:04:23 +02:00
Dmitry Stogov 1df9f238fe Better hot/cold code splitting 2019-05-31 12:20:21 +03:00
Nikita Popov 84333cad67 Remove stream_socket_sendto.phpt
Fails for me locally due to different number of warnings with
different messages. Rather than adding more wildcards I'm dropping
this test entirely, as it doesn't seem to test anything particularly
useful.
2019-05-31 11:09:56 +02:00
Nikita Popov 96a11bee1c Add CONFLCITS file for fpm
We should not run FPM tests in parallel due to port clashes.
2019-05-31 10:54:41 +02:00
Nikita Popov 4b1f711823 Mark sapi_windows_set_ctrl_handler.phpt as XFAIL 2019-05-31 09:17:51 +02:00
Dmitry Stogov 2915a32f37 Fixed compilation warning 2019-05-31 00:59:52 +03:00
Dmitry Stogov 1814308e49 Don't specialize "cold" handlers 2019-05-31 00:31:57 +03:00
Dmitry Stogov 4e567ed1da Removed useless specialization. Specialized handlers called not specialized helpers. 2019-05-31 00:15:25 +03:00
Dmitry Stogov cf388033d5 Reduce register pressure by reloading values on CPUs with few general purpose registers 2019-05-31 00:14:10 +03:00
Craig Duncan a08b3b6d19 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add a test for bug #65672
  Ensure the internal properties cannot be overwritten
2019-05-30 19:14:04 +01:00
Dmitry Stogov ee56552913 Disable "bad" optimisations only for emulation loop 2019-05-30 20:35:30 +03:00
Anatol Belski 2ba9177d4f [ci skip] Update libmagic.patch 2019-05-30 14:09:00 +02:00
Anatol Belski 6c62a074bb [ci skip] Update year 2019-05-30 14:02:54 +02:00
Anatol Belski a27eb4d7e1 [ci skip] Update NEWS 2019-05-30 13:59:21 +02:00
Anatol Belski aed9a64cf6 Add test for bug #78075, json detection 2019-05-30 13:31:48 +02:00
Joe Watkins a3879208c5 have parallel test runner respect NO_INTERACTION 2019-05-30 07:46:31 +02:00
Anatol Belski 0c8454c02d Partially reapply ba40f505e5 2019-05-30 02:48:01 +02:00
Anatol Belski 57c23df142 Fix datatype 2019-05-30 02:34:35 +02:00
Anatol Belski 622b10f06e Ported limagic 5.37 2019-05-30 02:22:40 +02:00
Nikita Popov 24e22eb31b Run sapi tests when running all tests 2019-05-29 17:07:12 +02:00
Nikita Popov 3ba64545ed Update phpdbg oplog test 2019-05-29 17:05:01 +02:00
Nikita Popov b32b8e91bd Update cli reflection test 2019-05-29 17:02:36 +02:00
Nikita Popov 43be89ed87 Remove two zpp tests in sapi/cli/tests
These fail on master -- apparently we're not running these tests...
2019-05-29 17:00:12 +02:00
Nikita Popov 029b735a6e Merge branch 'PHP-7.3' into PHP-7.4 2019-05-29 16:48:28 +02:00
Dmitry Stogov b06f05bf47 zend_assign_to_variable() optimization 2019-05-29 13:58:37 +03:00
Dmitry Stogov e14d77335c Mark "cold" functions 2019-05-29 11:48:41 +03:00
Derick Rethans 8ec0cf8be7 Bump API numbers 2019-05-29 09:34:10 +01:00
Nikita Popov 3bd5b83615 Specify get_property_ptr_ptr handler for DatePeriod
This handler is required on 7.4. Just return NULL from it to fall
back to read_property.
2019-05-29 09:51:15 +02:00
Nikita Popov 5a0df6a414 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-29 09:47:54 +02:00
Dmitry Stogov 0d102515bf zend_do_fcall_overloaded() doesn't have to be exported 2019-05-29 10:32:30 +03:00
Christoph M. Becker 7ca0ac8dc7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS for 7.3.6
2019-05-29 09:27:46 +02:00
Gabriel Caruso 8c7757c233 Remove unused variable 2019-05-29 09:09:17 +02:00
Remi Collet 96030118a2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  add NEWS entries for sec fix
2019-05-29 08:53:59 +02:00
Joe Watkins cc598d1ea9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  disabled functions must not have return type
  Restore the execute bit for run-tests.php
2019-05-29 08:30:55 +02:00
Anatol Belski 08a0030b33 Fix conditional compilation
The new symbols are shared and don't need to depend on the availability
of __builtin_constant_p.
2019-05-29 02:40:09 +02:00
Anatol Belski 1a4ace05ae These macros should not expect any argument 2019-05-29 02:29:02 +02:00
Dmitry Stogov 8c0b0c6a1e Avoid cold code duplication 2019-05-29 01:43:27 +03:00
Dmitry Stogov 83804519df Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros 2019-05-28 20:10:02 +03:00
Nikita Popov 071b389bc6 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-28 16:41:17 +02:00
Nikita Popov f19dd674e0 SCCP: Fix handling of ASSIGN_OBJ_REF
The generic BOT handling is not away of OP_DATA, so need to handle
this opcode before we get to that.
2019-05-28 16:15:37 +02:00
Dmitry Stogov 6738241aec Avoid usage of internal get/set object handlers. They are going to be removed in PHP-8.
Scalar FFI values now should be accessed through special "cdata" property.

    $x = FFI::new("int");
    $x = 42;

    should be changed into

    $x = FFI::new("int");
    $x->cdata = 42;
2019-05-28 17:08:35 +03:00
Nikita Popov 6893f1f98e SCCP: Don't perform partial object propagation for typed props 2019-05-28 15:46:03 +02:00
Dmitry Stogov b2cb6a4a27 Avoid double copying 2019-05-28 13:35:00 +03:00
Dik Takken 77cf3d7b11 Allow array_merge() / array_merge_recursive() without arguments
This allows writing

    array_merge(...$arrays)

instead of

    array_merge([], ...$arrays)

and is in line with similar changes to array_push() and array_unshift()
in PHP 7.3.

Closes GH-4175.
2019-05-28 11:14:15 +02:00
Dmitry Stogov 072f28938f Put phpinfo() related code into cold code segment 2019-05-28 11:04:13 +03:00
Joe Watkins 2c6bc99019 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  bump version after release
2019-05-28 09:54:47 +02:00
Stanislav Malyshev ffc15e913c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #77967 - Bypassing open_basedir restrictions via file uris
2019-05-27 21:36:10 -07:00
Stanislav Malyshev 670c2ee685 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #77988 - heap-buffer-overflow on php_jpg_get16
2019-05-27 17:28:29 -07:00
Stanislav Malyshev 892a188fc9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix function name
2019-05-27 17:21:28 -07:00
Stanislav Malyshev 5e3dc08826 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
  Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow
  Fix #77973: Uninitialized read in gdImageCreateFromXbm
2019-05-27 16:49:31 -07:00
Christoph M. Becker c12d474653 Prevent parallel test conflicts
These ports are already used by another test, so we change them.
2019-05-27 18:42:52 +02:00
Nikita Popov adec208bdb Merge branch 'PHP-7.3' into PHP-7.4 2019-05-27 17:44:11 +02:00
Nikita Popov fd23f9104a BIND_STATIC of implicit binding may be undef
Even though we don't need it at runtime, add the BIND_IMPLICIT
flag to BIND_STATIC as well, so we can distinguish this case in
type inference.

This fixes a JIT miscompile in arrow_functions/002.phpt.
2019-05-27 17:12:20 +02:00
Nikita Popov 070f877b76 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-27 16:15:03 +02:00
Nikita Popov 7cc17c4aac Merge branch 'PHP-7.3' into PHP-7.4 2019-05-27 16:14:16 +02:00
Nikita Popov 62f339c8d5 Func info: Fix calls to zero-arg varargs
The num_args does not include variadics, so a "zero-arg" function
may accept additional arguments through that. No functions seem
to be affected right now, but they will be after #4175.
2019-05-27 16:12:42 +02:00
Dmitry Stogov 6a4ec6c7e4 Enable pcre valgrind support only in DEBUG build (it affects performance) 2019-05-27 16:20:20 +03:00
Hugh McMaster a8f4e8fe73 ext/xml: Use PKG_CHECK_MODULES to detect the Expat library 2019-05-27 15:16:42 +02:00
Dmitry Stogov 62ded6efbc Align .text segment for better huge pages usage 2019-05-27 13:37:19 +03:00
Gabriel Caruso 4bb6f9ba99 Make more tests run on Windows 2019-05-27 10:51:53 +02:00
Nikita Popov e6fac86dc3 Accept flags argument in zend_lookup_class_ex()
Instead of a single boolean, so we have space for extension here.
2019-05-27 09:36:25 +02:00
Jakub Zelenka cd6b7ebb68 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-26 18:51:10 +01:00
Anatol Belski aa9433e928 Upgrade bundled PCRE2 to 10.33 2019-05-25 11:37:30 +02:00
Hugh McMaster ef34e00df3 Use PKG_CHECK_MODULES to detect valgrind, and share build config with pcre 2019-05-25 09:04:22 +02:00
Peter Kokot e7a1409fe1 Define minimum required libffi version 2019-05-25 08:12:15 +02:00
Nikita Popov 32f87bb575 Add UPGRADING/NEWS entries 2019-05-24 11:00:13 +02:00
Nikita Popov d7f3844c87 Deprecate use of parent where no parent exists
This deprecation is part of the covariance RFC.
2019-05-24 10:58:46 +02:00
David Carlier d9747c23a2 list net/interfaces, trying to get the error on windows when possible 2019-05-24 10:22:39 +02:00
Nikita Popov 49a3b03e9f Implement basic variance support
This is a minimal variance implementation: It does not support any
cyclic type dependencies. Additionally the preloading requirements
are much more restrictive than necessary. Hopefully we can relax
these in the future.
2019-05-24 09:30:37 +02:00
Nikita Popov afec3a9208 Avoid early-binding on unresolved types
Fixes bug #76451, and more importantly lays necessary groundwork for
covariant/contravariant types. Bug #76451 is just an edge case, but
once covariance is introduced this will become a common problem instead.
2019-05-24 09:30:13 +02:00
Nikita Popov 71ce7d32ea Merge branch 'PHP-7.3' into PHP-7.4 2019-05-23 13:41:17 +02:00
Christoph M. Becker c70975e0a5 Prevent further potential test conflicts
These tests partially use the same resource names; as a quick-fix we're
marking them all as conflicting.
2019-05-23 13:14:04 +02:00
Joe Watkins 979e7d0fee fix notice in run-tests 2019-05-23 13:09:18 +02:00
Christoph M. Becker ced8760ca8 Prevent potential test conflict
bug48746_tmp.lnk is also created by bug48746_2.phpt which might clash,
if both are run simultaneouly.
2019-05-23 11:40:39 +02:00
Nikita Popov fc8fb77262 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-23 11:13:14 +02:00
Joe Watkins e1151c9549 run-tests improvements:
Add XLEAK section, this is made necessary by the support
  for valgrind tools other than memcheck.
  XLEAK is to a leaking test what XFAIL is to a failing test.
  Tidy up summary a little to exclude Expected Fail and Expected Leak
  when there are no expected fail/leaks
2019-05-23 10:55:25 +02:00
Nikita Popov 64918c7702 Forbid use of not fully linked classes 2019-05-23 10:41:10 +02:00
Dmitry Stogov fdb7fc6153 Fixed double mutex unlock 2019-05-23 11:20:46 +03:00
Nikita Popov dcccdc471d Don't require NO_ESCAPE for partial arrays in SCCP 2019-05-23 09:59:25 +02:00
Dmitry Stogov 5de750f41c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed race condition in opcache restart
2019-05-23 00:21:15 +03:00
Dmitry Stogov fe1db0c3d7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed dump of constant flags
2019-05-22 23:00:26 +03:00
Joe Watkins 536532c572 add support for valgrind tools to run-tests.php 2019-05-22 20:20:13 +02:00
Nikita Popov 7f68d5b7d8 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-22 12:45:25 +02:00
Christoph M. Becker 21bf9b0f4c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test case for cURL 7.65.0
2019-05-22 12:02:43 +02:00
Nikita Popov b162c8f55a Mark bug44811.phpt as an online test
For some reason this was checked on PHP-7.2 and PHP-7.3, but not
on PHP-7.4. Bad merge?
2019-05-22 11:43:56 +02:00
Nikita Popov ce8be6f499 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-22 11:43:40 +02:00
Dmitry Stogov 7c99589be2 .text segment may be not the first one 2019-05-22 12:20:34 +03:00
Nikita Popov ff4b0ce0e8 Fix bug #78034
Don't def non-cv variables in assign_obj_ref data operand.
2019-05-22 09:35:38 +02:00
Jaroslav Hanslík d6c0c5ef8e Fixed some arg infos to match documentation 2019-05-22 09:05:32 +02:00
Hugh McMaster 9df3e097b8 Use PKG_CHECK_MODULES to detect unixODBC 2019-05-22 09:04:05 +02:00
Rasmus Lerdorf 12c1d7419a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix precedence issue causing sub-second timeouts to be 0 in curl_multi_select
2019-05-21 14:46:44 -07:00
Nikita Popov f260c0918f Merge branch 'PHP-7.3' into PHP-7.4 2019-05-21 17:35:28 +02:00
Nikita Popov 436a47428b Merge branch 'PHP-7.3' into PHP-7.4 2019-05-21 17:17:45 +02:00
Nikita Popov a87448bb55 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-21 17:03:52 +02:00
Remi Collet 9ef03a94ba sodium: fix shared build 2019-05-21 16:14:52 +02:00
Remi Collet 1f8b9b8de6 enchant: fix shared build 2019-05-21 16:14:52 +02:00
Christoph M. Becker 8ba10b8fbc Fix ASLR related invalid opline handler issues
Opcache stores `opline->handler`s in shared memory.  These pointers are
invalid, if the main PHP DLL is loaded at another base address due to
ASLR.  We therefore store the address of `execute_ex` in the mmap base
file, and check on startup whether it matches its current address.  If
not, we fall back on the file cache if enabled, and bail out otherwise.

This still does not address cases where the opline handler is located
inside of another DLL (e.g. for some profilers, debuggers), but there
seems to be no general solution for now.
2019-05-21 14:33:33 +02:00
Remi Collet 24206783c3 fix typo breaking shared build 2019-05-21 14:25:55 +02:00
Christoph M. Becker ee9908683b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Prevent test case failure
2019-05-21 11:19:05 +02:00
Nikita Popov ef06a7bbda Merge branch 'PHP-7.3' into PHP-7.4 2019-05-21 10:05:03 +02:00
Christoph M. Becker c982a4c3f9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  use {TMP} placeholder in phpt tests
2019-05-21 09:03:20 +02:00
Dmitry Stogov e2f8d906cf Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Prevent race condition in opcache_reset()
2019-05-21 00:08:12 +03:00
Dmitry Stogov f53b9939fe Fixed bug #78014 (Preloaded classes may depend on non-preloaded classes due to unresolved consts) 2019-05-20 18:15:38 +03:00
Christoph M. Becker 5f1d76a2c4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test wrt. opcache.error_log
2019-05-20 11:11:06 +02:00
Joe Watkins e11233dc49 Revert "Rename *.l files to *.re"
This reverts commit 969047749d.
2019-05-20 06:06:38 +02:00
Peter Kokot f45b61b898 [ci skip] Migrate Coding standards docs to Markdown 2019-05-18 21:41:38 +02:00
Peter Kokot fafcdc4d57 Move CODING_STANDARDS to CODING_STANDARDS.md 2019-05-18 21:39:26 +02:00
Gabriel Caruso 714d9fc358 Make chr ZPP failure message consistent with ext/standard 2019-05-18 15:59:07 -03:00
Peter Kokot 256100a9b5 [ci skip] Join Zend engine docs-alike files to readme 2019-05-18 20:39:18 +02:00
Peter Kokot 29bff939c7 Enhance makedist script
This enhances the makidst script:
- integrate both snapshot and makedist scripts together
- add help and options
- generated files are created in the php-src repository directly
- other minor enhancemenets such as CS fixes
- functionality moved from the Makefile to only shell script
- Add missed patching of the Zend Parsers to the main build step
- Add all *.tmp files to gitignore
2019-05-18 02:05:59 +02:00
Peter Kokot 969047749d Rename *.l files to *.re
This syncs PHP lexer files to all use *.re extension. The *.re files are
processed with the RE2C tool.
2019-05-17 23:53:03 +02:00
Peter Kokot 63ef554fe4 Move copyright/license headers to CONTRIBUTING.md
These are more like a general contribution guidelines for the new files
added to the php-src repository.
2019-05-17 23:45:05 +02:00
Peter Kokot 0f7d641724 Add enchant pkg-config notice in UPGRADING 2019-05-17 19:39:22 +02:00
Hugh McMaster 0655191a9c Use PKG_CHECK_MODULES to detect the Enchant library 2019-05-17 19:31:30 +02:00
Peter Kokot 83bfbc2903 Use *.data for tests data files 2019-05-17 19:04:43 +02:00
Christoph M. Becker d3c95db18c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78025: segfault when accessing properties of DOMDocumentType
2019-05-17 13:32:53 +02:00
Peter Kokot bd1bd38a35 Use *.data for fixture files 2019-05-17 03:59:23 +02:00
Peter Kokot 16e910ccfd Update UPGRADING about LiteSpeed 2019-05-17 03:18:02 +02:00
Peter Kokot 8e456d3b9e Rename configure --with-litespeed to --enable-litespeed
This syncs the configuration option of the litespeed module to be
compliant with the approach of:
--with-foo (when something additional needs to be installed such as
  libfoo)
--enable-foo (when extension/sapi doesn't have dependencies on some
  library)
2019-05-17 03:14:13 +02:00
Bob Weinand cbc90b1f6e Merge branch 'deprecate_concat_add_sub' into PHP-8.4 2019-05-16 18:31:28 +02:00
Peter Kokot ab2710c8d0 Rename *.tif to *.tiff for consistency
There really isn't any practical difference between these two, but repo
currently uses *.tiff files more than 8.3 variant filenames of *.tif.
Also these aren't part of the test.
2019-05-16 07:41:45 +02:00
Nikita Popov 806db1a793 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-15 14:36:45 +02:00
Nikita Popov c666f6ec3b Merge branch 'PHP-7.3' into PHP-7.4 2019-05-15 12:49:03 +02:00
Christoph M. Becker b5f0bdc237 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS regarding re-tagging 7.3.6RC1
2019-05-15 11:32:43 +02:00
Dmitry Stogov f9e8015847 Removed ability to compile PHP without EX(run_time_cache). ZEND_EX_USE_RUN_TIME_CACHE was always defined. 2019-05-15 11:06:26 +03:00
Sara Golemon a94bee32ef Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Bump for 7.2.20
2019-05-14 20:23:41 -04:00
Peter Kokot c27b531af7 Update changelogs 2019-05-15 00:00:01 +02:00
Benjamin Eberlei 050d299364 Fix bug #62397 - disable_functions does not work with eval. 2019-05-14 23:49:55 +02:00
Peter Kokot f1a53501e6 Rename *.dat to *.data for common file type
File extension in this case is not part of the test.
2019-05-14 23:31:42 +02:00
Peter Kokot b4dec0e11d Enhance the tokenizer data generator script
Changes:
- executable from any location (for example, project root)
- some minor common shell scripts CS fixes
- error reporting done based on the presence of the parser file
2019-05-14 21:50:29 +02:00
a07d422ade Warn about non well-formed arguments in bcmath
Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
Co-Authored-By: Christoph M. Becker <cmbecker69@gmx.de>
2019-05-14 15:04:21 +02:00
Nikita Popov 3f19f5112a Add RETURN_EMPTY_ARRAY() / RETVAL_EMPTY_ARRAY()
The usual wrappers around ZVAL_EMPTY_ARRAY()...
2019-05-14 14:59:10 +02:00
Dmitry Stogov 7bc4bd0229 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Moved NEWS entry
  Fixed possible crashes, because of inconsistent PCRE cache and opcache SHM reset
2019-05-14 15:09:17 +03:00
Christoph M. Becker 2244a7d9af Prevent further potential test conflicts 2019-05-14 13:19:58 +02:00
Christoph M. Becker 46ae5648ca Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Prepare 7.3.7-dev
2019-05-14 11:45:42 +02:00
Christoph M. Becker ac828b9394 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test case
2019-05-14 10:26:05 +02:00
Christoph M. Becker 15b394cce9 Prevent test conflicts 2019-05-14 10:11:29 +02:00
Peter Kokot dcfc289732 Update changelog 2019-05-14 03:20:03 +02:00
Peter Kokot 47350ba6e7 Use pkg-config for sqlite3 and pdo_sqlite
Following other migrations to pkg-config usage for the *nix build system
this migrates also sqlite3 and pdo_sqlite extensions.
2019-05-14 03:14:33 +02:00
Peter Kokot 44952cd9d4 Add extensions naming conventions to ext_skel.php
- first character is a letter
- followed by any number of letters, numbers, or underscores
- prefferred are lower case letters
2019-05-14 03:04:40 +02:00
Peter Kokot 63e43e19ea Convert CRLF to LF 2019-05-14 02:59:06 +02:00
Dmitry Stogov 9b18afcbca Fixed test on platforms that don't support fastcall calling convention 2019-05-14 00:21:00 +03:00
Peter Kokot da293a8ec4 Remove example file for pgsql extension
This removes the example script in favour of the manual:
https://www.php.net/manual/en/book.pgsql.php

Patch for integrating these functions as an example has been submitted
also to PHP manual via edit.php.net.
2019-05-13 22:14:58 +02:00
Jakub Zelenka 5036c293b3 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-13 18:51:41 +01:00
CHU Zhaowei e829d08729 Implement spread operator in arrays
RFC: https://wiki.php.net/rfc/spread_operator_for_array

Closes GH-3640.
2019-05-13 14:42:43 +02:00
Dmitry Stogov 49de3ce3ca Check for supported libffi ABI 2019-05-13 15:15:51 +03:00
Christoph M. Becker 2e8518fdcf Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78003: strip_tags output change since PHP 7.3
2019-05-13 13:11:07 +02:00
Dmitry Stogov 3322ae2eb2 ARM64 may be big endian 2019-05-13 13:33:03 +03:00
Dmitry Stogov 071793a0bb Load 8 bytes at a time in hash_func. (Sebastian Pop) 2019-05-13 12:34:53 +03:00
Nikita Popov bec6ff9021 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-13 11:06:35 +02:00
GITSRC 5d3337076b Require semicolon after SAVE_CURL_ERROR() 2019-05-13 11:01:37 +02:00
Vincent JARDIN c55af3c65a Support content_type stream context option in soap
Allows overriding the HTTP header using the HTTP context:

    $client = new SoapClient('http://url.wsdl&v=latest', [
      'stream_context' => stream_context_create([
        'http' => [
          'content_type' => 'foobarX',
        ],
      ]),
    ]);
2019-05-13 10:51:03 +02:00
Christoph M. Becker 357da6bc59 Deprecate and ignore $version parameter of curl_version()
`curl_version()`[1] (of ext/curl) makes `curl_version_info()`[2] (of
libcurl) available to PHP userland.  The latter requires to pass an
`age` argument which usually is `CURLVERSION_NOW`, so that the
information returned by the runtime matches the declarations used
during compile time.  For C programs it is simply necessary to pass
this information, and in rare occasions it might make sense to pass
something else than `CURLVERSION_NOW`.  curl.h notes:

| The 'CURLVERSION_NOW' is the symbolic name meant to be used by
| basically all programs ever that want to get version information.

For the PHP binding, using a newer `age` than available at compile time
will neither provide the PHP program more information, nor would using
an older `age` have tangible benefits.

We therefore deprecate the useless `$version` parameter, and if it is
passed nonetheless, we use `CURLVERSION_NOW` instead of the supplied
value, and raise a warning.

[1] <https://www.php.net/manual/en/function.curl-version.php>
[2] <https://curl.haxx.se/libcurl/c/curl_version_info.html>
2019-05-13 08:53:41 +02:00
Peter Kokot addf2ad5fd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Convert CRLF to LF
2019-05-13 03:53:49 +02:00
Peter Kokot ecb6a8db63 [ci skip] Remove outdated fastcgi info in favor of the manual 2019-05-13 02:57:20 +02:00
Peter Kokot 812dbed0e9 [ci skip] Refactor libgd docs
Changes to simplify managing libgd docs a bit:
- Move copyright statement and licensing info to common redistributable
  bins file. All previous notices left intact and updated with the
  upstream info.
- Remove unsynced and difficult to track README file compared to
  upstream README.md file available at https://github.com/libgd/libgd
2019-05-12 23:51:39 +02:00
Peter Kokot 6abc6baa2a [ci skip] Migrate intl error conventions docs to Markdown 2019-05-12 23:24:03 +02:00
Peter Kokot 1c53afbe32 [ci skip] Migrate oci8 README to Markdown 2019-05-12 22:09:09 +02:00
Peter Kokot 83e565e244 [ci skip] Migrate tests READMEs to Markdown 2019-05-12 22:03:10 +02:00
Peter Kokot 340da47167 [ci skip] Migrate libxmlrpc README to Markdown 2019-05-12 21:08:06 +02:00
Peter Kokot 75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Theodore Brown e96c776bd5 Fix typos in upgrade notes 2019-05-12 17:36:48 +02:00
Christoph M. Becker b3085bd0d4 Prevent race conditions
Since all current ODBC test cases use the same DSN, there may be
conflicts when running tests in parallel.  We prevent this by adding a
CONFLICTS marker which might be unnecessarily general, but get's the
job done, and still can be refined later.
2019-05-12 17:16:41 +02:00
Peter Kokot f1552c864f Remove unused variable 2019-05-12 03:23:37 +02:00
Vinicius Dias 188ece856d Remove duplicate variables
Removing duplicate variables `$beginDtObj` and `$beginTimestamp`.
2019-05-12 03:02:38 +02:00
Hugh McMaster 3ece7df9cf Use PKG_CHECK_MODULES to detect the iODBC library 2019-05-12 01:36:46 +02:00
Hugh McMaster 755f6f6ede Use PKG_CHECK_MODULES to detect the systemd library 2019-05-12 00:19:03 +02:00
Jakub Zelenka 4bf37e467b Merge branch 'PHP-7.3' into PHP-7.4 2019-05-11 20:10:13 +01:00
peter279k d0ac3a6a86 Using PDO instead because of consistency 2019-05-11 21:05:49 +02:00
David Carlier 1f3f54f586 list interfaces/adding just "binary" state status. 2019-05-11 20:29:09 +02:00
Peter Kokot 836bbb4e2c Remove dead DEBUG_CFLAGS setting
The USE_MAINTAINER_MODE has been removed via
a4c484a4d8 and
43ed903949
2019-05-11 19:53:14 +02:00
Peter Kokot f7cdac6c97 Remove unused symbol definition 2019-05-11 19:47:54 +02:00
Peter Kokot 9219e56063 Remove redundant memory.h file
The memory.h file is part of the pre-C89 era and is on today's systems
only a simple wrapper for including the final string.h header file.
2019-05-11 19:47:54 +02:00
Peter Kokot 3a4df95793 Simplify ext/mbstring/libmbfl/config.h creation
- The config.h.in is part of the standalone libmbfl library and it is
  forked and bundled.
2019-05-11 19:44:40 +02:00
Peter Kokot ab257ed320 Integrate libmbfl docs to README.md and LICENSE
- All credits, license info preserved, only merged together to not have
  to many places to edit.
- Changelogs integrated in the readme since they are not used anymore.
2019-05-11 18:29:30 +02:00
Peter Kokot 4e0e0b8152 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Convert CRLF to LF in *.wsdl files
2019-05-11 17:16:50 +02:00
Peter Kokot 8ef2121ee1 Fix comment to match the future zts configuration option 2019-05-11 15:03:17 +02:00
Peter Kokot 4bfb86cdca Remove ffi README in favour of docs
- https://www.php.net/manual/en/book.ffi.php
- The FFI C parser is mentioned in the CONTRIBUTING.md file
2019-05-11 14:51:14 +02:00
Christoph M. Becker 330d773b3c Prevent race condition
This test may conflict with readdir_variation3.phpt otherwise.
2019-05-11 09:52:19 +02:00
Peter Kokot a68e0767b3 Rename *.jpeg files to *.jpg
These file extensions are not part of these tests and *.jpg is more
common.
2019-05-11 03:22:19 +02:00
Peter Kokot e586d3f447 Bump config.guess and config.sub
```
wget -O config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
wget -O config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
```
2019-05-11 00:24:26 +02:00
Peter Kokot 313930a36a Remove unused variables 2019-05-10 22:58:14 +02:00
Christoph M. Becker 1b0a33ec59 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix typo
2019-05-10 18:46:18 +02:00
Kalle Sommer Nielsen a2a84af4ed Merge branch 'PHP-7.4' of git.php.net:/php-src into PHP-7.4 2019-05-10 02:38:12 +03:00
Kalle Sommer Nielsen f13fdeadd6 NEWS and UPGRADING for the scatter filter 2019-05-10 02:37:02 +03:00
Kalle Sommer Nielsen bcd11a1dfb Implemented the gdScatter filter I wrote almost 10 years ago
This filter is available as of libgd 2.1.0 which is our bare minimum for
external compilation of ext/gd.

The scatter filter works by iterating over all pixels in the image and
shifting them randomly based on two modifier (`plus` and `sub`) values:

dest_x = (int)(x + ((rand() % (plus - sub)) + sub));
dest_y = (int)(y + ((rand() % (plus - sub)) + sub));

Additionally the scatter filter also supports by only shifting pixels where
the current pixel being iterated is one or more colors, allowing the scatter
filter to only effect solid colors in part of an image.

Note, due to the nature of randomness and implementation, pixels who were
shifted ahead of iteration will be shifted once more and therefore the
bottom right of an image may contain a slight scatter effect due to this.
2019-05-10 02:23:40 +03:00
Peter Kokot 1ab3704143 Remove unused variable 2019-05-10 01:05:19 +02:00
Peter Kokot f7b62b115e Remove dead code from configure.ac
SAPI apache has been removed and now there is apache2handler so this
warning hasn't been used for a while.
2019-05-10 00:44:09 +02:00
Peter Kokot 8fc21d5cd6 Disable checking for library in ext skeleton 2019-05-10 00:21:09 +02:00
George Wang dc63b0e480 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-09 18:15:48 -04:00
Peter Kokot ec518aef10 Remove unused functions
- _get_zval_ptr_cv_deref_BP_VAR_UNSET
- _get_zval_ptr_cv_deref_BP_VAR_IS
- _get_zval_ptr_cv_deref_BP_VAR_RW
- _get_zval_ptr_cv_deref_BP_VAR_W
2019-05-09 19:07:24 +02:00
Christoph M. Becker d0d290d4aa Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix erroneous assertions
2019-05-09 16:56:57 +02:00
Hugh McMaster 0025a39b45 Update the extension template file to use PKG_CHECK_MODULES 2019-05-09 16:05:46 +02:00
Nikita Popov d0a56f707f Fixed bug #71030
Make sure to always fetch the RHS of a list assignment first, instead
of special casing known self-assignments, which will not detect cases
using references correctly.

As a side-effect, it is no longer possible to do something like
byRef(list($x) = $y). This worked by accident previously, but only
if $y was a CV and the self-assignment case did not trigger.
However it shouldn't work for the same reason that byRef($x = $y)
doesn't. Conversely byRef(list(&$x) = $y) and byRef($x =& $y)
continue to be legal.
2019-05-09 14:31:39 +02:00
Nikita Popov 4b40a46bf1 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-09 12:36:20 +02:00
Christoph M. Becker 9840a11117 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix log_verbosity_bug.phpt
2019-05-09 12:16:16 +02:00
Nikita Popov 54be40113d Fixed bug #77951
Treat singleton references as non-references in ReflectionReference
and return null for them.
2019-05-09 12:02:16 +02:00
Peter Kokot 3c92b79ea0 Remove unused functions
- zend_mm_bitset_find_zero
- zend_mm_bitset_find_one
- zend_mm_bitset_find_zero_and_set
- zend_is_by_ref_func_arg_fetch
2019-05-08 22:02:39 +02:00
Peter Kokot 99b94fbb5c Remove redundant example/test libsodium.php file 2019-05-08 22:00:22 +02:00
Peter Kokot 71acd7a2f7 Remove unused example/test fileinfo.php script 2019-05-08 21:58:52 +02:00
Peter Kokot 05350e621b Remove example PHP script from FFI
FFI README.md already includes the PHP example with more information.
2019-05-08 21:55:59 +02:00
Peter Kokot 4eb67310a0 Remove vcsclean script
The vcsclean script is really only a wrapper for a git clean command.
Developers should use the more proper and clear native Git command
directly instead:
`git clean -Xfd`
2019-05-08 21:51:01 +02:00
Christoph M. Becker ec10e191c4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add {TMP} placeholder for PHPT INI sections
2019-05-08 19:26:02 +02:00
Nikita Popov e4e6820d10 Use fast zpp for ReflectionClass constructor
At this point zpp overhead makes up a significant part of this
function.
2019-05-08 17:06:00 +02:00
Dmitry Stogov 90e285f6fd Improve PHP hash function.
See Daniel Lemire's blog post https://lemire.me/blog/2016/07/21/accelerating-php-hashing-by-unoptimizing-it/
2019-05-08 16:47:12 +03:00
Nikita Popov ee0fc1b5ae Optimize $name/$class property population in reflection
Instead of going through write_property, directly assign to the
respective property slot.
2019-05-08 15:43:42 +02:00
Nikita Popov f778e1a0b2 Refactor inheritance type check implementation
Extract the self/parent name resolution code and drop unnecessary
string copies/releases. Store the fe/proto types in local variables.
2019-05-08 12:13:06 +02:00
Nikita Popov 5c474010fb Deduplicate inheritance type check implementation
Make the check covariant (insofar as it is allowed now, i.e.
nullability and iterable) and call it with appropriate argument
order for both parameter and return types.

This makes it simpler to extend to full variance support.
2019-05-08 11:51:23 +02:00
Nikita Popov d5ef9c5b28 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-08 11:38:03 +02:00
Christoph M. Becker 72e1da81b6 Deprecate CURLPIPE_HTTP1
`CURLPIPE_HTTP1` is deprecated and has no effect as of cURL 7.62.0[1].
We therefore deprecate the PHP constant as well, and trigger a warning
that it is no longer supported, if used against cURL 7.62.0 and up.

[1] <https://curl.haxx.se/libcurl/c/CURLMOPT_PIPELINING.html>
2019-05-07 17:05:07 +02:00
Sebastian Pop 6fad150cfd [AArch64] Use NEON to initialize zend_hash
On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------------
Benchmark                    Time             CPU   Iterations
--------------------------------------------------------------
BM_hash_init_before       43.6 ns         43.6 ns     16052937
BM_hash_init_after        27.0 ns         27.0 ns     25877296

Patch written by Ali Saidi <alisaidi@amazon.com>
and Sebastian Pop <spop@amazon.com>
2019-05-07 16:21:44 +02:00
Nikita Popov 7929f83078 Add --with-ffi on Travis 2019-05-07 15:44:22 +02:00
Nikita Popov 645ebcdfbf Avoid some maybe uninitialized warnings in ffi
All false positives.
2019-05-07 15:44:22 +02:00
Sebastian Pop 79a84e00fa speed up increment and decrement operators with overflow detection
On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------
Benchmark              Time             CPU   Iterations
--------------------------------------------------------
BM_inc_before       6.54 ns         6.54 ns    106985447
BM_dec_before       6.54 ns         6.54 ns    107011667
BM_inc_after        4.36 ns         4.36 ns    160525864
BM_dec_after        4.36 ns         4.36 ns    160524243

Before the patch:
fast_long_add_function:
	ldr	x0, [x1]
	add	x2, x0, 1
	cmp	x2, x0
	blt	.L11
	str	x2, [x1]
	ret
.L11:
	mov	x0, 4890909195324358656
	mov	w2, 5
	str	x0, [x1]
	str	w2, [x1, 8]
	ret

With the patch:
fast_long_add_function:
	ldr x5, [x1]
	adds x5,x5,1
	bvs .L2
	str x5, [x1]
	ret
.L2:
	mov	x0, 4890909195324358656
	mov	w2, 5
	str	x0, [x1]
	str	w2, [x1, 8]
	ret

    php$ ./sapi/cli/php Zend/bench.php

Base:                         Patch:
simple             0.091      simple             0.091
simplecall         0.014      simplecall         0.014
simpleucall        0.041      simpleucall        0.041
simpleudcall       0.045      simpleudcall       0.045
mandel             0.193      mandel             0.193
mandel2            0.229      mandel2            0.229
ackermann(7)       0.044      ackermann(7)       0.044
ary(50000)         0.010      ary(50000)         0.010
ary2(50000)        0.008      ary2(50000)        0.008
ary3(2000)         0.096      ary3(2000)         0.102
fibo(30)           0.149      fibo(30)           0.148
hash1(50000)       0.016      hash1(50000)       0.016
hash2(500)         0.020      hash2(500)         0.020
heapsort(20000)    0.055      heapsort(20000)    0.055
matrix(20)         0.057      matrix(20)         0.057
nestedloop(12)     0.091      nestedloop(12)     0.091
sieve(30)          0.032      sieve(30)          0.032
strcat(200000)     0.010      strcat(200000)     0.010
------------------------      ------------------------
Total              1.199      Total              1.204

    php$ ./sapi/cli/php Zend/micro_bench.php

Base:                                      Patch:
empty_loop         0.051                   empty_loop         0.050
func()             0.181    0.130          func()             0.181    0.131
undef_func()       0.186    0.135          undef_func()       0.186    0.136
int_func()         0.116    0.064          int_func()         0.116    0.065
$x = self::$x      0.235    0.183          $x = self::$x      0.229    0.179
self::$x = 0       0.198    0.147          self::$x = 0       0.199    0.148
isset(self::$x)    0.229    0.178          isset(self::$x)    0.225    0.174
empty(self::$x)    0.231    0.180          empty(self::$x)    0.227    0.177
$x = Foo::$x       0.144    0.093          $x = Foo::$x       0.142    0.092
Foo::$x = 0        0.107    0.056          Foo::$x = 0        0.105    0.054
isset(Foo::$x)     0.140    0.088          isset(Foo::$x)     0.140    0.089
empty(Foo::$x)     0.148    0.097          empty(Foo::$x)     0.144    0.094
self::f()          0.238    0.187          self::f()          0.240    0.190
Foo::f()           0.209    0.158          Foo::f()           0.201    0.150
$x = $this->x      0.123    0.072          $x = $this->x      0.120    0.070
$this->x = 0       0.124    0.073          $this->x = 0       0.124    0.074
$this->x += 2      0.151    0.099          $this->x += 2      0.151    0.101
++$this->x         0.137    0.086          ++$this->x         0.139    0.088
--$this->x         0.137    0.086          --$this->x         0.137    0.087
$this->x++         0.170    0.119          $this->x++         0.172    0.122
$this->x--         0.171    0.119          $this->x--         0.172    0.122
isset($this->x)    0.170    0.119          isset($this->x)    0.170    0.120
empty($this->x)    0.179    0.128          empty($this->x)    0.179    0.129
$this->f()         0.194    0.143          $this->f()         0.194    0.144
$x = Foo::TEST     0.188    0.137          $x = Foo::TEST     0.188    0.138
new Foo()          0.482    0.431          new Foo()          0.482    0.432
$x = TEST          0.109    0.058          $x = TEST          0.109    0.059
$x = $_GET         0.190    0.138          $x = $_GET         0.188    0.137
$x = $GLOBALS['v'] 0.242    0.191          $x = $GLOBALS['v'] 0.246    0.196
$x = $hash['v']    0.196    0.145          $x = $hash['v']    0.192    0.142
$x = $str[0]       0.146    0.094          $x = $str[0]       0.142    0.092
$x = $a ?: null    0.144    0.093          $x = $a ?: null    0.144    0.094
$x = $f ?: tmp     0.174    0.123          $x = $f ?: tmp     0.174    0.124
$x = $f ? $f : $a  0.153    0.101          $x = $f ? $f : $a  0.153    0.102
$x = $f ? $f : tmp 0.148    0.097          $x = $f ? $f : tmp 0.148    0.098
------------------------                   ------------------------
Total              6.143                   Total              6.108
2019-05-07 15:42:19 +03:00
Sebastian Pop adc3b72076 speed up add and sub operators with overflow detection
On A72, google-benchmark measure before and after the patch:
--------------------------------------------------------
Benchmark              Time             CPU   Iterations
--------------------------------------------------------
BM_add_before       13.3 ns         13.3 ns     52626058
BM_sub_before       8.72 ns         8.72 ns     80259343
BM_add_after        4.80 ns         4.80 ns    145926004
BM_sub_after        4.80 ns         4.80 ns    145936496

Before the patch:
fast_long_add_function:
	ldr	x1, [x1]
	ldr	x2, [x2]
	add	x3, x1, x2
	eor	x4, x1, x2
	tbz	x4, #63, .L5
.L2:
	mov	w1, 4
	str	x3, [x0]
	str	w1, [x0, 8]
	ret
	.p2align 2
.L5:
	eor	x4, x1, x3
	tbz	x4, #63, .L2
	scvtf	d0, x1
	scvtf	d1, x2
	mov	w1, 5
	str	w1, [x0, 8]
	fadd	d0, d0, d1
	str	d0, [x0]
	ret

With the patch:
fast_long_add_function:
	ldr    x5, [x1]
	ldr    x6, [x2]
	adds	x5, x5, x6
	bvs	.L2
	mov	w6, 4
	str	x5, [x0]
	str	w6, [x0, 8]
	ret
.L2:
	ldr	x1, [x1]
	mov	w3, 5
	ldr	x2, [x2]
	str	w3, [x0, 8]
	scvtf	d0, x1
	scvtf	d1, x2
	fadd	d0, d0, d1
	str	d0, [x0]
	ret

    php$ ./sapi/cli/php Zend/bench.php

Base:                         Patch:
simple             0.091      simple             0.091
simplecall         0.014      simplecall         0.014
simpleucall        0.041      simpleucall        0.041
simpleudcall       0.045      simpleudcall       0.045
mandel             0.193      mandel             0.193
mandel2            0.229      mandel2            0.229
ackermann(7)       0.044      ackermann(7)       0.044
ary(50000)         0.010      ary(50000)         0.010
ary2(50000)        0.008      ary2(50000)        0.008
ary3(2000)         0.096      ary3(2000)         0.095
fibo(30)           0.149      fibo(30)           0.148
hash1(50000)       0.016      hash1(50000)       0.016
hash2(500)         0.020      hash2(500)         0.020
heapsort(20000)    0.055      heapsort(20000)    0.054
matrix(20)         0.057      matrix(20)         0.057
nestedloop(12)     0.091      nestedloop(12)     0.091
sieve(30)          0.032      sieve(30)          0.032
strcat(200000)     0.010      strcat(200000)     0.010
------------------------      ------------------------
Total              1.199      Total              1.197

    php$ ./sapi/cli/php Zend/micro_bench.php

Base:                                      Patch:
empty_loop         0.051                   empty_loop         0.051
func()             0.181    0.130          func()             0.181    0.130
undef_func()       0.186    0.135          undef_func()       0.186    0.135
int_func()         0.116    0.064          int_func()         0.116    0.064
$x = self::$x      0.235    0.183          $x = self::$x      0.233    0.182
self::$x = 0       0.198    0.147          self::$x = 0       0.198    0.147
isset(self::$x)    0.229    0.178          isset(self::$x)    0.229    0.178
empty(self::$x)    0.231    0.180          empty(self::$x)    0.231    0.180
$x = Foo::$x       0.144    0.093          $x = Foo::$x       0.144    0.093
Foo::$x = 0        0.107    0.056          Foo::$x = 0        0.107    0.056
isset(Foo::$x)     0.140    0.088          isset(Foo::$x)     0.140    0.088
empty(Foo::$x)     0.148    0.097          empty(Foo::$x)     0.148    0.097
self::f()          0.238    0.187          self::f()          0.238    0.187
Foo::f()           0.209    0.158          Foo::f()           0.209    0.158
$x = $this->x      0.123    0.072          $x = $this->x      0.123    0.072
$this->x = 0       0.124    0.073          $this->x = 0       0.124    0.073
$this->x += 2      0.151    0.099          $this->x += 2      0.153    0.101
++$this->x         0.137    0.086          ++$this->x         0.138    0.086
--$this->x         0.137    0.086          --$this->x         0.138    0.086
$this->x++         0.170    0.119          $this->x++         0.172    0.121
$this->x--         0.171    0.119          $this->x--         0.172    0.121
isset($this->x)    0.170    0.119          isset($this->x)    0.170    0.119
empty($this->x)    0.179    0.128          empty($this->x)    0.179    0.128
$this->f()         0.194    0.143          $this->f()         0.194    0.143
$x = Foo::TEST     0.188    0.137          $x = Foo::TEST     0.188    0.136
new Foo()          0.482    0.431          new Foo()          0.479    0.427
$x = TEST          0.109    0.058          $x = TEST          0.109    0.058
$x = $_GET         0.190    0.138          $x = $_GET         0.190    0.139
$x = $GLOBALS['v'] 0.242    0.191          $x = $GLOBALS['v'] 0.242    0.191
$x = $hash['v']    0.196    0.145          $x = $hash['v']    0.196    0.145
$x = $str[0]       0.146    0.094          $x = $str[0]       0.145    0.094
$x = $a ?: null    0.144    0.093          $x = $a ?: null    0.144    0.093
$x = $f ?: tmp     0.174    0.123          $x = $f ?: tmp     0.174    0.123
$x = $f ? $f : $a  0.153    0.101          $x = $f ? $f : $a  0.153    0.101
$x = $f ? $f : tmp 0.148    0.097          $x = $f ? $f : tmp 0.148    0.097
------------------------                   ------------------------
Total              6.143                   Total              6.143
2019-05-07 15:38:17 +03:00
Hugh McMaster cc9c5d8057 Use PKG_CHECK_MODULES to detect the ffi library 2019-05-07 14:28:33 +02:00
Nikita Popov 09ea55cb4e Deprecate left-associative ternary
Deprecate nesting ternary operators without explicit parentheses.

RFC: https://wiki.php.net/rfc/ternary_associativity
2019-05-07 14:06:29 +02:00
Sebastian Pop 68a7578243 [AArch64] use rev64 to reverse strings
The execution time goes from 4.388s down to 0.563s on a Graviton A1
instance for the benchmark:

function reverse_strings() {
    $a = "foo";
    for ($i = 0; $i < 100000; $i++) {
        strrev($a);
        $a .= "o";
    }
}
2019-05-07 10:40:45 +02:00
Nikita Popov d9a2d76a43 Remove outdated info from README.ZEND_MM
[ci skip]
2019-05-07 09:54:46 +02:00
Peter Kokot 361d0b3426 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.
2019-05-07 04:40:01 +02:00
Peter Kokot c453196be4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Convert CRLF line endings to LF
2019-05-07 04:35:43 +02:00
Peter Kokot b8caba92e2 Remove empty section 2019-05-07 04:26:03 +02:00
Peter Kokot 88f64d4a7b [ci skip] Add password registry RFC to changelog 2019-05-07 02:22:29 +02:00
Peter Kokot eb9ad31b48 [ci skip] Rename libbcmath license file to LICENSE
- More common filename accross the PHP repository
- Additionally, this patch replaces some legacy form feed (FF or ^L)
  characters (for printers) to LF (\n) newline character.
2019-05-07 01:09:25 +02:00
Peter Kokot 975cb57930 [ci skip] Move OpenLDAP license to redistributable info file 2019-05-06 23:02:46 +02:00
Peter Kokot 426bcdf021 Fix double incremenation in ffi
This removes the warning of:
`incremented both in the loop header and in the loop body` in the
compilation step.
2019-05-06 09:45:11 +03:00
Peter Kokot c025cf47c0 Rename uppercase JPG file to lowercase jpg
To not introduce new file type and since it is not related to a test.
Lowercase JPG file type more common and recommended to use.
2019-05-06 05:18:27 +02:00
Peter Kokot 6be6cac6f4 [ci skip] Move wddx to dedicated section 2019-05-06 00:58:21 +02:00
Peter Kokot e58fddf7a3 Remove phpextdist
This script hasn't been used since using PEAR as a package manager for
PHP extensions since it is using Makefile.in as an indicator if the
current directory is extension. Instead of this script extensions can
be packaged differently and more properly with either current PEAR
or with some other manual method.
2019-05-06 00:15:20 +02:00
Peter Kokot 340c39acfa Remove duplicate test file
Files ext/oci8/tests/field_funcs0.phpt and
ext/oci8/tests/field_funcs.phpt are the same.
2019-05-06 00:11:40 +02:00
peter279k 8417142a8f Remove duplicate getimagesize_variation_003 test 2019-05-05 23:55:09 +02:00
Jakub Zelenka b348c46e29 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-05 21:06:30 +01:00
Christoph M. Becker 30409d6753 Properly initialize variable
Not all code paths assign to `handle`, even though it may be used, so
we make sure that it is initialized to a sane value in the first place.
2019-05-05 17:49:54 +02:00
Christoph M. Becker a760c79f1e Fix typo 2019-05-05 15:40:33 +02:00
Christoph M. Becker e4757ecc80 Re-add common PDO tests to Firebird test suite
These have been inadvertently dropped when changing the test suite to
not require ext/interbase anymore, so we add them back.

We also change the required environment variable names to match the
usual PDO names.  Particularly, we replace `PDO_FIREBIRD_TEST_HOSTNAME`
and `_DATABASE` with the more flexible `PDO_FIREBIRD_TEST_DSN`.
2019-05-04 14:24:15 +02:00
Christoph M. Becker ae21dc46da Fix memory leak exhibited by bug_aaa.phpt
Since a statement may be executed multiple times, we need to free
already allocated storage for output data before allocating new
storage.
2019-05-04 14:20:11 +02:00
peter279k ba0913a2e5 Fix undefined variable, and remove unused test-pdo 2019-05-03 18:14:32 +02:00
Peter Kokot a9e07b937c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update `NEWS` with changes made at #4093
2019-05-03 17:33:05 +02:00
Christoph M. Becker 508892e266 Fix comment
0x2d == 45, not 46.  However, `CURLMOPT_PUSHFUNCTION` is actually
available as of cURL 7.44.0[1], while we make the respective PHP
constants available only as of cURL 7.46.0[2].

[1] <https://curl.haxx.se/libcurl/c/CURLMOPT_PUSHFUNCTION.html>
[2] <http://git.php.net/?p=php-src.git;a=blob;f=ext/curl/interface.c;h=fdf855278eef6f32f26c49b54f56aca9bd7007c3;hb=HEAD#l1289>
2019-05-03 16:50:56 +02:00
Kalle Sommer Nielsen fdb16f8c20 NEWS 2019-05-02 23:34:46 +03:00
Simon Welsh 6e3438bc62 Include the request method in CLI server logs 2019-05-02 23:32:22 +03:00
peter279k 826e4aca59 Remove test-pcntl script 2019-05-02 23:25:32 +03:00
Kalle Sommer Nielsen 1c893b89bd PDO_Firebird test update, round 2
- This renames the environment variables to: PDO_FIREBIRD_TEST_XXX to be in line with other PDO test suites
- Adds an skipif.inc file that skips the tests if no database is set
- The test suite can now be run without PDO_FIREBIRD_TEST_HOSTNAME

$ set PDO_FIREBIRD_TEST_HOSTNAME=localhost
$ set PDO_FIREBIRD_TEST_DATABASE=C:\dev\php.fdb
$ nmake test TESTS=ext/pdo_firebird/tests
2019-05-02 23:19:27 +03:00
Kalle Sommer Nielsen c9599c1c72 Rewrite PDO_Firebird tests to not depend on ext/interbase
I have no idea how I managed to get this to work, but there is 4 new environment variables that
can be specified for the connection:

- PDO_FIREBIRD_USERNAME
- PDO_FIREBIRD_PASSWORD
- PDO_FIREBIRD_HOSTNAME
- PDO_FIREBIRD_DATABASE

(See testdb.inc for more info)

The only way I could get this to work on my local machine was with a DSN like:

- firebird:dbname=localhost:C:\php.fdb

Hence why the 'hostname' can be specified.

There is also a bit mess in regards to cleanup of this extension tests, but I really do not want to dwell down there, if someone dares to do so, then please be my guest.
2019-05-02 21:48:24 +03:00
Nikita Popov 2934f9da4d Merge branch 'PHP-7.3' into PHP-7.4 2019-05-02 15:13:24 +02:00
f3e5bbe6f3 Implement arrow functions
Per RFC: https://wiki.php.net/rfc/arrow_functions_v2

Co-authored-by: Levi Morrison <levim@php.net>
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
2019-05-02 15:04:03 +02:00
Kalle Sommer Nielsen eaab0a2b6f Remove some more interbase leftovers 2019-05-01 23:45:06 +03:00
Kalle Sommer Nielsen 9cbf5ebf8b Fix typo 2019-05-01 23:38:17 +03:00
Kalle Sommer Nielsen c8a20dfdca NEWS for ext/interbase unbundling 2019-05-01 23:35:30 +03:00
Kalle Sommer Nielsen b458fcb87f Move ext/interbase to pecl/database/interbase
https://wiki.php.net/rfc/deprecate-and-remove-ext-interbase
2019-05-01 23:27:04 +03:00
Dmitry Stogov ec5f7df732 Use ZEND_HASH_FOREACH with direct callback, instead of callbacks 2019-04-30 14:50:01 +03:00
Christoph M. Becker f655ca29a7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS wrt. sec fixes
2019-04-30 09:36:31 +02:00
蝦米 e4ed2bf922 fix typo 2019-04-30 09:18:17 +02:00
Stanislav Malyshev db0de953ba Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
2019-04-30 00:06:10 -07:00
Stanislav Malyshev f7d59844e1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77821: Potential heap corruption in TSendMail()
2019-04-29 22:09:15 -07:00
Dmitry Stogov 8cdd215894 Also, use ZEND_ACC_PRELOADED for classes 2019-04-30 02:07:02 +03:00
Peter Kokot ce65d2354c Remove TSRM configuration header
TSRM configuration header file was once created by separate autoconf
build system for TSRM and is with the current code not directly needed
like this anymore.
2019-04-29 22:34:43 +02:00
Christoph M. Becker c5faefa646 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77943: imageantialias($image, false); does not work
2019-04-29 17:24:18 +02:00
Christoph M. Becker 4b93393f7b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add tests for bug77943
2019-04-29 16:29:49 +02:00
Christoph M. Becker 85cf1cb077 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77943: imageantialias($image, false); does not work
2019-04-29 16:18:54 +02:00
Nikita Popov 55ecfe4ef3 Add UPGRADING entries 2019-04-29 14:17:44 +02:00
Hugh McMaster a7b5b341b3 Use PKG_CHECK_MODULES to detect the zip library 2019-04-29 14:16:16 +02:00
Hugh McMaster 4bce02898d Use PKG_CHECK_MODULES to detect the libsodium library 2019-04-29 14:16:16 +02:00
Hugh McMaster c9ee822bb6 Always use pkg-config from the host architecture 2019-04-29 14:16:16 +02:00
Nikita Popov b1c5f7b265 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-29 13:53:57 +02:00
Christoph M. Becker 71e9013bab Properly initialize out parameter
The MS docs on `SQLColAttribute()`[1] state regarding the
`NumericAttributePtr` parameter:

| Please note that some drivers may only write the lower 32-bit or
| 16-bit of a buffer and leave the higher-order bit unchanged.
| Therefore, applications should initialize the value to 0 before
| calling this function.

[1] <https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlcolattribute-function?view=sql-server-2017>
2019-04-29 12:17:38 +02:00
Jury c79d5b86e0 Adds json_encode test for unpacked arrays 2019-04-29 10:23:38 +02:00
Christoph M. Becker c68dc6b5e3 Extend CURLFile to support streams
Due to former restrictions of the libcurl API, curl multipart/formdata
file uploads supported only proper files.  However, as of curl 7.56.0
the new `curl_mime_*()` API is available (and already supported by
PHP[1]), which allows us to support arbitrary *seekable* streams, which
is generally desirable, and particularly resolves issues with the
transparent Unicode and long part support on Windows (see bug #77711).

Note that older curl versions are still supported, but CURLFile is
still restricted to proper files in this case.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=a83b68ba56714bfa06737a61af795460caa4a105>
2019-04-29 10:21:07 +02:00
Nikita Popov 22e9a5e0c3 Fix typo in TRY_ASSIGN macro name 2019-04-29 09:58:45 +02:00
Christoph M. Becker 9481cb43b3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix tests
2019-04-29 09:07:13 +02:00
Peter Kokot c79eb107a0 Simplify checking of *nix build tools
The buildmk.stamp file has been created by the *nix build checking step
to run the check step only once. Instead of poluting the project root
directory, the stamp file can be also omitted. Performance difference is
very minimal to not justify having the stamp check at all today anymore.

This patch integrates the buildcheck.sh to buildconf script directly.
2019-04-29 01:30:27 +02:00
Peter Kokot b931dacc88 Remove unused TSRM/readdir.h header
This was once part of TSRM but then got refactored into the windows
implementation win32/readdir.h directly. Instead of including such files
directly code should use zend_virtual_cwd.h which is already part of the
php.h file.
2019-04-29 00:51:13 +02:00
Christoph M. Becker 8446554fed Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Make MySQLPDOTest::extractVersion() more liberal
2019-04-28 23:50:43 +02:00
Peter Kokot 76df951eb5 Enhance the buildconf force option
The force option used to only remove the Autoconf cache files. Now it
also removes entire configure file so the configure file always gets
rebuilt when needs be done.

Additionally, the buildconf now also accepts the shorter version of the
force option:
  buildconf -f
2019-04-28 21:15:54 +02:00
Peter Kokot f9db357623 Automatically remove aclocal.m4 if present
Commit 4e7064d173 removed the usage of
`aclocal.m4`. When using Git repositories, many times cleaning of the
generated files is not done prior to running phpize or buildconf. For
example:

  git clone git://github.com/php/php-src
  cd php-src
  git checkout PHP-7.3
  ./buildconf
  ./configure
  git checkout PHP-7.4
  ./buildconf # -> warnings
  ./configure # -> errors

To not accidentally include `aclocal.m4` file in the generated configure
this enhances build system experience a bit more by removing aclocal.m4
file prior to start building configure file using phpize or buildconf.
2019-04-28 21:05:34 +02:00
Jakub Zelenka 78bed33862 Update NEWS with added TLS 1.3 info 2019-04-28 18:48:35 +01:00
Jakub Zelenka 3c056a9e75 Enable TLS 1.3 by default 2019-04-28 17:37:43 +01:00
Jakub Zelenka c2e9c71e36 Fix tests and logic for TLS 1.3 2019-04-28 17:37:43 +01:00
codarrenvelvindron 5c05f5e6d3 Added tls 1.3 support for PHP 2019-04-28 17:37:43 +01:00
Peter Kokot 807901072d [ci skip] Remove outdated and redundant Apache README
PHP manual includes more information and a bit more updated than this
README.
2019-04-28 02:29:08 +02:00
Peter Kokot 74e72496fa Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
  Update NEWS
  Fix #77024: SplFileObject::__toString() may return array
2019-04-28 00:51:38 +02:00
David Carlier bb06030bf7 Little detection change proposal.
As pointed out, the further path is called by open rather than shm_open.
2019-04-27 21:18:27 +02:00
Christoph M. Becker d0719be436 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  PHP, meet MySQL
2019-04-27 19:22:30 +02:00
Christoph M. Becker 3464929d64 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77944: Wrong meta pdo_type for bigint on LLP64
2019-04-27 18:48:09 +02:00
Nikita Popov 2371c65a28 Fix file name clash in zlib tests 2019-04-26 15:05:42 +02:00
Nikita Popov 33e8a7b368 Enable -Werror in CI
Add --enable-werror configure option and use it on Travis. It's not
possible to directly use CFLAGS, because it also affects configure
checks which often throw warnings.

We can't enable something similar for Windows builds at this time,
because they throw a lot more warnings.
2019-04-26 09:56:16 +02:00
Christoph M. Becker be74a00464 Fix VirtualProtect() related Phar issues
We must not (try to) modify shared values, but rather have to use our
own copies, if unixified filenames are required on Windows.  To avoid
excessive string duplication, we add checks whether the filenames are
already unixified (i.e. do not contain backslashes).  To improve the
performance if we need to copy strings, we use do_alloca() and friends.

Besides generally being somewhat messy, the handling of unixified
filenames is still suboptimal performance-wise, but we leave this for a
future cleanup, and focus on fixing the issue at hand for now.

We also enable opcache.protect_memory for the AppVeyor CI.
2019-04-26 09:09:22 +02:00
Christoph M. Becker 09345d70fd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 23:29:25 +02:00
Christoph M. Becker f532618776 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 19:40:37 +02:00
Christoph M. Becker 627c0017b0 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 08:59:35 +02:00
Christoph M. Becker 6dbb1d9318 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77938: socket_get_option error
2019-04-25 00:06:15 +02:00
Dmitry Stogov 21c36341af Use better macros 2019-04-24 22:27:40 +03:00
Dmitry Stogov 9e9407c22e settype() optimization 2019-04-24 22:23:49 +03:00
George Peter Banyard 8b8d5a4bd1 Remove html_errors from INI Quick Reference as INI values are identical to Engine values 2019-04-24 19:21:52 +02:00
Dmitry Stogov e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03:00
Remi Collet eef351b7c7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  news entry for litespeed
2019-04-24 09:46:20 +02:00
Dmitry Stogov db2ffcf157 Optimize constant SWITCH_LONG and SWITCH_STRING 2019-04-24 00:08:17 +03:00
Dmitry Stogov 4d0d7ce349 Don't eliminate BIND_STATIC if it may cause undefined constant warning 2019-04-23 22:39:14 +03:00
Peter Kokot beb58ca128 Move Autoconf Archive macros to a common m4 dir
In PHP the build dir is used as a directory for external macros
including Autoconf Archive macros.
2019-04-23 20:37:31 +02:00
Peter Kokot 4e7064d173 Move acinclude.m4 to build/php.m4
The acinclude.m4 file is in a usual Autotools build processed with
Automake's aclocal tool. Since PHP currently doesn't use Automake and
aclocal this file can be moved into the build directory. PHP build
system currently generates a combined aclocal.m4 file that Autoconf
can processes automatically.

However, a newer practice is writing all local macros in separate
dedicated files prefixed with package name, in PHP's case PHP_MACRO_NAME
and putting them in a common `m4` directory. PHP uses currently `build`
directory for this purpose.

Name `php.m4` probably most resembles such file for PHP's case.

PHP manually created the aclocal.m4 file from acinclude.m4 and
build/libtool.m4. Which is also not a particularly good practice [1], so
this patch also removes the generated alocal.m4 usage and uses
m4_include() calls manually in the configure.ac and phpize.m4 files
manually.

- sort order is not important but can be alphabetical
- list of *.m4 files prerequisites for configure script generation
  updated
- Moving m4_include() before AC_INIT also removes all comments starting
  with hash character (`#`) in the included files.

[1] https://autotools.io/autoconf/macros.html
2019-04-23 20:28:45 +02:00
Peter Kokot 96a9fb2052 Simplify libxmlrpc bundling and building
The xmlrpc library is a forked, modified and bundled into the PHP source
code. Instead of having a separate *nix build system files in the xmlrpc
library this patch removes unneeded build checks.

- AC_PROG_CC is not needed to be called by the extension itself since it
  is already part of the main configure.ac and the phpize's
  configure.ac.
- UNDEF_THREADS_HACK is not used in the current codebase.
- Symbols defined by XMLRPC_HEADER_CHECKS are not used in the current
  code.
- Symbols defined by XMLRPC_FUNCTION_CHECKS are not used in the current
  code.
- AC_PROG_RANLIB is already done by the TSRM's files and isn't needed
  for the xmlrpc extension to work.
- AC_PROG_LN_S is already done by the PHP main configure.ac and also
  isn't needed by the xmlrpc extension to be built.
2019-04-23 20:17:33 +02:00
Nikita Popov 3cfbbf2956 Make DateInterval objects uncomparable
Arbitrary DateInterval objects don't have well-defined comparison
semantics. Throw a warning and treat the objects as uncomparable.

Support for comparing DateInterval objects returned by
DateTime::diff() may be added in the future.
2019-04-23 13:12:06 +02:00
bugreportuser d65f93f92b Remove duplicate zend_unset_timeout() 2019-04-23 12:44:20 +02:00
Nikita Popov eb7d57eb77 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-23 12:43:37 +02:00
Nikita Popov a7a318d3c0 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-23 11:40:43 +02:00
Peter Kokot 24cd183fdf Merge branch 'pull-request/4046' into PHP-7.4
* pull-request/4046:
  Remove php.gif from the project root directory
2019-04-23 08:59:44 +02:00
Peter Kokot 9443bd1bbf [ci skip] Remove CLI sapi README
Removing in favour of:
- https://www.php.net/manual/en/features.commandline.introduction.php
- https://www.php.net/manual/en/features.commandline.differences.php
2019-04-23 08:51:23 +02:00
Peter Kokot 07a95b4017 Remove sinclude from tsrm.m4
This was once part of a standalone TSRM build and is not used in current
build system anymore.
2019-04-23 08:27:11 +02:00
Dmitry Stogov 1827d784b5 Remove unused BIND_STATIC insructions 2019-04-23 02:21:08 +03:00
Christoph M. Becker 808eaa095e Merge link.c and link_win32.c 2019-04-22 13:53:17 +02:00
CrazyMiaoo 9df15fc26b Add gcc global register for aarch64 2019-04-22 14:29:30 +03:00
Christoph M. Becker 6710929c04 Fix parameter order
The parameter order of `php_sys_link()` should be identical on Windows
and POSIX, bug commit c9861bd[1] got that wrong.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=c9861bd7a974ef1555395b879c1035a0bbc12ef1>
2019-04-22 12:38:24 +02:00
Dmitry Stogov abacb5e8ea Fixed wrong opline 2019-04-22 11:05:56 +03:00
George Wang bd86ae4b8a Merge branch 'PHP-7.3' into PHP-7.4 2019-04-21 15:59:49 -04:00
Peter Kokot b1d3509e8c Refactor Zend/acinclude.m4 local macro
There is now only a single M4 macro in the legacy acinclude.m4 file. A
separate acinclude file was once used with a standalone Zend engine
building but with current build system this can be simplified a bit.
2019-04-21 15:53:19 +02:00
Peter Kokot 1c94aac89e [ci skip] Fix CS in Markdown files
Checked and quickfixed with Markdown linter
- 80 columns line width (~)
- code highlighting
- ...

Some most obvious outdated content updated a bit more.
2019-04-21 15:33:20 +02:00
Rodrigo Prado 80f3c69ae9 Updated visual text elements using markdown 2019-04-21 11:06:19 +02:00
Peter Kokot aff1a927d9 Remove php.gif from the project root directory
The PHP logo is also displayed in the main README.md file using a shiny
SVG format so there is no need to use GIF format.
2019-04-21 03:20:47 +02:00
Peter Kokot 47c5fa0710 [ci skip] Fix logo location 2019-04-21 03:16:11 +02:00
Peter Kokot bb95805327 [ci skip] Fix typo 2019-04-20 22:55:37 +02:00
Peter Kokot e8a8128665 Refactor docs files for bcmath library 2019-04-20 22:41:00 +02:00
Peter Kokot 36c7946522 Move ucgendata README to generator file header 2019-04-20 22:35:25 +02:00
Peter Kokot b58bd11ae5 Remove zend.ico
The usage of the `zend.ico` image file was removed via
4b3e198023 and is in current code base
not used anymore.
2019-04-20 22:22:56 +02:00
Rodrigo Prado ba0f7f7e43 Added test for imagecolorclosesthwb
The function was not tested yet.
See http://gcov.php.net/viewer.php?version=PHP_HEAD&func=tested_functions
2019-04-20 19:31:45 +02:00
Vitor Mattos c050045faa Add test for date timestamp
- [date_timestamp_get] adding coverage for date_timestamp_get alias to
  DateTime::getTimestamp feature at PHPRio TestFest
- [date_timestamp_get] adding coverage for date_timestamp_get basic
  feature at PHPRio TestFest
- Combine tests into single file
2019-04-20 19:21:10 +02:00
Peter Kokot 2e8819549b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update changelog
  Update changelog
  Fix #77921: static.php.net doesn't work anymore
2019-04-20 19:13:21 +02:00
Peter Kokot a353d4c218 Update changelogs 2019-04-20 16:16:18 +02:00
Peter Kokot caea088ac7 Remove PHP_SETUP_KERBEROS m4 macro
With recent transition to pkg-config/pkgconf this macro has been now a
simple wrapper for PKG_CHECK_MODULES and PHP_EVAL_INCLINE so it's better
to omit it altogether and use these two in the *.m4 code directly.
2019-04-20 16:12:54 +02:00
Gabriel Rodrigues Couto e28db2276b Fixed bug #77011
Added ".tbd" extension support for libiconv on Mac to use
CommandLineTools SDK shared library.
2019-04-20 15:22:06 +02:00
Hugh McMaster aba72ebf15 Use PKG_CHECK_MODULES to detect the kerberos libraries 2019-04-20 15:13:24 +02:00
Peter Kokot 4ff2d96cc9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update Git repository for Windows build tool kit
2019-04-19 21:11:23 +02:00
Fabien Villepinte baa9669392 Fix typo in comments 2019-04-19 13:11:50 -03:00
Christoph M. Becker 994e20ec4f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Use php-sdk-2.2.0beta5 on AppVeyor
2019-04-18 16:52:03 +02:00
Nikita Popov 3974180f92 Remove dead "props" member from date objects 2019-04-18 15:05:43 +02:00
Nikita Popov dbaf9b7924 Revert "Fix zend_test interned strings loaded via dl()"
This reverts commit 7435ab3375.

It looks like we can't access EG(current_module) here in ZTS builds.
As the problematic asserts have now been disabled outside RC_DEBUG,
I'm just reverting this commit and leaving things as they were.
2019-04-18 13:49:42 +02:00
Dmitry Stogov 5ffa5217fc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Check assert only when RC_DEBUG is enabled
2019-04-18 14:27:05 +03:00
Hugh McMaster 9f0c9b7ad6 Rename --enable-libxml to --with-libxml to meet naming guidelines 2019-04-18 13:08:02 +02:00
Hugh McMaster cc930cdd75 Use PKG_CHECK_MODULES to detect libxml2 2019-04-18 13:04:54 +02:00
Hugh McMaster 29d1b7fd52 Remove support for --with-libxml-dir 2019-04-18 13:04:54 +02:00
Nikita Popov 05c2e87e84 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-18 12:59:05 +02:00
Nikita Popov 7435ab3375 Fix zend_test interned strings loaded via dl() 2019-04-18 12:33:53 +02:00
Nikita Popov c6b5e2933c Merge branch 'PHP-7.3' into PHP-7.4 2019-04-18 12:14:49 +02:00
Nikita Popov 4aa78b67e7 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-18 12:10:09 +02:00
Nikita Popov a5b7f3bd81 Fix more dl() interned string assertions 2019-04-18 12:08:09 +02:00
Nikita Popov ed4c24274b Fix dl() module unloading in post deactivate
FOREACH_END_DEL() does not call the destructor by itself, we need to
explicitly call it. Due to the missing dtor call the functions were
not unregistered early, which resulted in later shutdown segfaults.
2019-04-18 10:10:15 +02:00
Dmitry Stogov 38f9c8d93d Don't initialize return value before calling user functions 2019-04-18 02:31:12 +03:00
Dmitry Stogov 4c1a25ad5f Fixed compatibility with phpdbg 2019-04-18 01:33:56 +03:00
Peter Kokot 02c1f3293e Join build makefiles together
Changes:
- Joins build/build.mk and build/build2.mk files together since there
  isn't any practical reason for having two different files with the
  current build system.
- Makefile is now more portable. All special syntaxes are omitted, for
  example, a conditional assignment operators `?=`. This makes buildconf
  more useful on Solaris make derivative, so there is no longer need to
  override make with gmake: `MAKE=gmake ./buildconf`.
- Suppressing autoconf and autoheader warnings is not needed anymore
  with current build system. Instead, the option `-Wall` has been used
  when running `./buildconf --debug` to get more useful debug info
  about current M4.
2019-04-17 21:52:58 +02:00
Dmitry Stogov 663056aa5f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  It's safe to keep old string if it's stored not in SHM.
2019-04-17 22:08:55 +03:00
Dmitry Stogov 93c6a32b7c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed dl() function. It failed in DEBUG build without opcache because of assert during string interning.
2019-04-17 19:32:34 +03:00
Christoph M. Becker 87912ca3b9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77911: Wrong warning for session.sid_bits_per_character
2019-04-17 17:24:36 +02:00
Nikita Popov 487d4d07b4 Remove some uses of deprecated internal_encoding settings in tests 2019-04-17 14:24:11 +02:00
Nikita Popov f73f190c3f Fix internal_encoding fallback in mbstring
By introducing a hook that is called whenever one of
internal_encoding / input_encoding / output_encoding changes, so
that mbstring can adjust it's internal state.

This also makes internal_encoding work with zend multibyte.
2019-04-17 14:05:53 +02:00
Dmitry Stogov 3ccd3aba90 Eliminate FETCH $GLOBALS followed by FETCH_DIM/UNSET_DIM/ISSET_ISEMPTY_DIM 2019-04-17 11:52:56 +03:00
Gabriel Caruso 825fc6b438 Fix typo
Introduced via 9a85a944d8
2019-04-17 05:44:06 -03:00
Derick Rethans 4a3f64dfef Merge branch 'PHP-7.3' into PHP-7.4 2019-04-17 09:40:28 +01:00
Christoph M. Becker 346ac968b3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix tests for non English environments
2019-04-17 09:58:12 +02:00
Peter Kokot b09fa9ed53 Simplify generated_lists generation
The `generated_lists` file is generated as a helper for build related
Makefile to include a list of *.m4 files prerequisites. When some of
these *.m4 files change, the configure script is regenerated when
buildconf is run. This can be simplified using dynamic environment
variable passed to the Makefile directly so it avoids another file from
being generated in the project root directory and shipping it with the
PHP release or creating a dedicated gitignore rule.

This is portable across all POSIX compatible makes So this patch
includes GNU Make, and everybody elses' make derivative support.
2019-04-16 17:25:08 +02:00
Artem Panfilov 12ee246ae4 ext/pcre/config0.m4: add ac_cv_have_pcre2_jit variable
The HAVE_PCRE_JIT_SUPPORT check uses AC_RUN_IFELSE, which is not
available when cross-compiling. As a fallback, JIT support is enabled
based on CPU architecture. However, this may be wrong,
e.g. when the JIT the feature was not enabled in the pcre2 build.

Add a cache variable for the PCRE JIT feature to make it possible to
override the check.
2019-04-16 17:15:38 +02:00
Remi Collet e65574fa1f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  next is 7.2.19
2019-04-16 13:12:49 +02:00
Nikita Popov bd6ebf40b2 Don't overwrite iterator count during real init 2019-04-16 12:21:20 +02:00
Nikita Popov 2bdd212887 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-16 12:21:16 +02:00
Christoph M. Becker c60a852e3c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Prepare main branch for PHP 7.3.6
2019-04-16 11:56:58 +02:00
Nikita Popov 32fb2d9343 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-16 10:39:48 +02:00
Nikita Popov 9a85a944d8 s/mysql_connect()/mysqli_connect() in php.ini 2019-04-16 10:39:40 +02:00
Christoph M. Becker a83b68ba56 Use curl_mime_*() functions if available
As of curl 7.56.0, `curl_formadd()` is deprecated in favor of
`curl_mime_*()`, so we use the latter if available.
2019-04-16 08:43:21 +02:00
Dmitry Stogov 10aeed5be4 Merge branch 'PHP-7.4' of git.php.net:php-src into PHP-7.4
* 'PHP-7.4' of git.php.net:php-src:
  Remove not needed extension generated files gitignores
  Add test for curl_version()
  Fixed bug #77895
  Zero sockaddr struct
  Fix saproxy_property_write signature
  Correctly destroy reference in ArrayObject sort
2019-04-16 00:09:45 +03:00
Dmitry Stogov 3f7bf35e16 execute_data->return_value is not used for internal functions 2019-04-16 00:08:16 +03:00
Peter Kokot 6884253461 Remove not needed extension generated files gitignores
These were refactored and moved to build directory via:
2957651c5c and
7e445ef3b1
2019-04-15 20:03:48 +02:00
Rodrigo Prado 8e68a9d9eb Add test for curl_version() 2019-04-15 15:57:11 +02:00
Nikita Popov 2d7d5ab5c6 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-15 15:27:37 +02:00
Nikita Popov ca8f563f99 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-15 15:00:56 +02:00
Nikita Popov 0c8a2d8d2a Fix saproxy_property_write signature 2019-04-15 14:33:47 +02:00
Nikita Popov 5fc71c7dba Correctly destroy reference in ArrayObject sort
The reference may be captured in an exception backtrace, in which
case the refcount may be more than one.
2019-04-15 13:21:45 +02:00
Dmitry Stogov cb3cfc9ff8 Removed tests that always (or almost always) true 2019-04-15 13:18:16 +03:00
Nikita Popov 433d68fce1 Try to fix stat_variation3-win32.phpt
After fixing comparison operator typos in
f73c104927 this test is failing. I
believe the comparison here should be using < rather than ==.
2019-04-15 11:40:37 +02:00
Nikita Popov 7f6c22cb3d Fix last maybe uninit warnings on 7.4
Most of these only occur under GCC 5. Not fond of all the workarounds
(especially the PDO one), but it gets us a clean build...
2019-04-15 11:35:13 +02:00
Nikita Popov 908660c1d7 Avoid maybe uninit warning in libmagic
GCC 5 false positive, gone in newer versions.
2019-04-15 10:59:45 +02:00
Nikita Popov c9ff095758 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-15 10:54:39 +02:00
Nikita Popov 3f19592f92 Disable strict aliasing warnings
It seems like GCC 5 likes to warn about exactly those trivial strict
aliasing violations that it's not going to miscompile anyway and the
warnings are gone in newer versions. Just disable the noise.
2019-04-15 10:43:49 +02:00
Nikita Popov b2ec07e64c Merge branch 'PHP-7.3' into PHP-7.4 2019-04-15 10:25:20 +02:00
Côme Chilliet f31435b855 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Updated NEWS
  Fix a NULL dereferencing crash in php-ldap
2019-04-15 10:20:12 +02:00
Rodrigo Prado f1dbe6160c Remove functions from func_info that were removed in PHP 7 2019-04-15 10:04:41 +02:00
Nikita Popov f73c104927 Fix incorrect compare_stats operator 2019-04-15 09:48:39 +02:00
Gabriel Caruso 656db96eb9 Remove HAVE_* for always available extensions 2019-04-14 11:44:12 -03:00
Peter Kokot 69b20f51e1 Disable PACKAGE_* preprocessor symbols
Autoconf defines PACKAGE_* symbols:
- PACKAGE_NAME
- PACKAGE_VERSION
- PACKAGE_TARNAME
- PACKAGE_STRING
- PACKAGE_BUGREPORT
- PACKAGE_URL

and appends them to the generated config.h.in files. With AC_INIT change
via afd52f9d99 where package version, URL,
bug report location and similar meta data are defined, these
preprocessor macros are then non empty strings in the generated
configuration header file. When using phpize, PHP shares the config
files in extensions, warnings of redefined macros appear, such as:
- `warning: 'PACKAGE_NAME' macro redefined`

This patch now disables these non utilized symbols in the generated
config header files.

Better practice would be to include only API specific headers where
needed but this would require even more refactorings. Some extensions
such as pcre, pgsql, and pdo_pgsql solve this issue by undefining some
of these symbols before including the library configuration headers in
the code also. Because these symbols can be defined by any library which
uses Autotools.

Additionally, the unused PACKAGE_* symbols were cleaned for the bundled
libmbfl library and with this patch not needed undef code removed.
2019-04-13 07:00:17 +02:00
Peter Kokot 769db42341 Remove PHP_READDIR_R_TYPE
The PHP_READDIR_R_TYPE m4 macro has been removed via
2b28f71891.

HAVE_POSIX_READDIR_R in windows header file is also not needed anymore.
2019-04-13 04:50:05 +02:00
George Wang f0f1388d60 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-12 17:48:22 -04:00
Nikita Popov a3459084e1 Try to fix windows build
noreturn attribute has to be on the declaration as well.
2019-04-12 17:04:44 +02:00
Nikita Popov 3c23084cf6 Fix strict aliasing violation in phpdbg
By explicitly computing the message length from bytes. This also
makes sure that the length is interpreted in an endianness-independent
manner.
2019-04-12 16:46:23 +02:00
Nikita Popov 4cfa4fb55d Don't use php_strtok_r in build_tablename
This is unnecessary convoluted... we just want to find the position
of the dot. Using php_strtok_r requires a copy of the string, and the
implementation also relied on the specific semantics of the scratch
space that strtok_r uses.
2019-04-12 16:17:35 +02:00
Nikita Popov 7207110362 Fix uninit warning in gd.c
This matches the upstream implementation.
2019-04-12 16:03:01 +02:00
Nikita Popov 91d59b122a Avoid uninit warning in ftp 2019-04-12 15:54:29 +02:00
Nikita Popov 4b1491a7b1 Remove dubious memcmp optimization in iconv
This violates strict aliasing, and appears entirely unnecessary --
the compiler can optimize fixed size memcmp's by itself.
2019-04-12 15:12:39 +02:00
Nikita Popov b6b98bdf64 Avoid uninit warnin in http_fopen_wrapper
This one looks semi-legit, in case php_stream_eof() returns false
but php_stream_get_line() fails. Not totally sure this cannot
happen, so rewriting to check both conditions at once.
2019-04-12 15:12:39 +02:00
Nikita Popov e1ab686228 Avoid uninit warning in dtoa
This code is extremely convoluted, I have no idea whether or not
this one is legitimate. Suppressing with explicit initialization.
2019-04-12 15:12:39 +02:00
Nikita Popov 339b0af429 Avoid misc uninitialized variable warnings 2019-04-12 15:12:39 +02:00
Nikita Popov 3d9c48035b Avoid uninitialized variable warnings in gmp 2019-04-12 15:12:39 +02:00
Nikita Popov 733c61a894 Add test for get_cfg_var with array variable
And fix incorrect variable shadowing in add_config_entry(). However,
the test doesn't hit this case, as it requires a nested array. I'm
not sure if it's possible to produce nested arrays from ini?
2019-04-12 15:12:39 +02:00
Nikita Popov afee7ed110 Avoid unitialized variable warning in soap
Extract envelope fetch into separate function, so the control
flow becomes more obvious.
2019-04-12 15:12:39 +02:00
Christoph M. Becker 54bdb25d9f Include libpq-fs.h on Windows, too
That's more future proof than defining hard-coded macros.
2019-04-12 14:12:08 +02:00
Christoph M. Becker de401683c9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix tests wrt. internationalization
2019-04-12 13:08:44 +02:00
Nikita Popov 4f28bbda51 Fix SOAP bailout handling
This code was reusing the _bailout variable from
SOAP_CLIENT_BEGIN/END_CODE(). As _bailout is not volatile, modifying
it after the setjmp call and then reading it back on return is
illegal. Use a separate local bailout variable instead.

This fixes the miscompile introduced by marking zend_bailout() as
noreturn.
2019-04-12 12:51:17 +02:00
Nikita Popov 3744533468 Enable -Wall on release builds for GCC
-Wall was already enabled for debug builds, enable it for release
builds as well.
2019-04-12 12:51:17 +02:00
Nikita Popov ba40f505e5 Fix unused variable warnings in libmagic
These variables are only used in assertions.
2019-04-12 12:03:26 +02:00
Nikita Popov 49ce7c0014 Remove odd variable assignment in escape_analysis
As we are breaking out of the for loop setting i = ssa_vars_count
doesn't do anything, but it confuses GCC into throwing a no-overflow
assumption warning.
2019-04-12 11:56:37 +02:00
Nikita Popov c09b63595e Fix potentially uninitialized warnings in phpdbg 2019-04-12 11:46:03 +02:00
Nikita Popov 88bfd2ae98 Regroup expressions in php_schema.c to avoid array bounds warnings 2019-04-12 11:11:53 +02:00
Nikita Popov edcf087ff9 Avoid potentially-uninitialized warnings in readline 2019-04-12 11:01:56 +02:00
Nikita Popov e5edbd0fe6 Fix uninitializde heredoc_tag use in readline
Could happen if "<<<" is directly followed by a newline.
2019-04-12 10:56:54 +02:00
Nikita Popov ce408504d5 Mark zend_bailout() as a noreturn function 2019-04-12 10:41:53 +02:00
Nikita Popov 1ef5b79b6b Merge branch 'PHP-7.3' into PHP-7.4 2019-04-12 10:37:17 +02:00
Nikita Popov 8e8d129d7f Use EMPTY_SWITCH_DEFAULT_CASE in php_unicode.c
Avoids a potentially uninitialized variable warning.
2019-04-12 10:26:11 +02:00
Nikita Popov 0f777c768c Run compile step under travis_wait
If there are no warnings, we may end up compiling more than 10
minutes without output, in which case the build times out. Use
travis_wait to avoid this.
2019-04-12 10:05:15 +02:00
Nikita Popov 0774d67ff9 Avoid directory clash in realpath tests 2019-04-12 09:57:07 +02:00
Dmitry Stogov 55cc280429 Backported call frame initialization improvement 2019-04-12 02:35:42 +03:00
Dmitry Stogov 88a2268d6b Replace "ZEND_CALL_CTOR" hack by additional live-range 2019-04-12 00:49:45 +03:00
Dmitry Stogov db93c26e6d Added test 2019-04-11 21:37:10 +03:00
Christoph M. Becker 27844773d8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix potential OPcache file cache related issues
2019-04-11 18:31:17 +02:00
Nikita Popov 09b2e20333 Work around -Walloc-size-larger-than bug 2019-04-11 17:44:20 +02:00
Markus Staab 7bb22df5cf Fixed typo 2019-04-11 16:56:36 +02:00
Nikita Popov 2b28f71891 Use readdir() instead of readdir_r()
readdir_r() is deprecated in modern glibc versions. readdir() is
thread safe in practice, as long as there are no concurrent accesses
on the *same* directory stream.
2019-04-11 16:52:36 +02:00
Nikita Popov 3e0f9c2c94 Remove curl gnutls locking
This is only relevant for the gcrypt backend, which is no longer in
use. I couldn't find any hard info on when exactly gcrypt support was
dropped, but nette is the default since 2.11.1. Most code that still
has the gcrypt handling is checking against < 2.12. In either case,
those versions were released in 2010/2011.
2019-04-11 16:45:45 +02:00
Nikita Popov 9d663cba1a Fix libgd warnings 2019-04-11 15:54:09 +02:00
Nikita Popov ca47732eee Remove incorrect mbstring includes
And thus fix unused variable warnings.
2019-04-11 15:47:41 +02:00
Nikita Popov 44a1cd4fcd Remove unused function prototype 2019-04-11 15:39:24 +02:00
Nikita Popov c51eafe931 Remove restrict zend_portability define
We're not using this anywhere, and it causes warnings, so I'm
dropping it. If we do end up needing this, it should be reintroduced
with a ZEND_ prefix.
2019-04-11 15:32:30 +02:00
Nikita Popov 2d823cb681 Fix error message in spl_autoload test 2019-04-11 15:22:59 +02:00
Nikita Popov b65cb7e2aa Fix libmagic warnings 2019-04-11 15:20:05 +02:00
Nikita Popov f6521659ca Add script to generate libmagic.patch 2019-04-11 15:12:20 +02:00
Nikita Popov 2916ecabe0 Remove the readline thread-safety warning
Would be nice to have this in configure, but we'd have to change
the ordering of extension & Zend processing for that.
2019-04-11 14:14:21 +02:00
Nikita Popov 651fd1a962 Fix pointer signedness warning in mysqlnd 2019-04-11 14:14:21 +02:00
Nikita Popov 29eb35616a Remove unused rcsid variables 2019-04-11 14:14:21 +02:00
Nikita Popov 539a16fdb8 Avoid curl ssl callback warnings with OpenSSL 1.1 2019-04-11 14:14:21 +02:00
Sebastian Bergmann e71cfae419 Fix typo 2019-04-11 13:34:02 +02:00
Dmitry Stogov a1b7ccdfc6 Fixed bug #77877 (call_user_func() passes $this to satatic methods). 2019-04-11 14:24:04 +03:00
Nikita Popov cd8312a77e Merge branch 'PHP-7.3' into PHP-7.4 2019-04-11 12:36:01 +02:00
Nikita Popov d087a356fe Suppress warnings using zend_quiet_write 2019-04-11 12:22:52 +02:00
Nikita Popov 30df87f77d Generate ZEND_COUNT for sizeof()
sizeof() is an alias of count(), so we should generate the same
code for them.
2019-04-11 10:48:52 +02:00
Nikita Popov b213f13a26 Make tsrm_env_lock() void
We're not checking the return value and the NTS version of this
generates warnings. If we want to handle lock failures, we should
do a hard abort inside tsrm_env_lock() itself.
2019-04-11 10:40:54 +02:00
Anatol Belski d207c9a78a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Ensure double slashes are replaced by the path normalization
2019-04-10 15:47:36 +02:00
Nikita Popov eb8c07fe2f Support VirtualProtect for opcache.protect_memory
Don't enable this on AppVeyor yet, as there is still an open
issue in phar.
2019-04-10 15:31:18 +02:00
Anatol Belski db7aba538d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix phar:// include handling with file cache
2019-04-10 14:57:04 +02:00
Nikita Popov 33a149afba Remove posix_getlogin() check from posix_getpwnam() test
It doesn't make sense to pass false to posix_getpwnam(). I'm not
sure what exactly this is guarding against, but it won't work in
this form.
2019-04-10 14:43:52 +02:00
Nikita Popov 397ee767fd Make zlib include_path tests more robust
One file is placed inside the script directory, we need to make
sure it has a unique name as well.
2019-04-10 13:39:17 +02:00
Nikita Popov c02a5931f4 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-10 13:07:01 +02:00
Nikita Popov 2191eac3b3 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-10 12:23:01 +02:00
ROVAST 231fecee27 fix a spell mistake
possbile => possible
2019-04-10 10:45:13 +02:00
Nikita Popov d50dcbe659 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-10 10:38:52 +02:00
Nikita Popov ce5e5b0aa3 Use release for regex in imap
The regex may be used as a cache key now.
2019-04-10 10:01:49 +02:00
Nikita Popov e2ea0f105c Fix bug #77866: Port Serializable SPL classes to use __unserialize()
Payloads created using Serializable are still supported.
2019-04-10 09:36:39 +02:00
Nikita Popov cb145e18b2 Fixed bug #77873 2019-04-09 17:27:02 +02:00
Nikita Popov b870685c5b Fix leak on error in new serialization mechanism 2019-04-09 17:19:44 +02:00
Dmitry Stogov a5e86d8264 Fixed ext/ffi/tests/044.phpt failure on 32-bit Linux 2019-04-09 16:12:13 +03:00
Dmitry Stogov ec5d4c79d2 Eliminated check for assignment to itself 2019-04-09 15:37:19 +03:00
Dmitry Stogov 5fdee9394f Micro-optimization 2019-04-09 14:38:49 +03:00
Peter Kokot 8021d52fb6 Remove duplicated substitude for Makefile
The substitution is already done in the CLI's config.m4 file. Current
SAPIs only provide one PHP_EXECUTABLE variable, i.e. PHP CLI so the one
in the configure.ac can be removed.
2019-04-09 02:09:42 +02:00
Dmitry Stogov 53189b5ebc Merge branch 'PHP-7.4' of git.php.net:php-src into PHP-7.4
* 'PHP-7.4' of git.php.net:php-src:
  Remove HAVE_STRERROR
2019-04-09 01:18:44 +03:00
Dmitry Stogov fe0a0897ba Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Repare SWITCH VM
2019-04-09 01:17:10 +03:00
Peter Kokot e6a6017f78 Remove HAVE_STRERROR
Checking for the strerror function presence is no longer needed since it
is part of the C89 standard [1] and can be safely assumed that all
current systems have it.

Check in the configure.ac and Windows defined symbol are still left
until the file library (libmagic) will be updated.

[1]: https://port70.net/~nsz/c/c89/c89-draft.html
2019-04-08 23:39:45 +02:00
Florian Berberich 07df6594b5 Added range options to the float validation filter
php_filter_int (called via the constant FILTER_VALIDATE_INT) has the options min_range
and max_range. they allow the user to not only test if a value is a double but also if
the value is inside a specific range. php_filter_float (called via the constant
FILTER_VALIDATE_FLOAT) didn't provide this yet, making validation of numeric but
not-only-int values more complicated for the user.
this commits implements the options min_range and max_range for the function
php_filter_float to fix this inconsistency.
2019-04-08 13:22:26 +02:00
Nikita Popov 897cb8bc6f Merge branch 'PHP-7.3' into PHP-7.4 2019-04-08 13:00:20 +02:00
Nikita Popov c3ca4dd53e Merge branch 'PHP-7.3' into PHP-7.4 2019-04-08 11:41:53 +02:00
Nikita Popov 9e2937d0f2 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-08 11:13:10 +02:00
Nikita Popov e86820eb56 Fix invalid function by-ref prop assign handling 2019-04-08 10:18:26 +02:00
Nikita Popov c708c4b404 Avoid time(NULL) call if explicit timestamp given
As suggested by Benjamin Coutu.
2019-04-08 09:43:47 +02:00
Peter Kokot 6acba73876 Add AS_HELP_STRING to phpdbg options 2019-04-07 23:24:10 +02:00
Peter Kokot fbb8ada009 [ci skip] Mention docs dir 2019-04-07 23:16:08 +02:00
Peter Kokot e06836a1a3 Remove checks for locale.h, setlocale, localeconv
The `<loccale.h>` header file, setlocale, and localeconv are part of the
standard C89 [1] and on current systems can be used unconditionally.

Since PHP 7.4 requires at least C89 or greater, the `HAVE_LOCALE_H`,
`HAVE_SETLOCALE`, and `HAVE_LOCALECONV` symbols defined by Autoconf in
configure.ac [2] can be ommitted and simplifed.

The bundled libmagic (file) has also been patched already in version
5.35 and up in upstream location so when it will be patched also in
php-src the check for locale.h header is still left in the configure.ac
and in windows headers definition file.

[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.4
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4

Omit the bundled libmagic files
2019-04-07 18:32:54 +02:00
Peter Kokot 5f8915786f Remove HAVE_SIGNAL_H
The `<signal.h>` header file is part of the standard C89 headers [1] and
on current systems can be included unconditionally.

Since file requires at least C89 or greater, the `HAVE_SIGNAL_H` symbol
defined by Autoconf in Zend.m4 [2] can be ommitted and simplifed.

The bundled libmagic (file) also ommits the usage of HAVE_SIGNAL_H since
5.35 however current version in PHP is very modified 5.34 version and
will be refactored separately. Check for HAVE_SIGNAL_H is therefore
still done in the configure.ac.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2019-04-07 15:55:34 +02:00
Peter Kokot fd1ad1e25a Remove HAVE_LIMITS_H
The `<limits.h>` header file is part of the standard C89 headers [1]
and on current systems can be included unconditionally.

Since PHP requires at least C89 or greater, the `HAVE_LIMITS_H` symbol
defined by Autoconf in configure.ac [2] can be ommitted and simplifed
however due to bundled file library (libmagic) and timelib still using
it, the removal there was omitted and done only in Zend.m4 file.

Current bundled libraries libtime, oniguruma, and libmagic still include
partial `HAVE_LIMITS_H` usage and will be more refactored when this is
possible.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2019-04-07 15:20:02 +02:00
Peter Kokot afd52f9d99 Refactor AC_INIT in configure.ac and PHP versions
Since Autoconf 2.53 the AC_INIT call with only a single argument has
been made obsolete and now includes several other optional arguments to
make installation experience a bit better by providing program version
and links to the project in the `./configure -h` output. This patch also
updates win build version. The phpize.m4 AC_INIT has been updated with
the call without arguments.
2019-04-07 05:52:14 +02:00
Stanislav Malyshev 3eae4f677a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Always use ZEND_SECURE_ZERO() when cleaning up data
  bump versions after release
2019-04-06 19:06:21 -07:00
Peter Kokot 8bcc7acbb0 [ci skip] Update release process docs to Markdown
- Markdown
- CS syncs
- Some partial readability fixes
- The protocol hasn't been changed
2019-04-07 00:57:41 +02:00
Christoph M. Becker 3393ae6e77 Fix ASAN configuration
Commit 6a624c1[1] mostly replaced `COMPILER_NAME` with
`COMPILER_NAME_LONG` and `COMPILER_NAME_SHORT`, but not all
occurrences, what broke the Clang ASAN configuration.  We fix this by
getting rid of `COMPILER_NAME` altogether.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=6a624c1dfda0dbfaaff3e453e6cb58de12748fb3>
2019-04-06 17:38:18 +02:00
Joe Watkins 1b85e72032 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Follow up #77849 PDOStatement objects in undefined state after clone
2019-04-06 01:31:32 +02:00
Joe Watkins 7f4a6b1478 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #77849 Disable cloning of PDO handle/connection objects to avoid segfault
2019-04-06 00:56:23 +02:00
Christoph M. Becker 7d186bc416 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update Appveyor CI to php-sdk-2.2.0beta4
2019-04-05 23:16:12 +02:00
Peter Kokot 8184d87136 [ci skip] Bring release process docs up 2 date
This syncs the latest version and the PHP-7.4 version release process
docs.
2019-04-05 22:37:01 +02:00
Peter Kokot 1dd5ab0cad Add opcache.lockfile_path and opcache.lockfile_path to ini settings
Some default opcache settings were missing.
2019-04-05 19:44:56 +02:00
Markus Staab 87b62fe7bc typo 2019-04-05 07:57:43 +02:00
Dmitry Stogov d6848625d7 Optimized "smart branch" instructions 2019-04-05 00:25:45 +03:00
Dmitry Stogov 9038d5c6ee Make is_identical() functions return zend_bool (instead of int) 2019-04-04 18:18:12 +03:00
Dmitry Stogov 575c3576a7 unused variable 2019-04-04 17:52:17 +03:00
Christoph M. Becker 2d2a374bd1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix typos
2019-04-04 14:24:56 +02:00
Matteo Beccati 15ff5db6b9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Ref #76801 remove old file source from file_sources hash in case of file included more than once
2019-04-03 14:36:20 +02:00
Dmitry Stogov dd4d43c97d Remove RC1 and RCN from scalar types. 2019-04-03 12:38:25 +03:00
Dmitry Stogov c941f1d8c7 Fixed SCCP support for ZEND_ASSIGN_OBJ_REF 2019-04-03 11:22:59 +03:00
Dmitry Stogov e03f532829 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed CFG construction for SWITCH opcodes
2019-04-03 03:11:15 +03:00
Dmitry Stogov 9ef2377d33 array_merge() may return argument with incremented reference counter 2019-04-03 00:44:31 +03:00
Peter Kokot bb8ea4d64d Clean ext/spl/tests/bug42364.phpt files after tests 2019-04-02 23:24:21 +02:00
Dmitry Stogov f53240dbc4 Use fastcall calling convention 2019-04-02 23:49:13 +03:00
Dmitry Stogov 9cb926d8d1 Improved comparison opcode handlers 2019-04-02 23:46:21 +03:00
Kalle Sommer Nielsen dce7f244a9 Remove dead JPEG2000 code 2019-04-02 21:18:06 +03:00
Remi Collet 8354c28cc5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix paste issue
2019-04-02 11:06:06 +02:00
Christoph M. Becker efb4597ecc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Pointer arithmetic on void pointers is illegal
2019-04-02 10:42:35 +02:00
Stanislav Malyshev c0af0ae5a4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #77831 - Heap-buffer-overflow in exif_iif_add_value in EXIF
2019-04-02 00:13:06 -07:00
Derick Rethans 83c9906bdb Updated to version 2019.1 (2019a) 2019-04-01 10:38:41 +01:00
Derick Rethans 4f118e87d4 Empty merge 2019-04-01 10:38:41 +01:00
Stanislav Malyshev 0eea9a6429 Unfortunately, travis CI has old oniguruma library
So we can't test it there.
2019-04-01 00:30:56 -07:00
Stanislav Malyshev 077ce33aa9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS & UPGRADING
  Add fallbacks for older oniguruma versions
  Add mbstring.regex_stack_limit to php.ini-*
  Implement RF bug #72777 - ensure stack limits on mbstring functions.
2019-04-01 00:05:36 -07:00
Stanislav Malyshev 9dcf95ab76 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
2019-03-31 23:11:30 -07:00
Stanislav Malyshev f45e7861ef Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #77753 - Heap-buffer-overflow in php_ifd_get32s
2019-03-31 23:10:04 -07:00
Anatol Belski 1686c3fa47 Improve ascii check 2019-04-01 02:16:52 +02:00
Anatol Belski f7b053f5da Rework conditions and make them more future proof 2019-03-31 22:10:56 +02:00
Anatol Belski dd0aca0c11 Implement stricter CRT check
This aligns with the recommendations about VS2015, VS2017 and VS2019
compatibility.

More info below
https://devblogs.microsoft.com/cppblog/cpp-binary-compatibility-and-pain-free-upgrades-to-visual-studio-2019/
2019-03-31 17:33:36 +02:00
Anatol Belski e4a664ecf8 Fix return 2019-03-31 14:31:57 +02:00
Anatol Belski 6a624c1dfd Rework the VS version evaluation
For the latest versions, refer also to the Visual Studio version, not to
the exact toolset version. The latest Visual Studio versions are moving
fast and the method existed previously is not sutable to keep up
anymore. Instead of refering to the exact toolset, it refers to the
Visual Studio version and implies the latest toolset available there.
That is still not ideal, another situation can arise where VS version is
not changed, but the toolset version is. It might be better to refer to
it a generic way in the future or even omit at all, and improve the
internal compatibility checks instead.
2019-03-31 14:26:00 +02:00
Anatol Belski ddce7ada4c Implement stricter extension compatibility check
This hardens the dynamic module loading by checking the linker compatibility
between the core and the dynamic module. This likely should be extended
for the CRT as well, as 2015, 2017 and 2019 versions of Visual Studio
all have same DLL name for the CRT.
2019-03-31 14:26:00 +02:00
Christoph M. Becker 2733420f82 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77827: preg_match does not ignore \r in regex flags
2019-03-31 13:35:50 +02:00
Joe Watkins 2c78b80e1e typo [ci skip] 2019-03-31 09:46:55 +02:00
Joe Watkins 79c6636f15 correct readme [ci skip] 2019-03-31 09:43:53 +02:00
Anatol Belski ba2269ab9e Fix memory leak 2019-03-30 23:04:52 +01:00
Anatol Belski 4d028a9ee9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix memory leak
2019-03-30 21:30:48 +01:00
Anatol Belski 22091084fa Use wchar_t as native type in C 2019-03-30 21:08:03 +01:00
Peter Kokot 8346b4c9f1 Move README files to a dedicated docs directory
The new dedicated docs directory has been introduced after a discussion
on GitHub[1].

Main issue it is addressing is the reduction of too many README files in
the project root directory. The new directory is dedicated for notes and
quick documentation files that either can't be put in the manual or wiki
pages or that relate to the php-src repository specifically and need to
live together with the source code.

Also the `docs` directory is by GitHub used for some repository
configuration files such as pull request templates, and contributing
documentation helper files that are integrated in the interface.

[1]: https://github.com/php/php-src/pull/3988
2019-03-30 19:38:34 +01:00
Matteo Beccati 1ce4ab1ecc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed SKIPIF when --disable-mbregex is used
2019-03-30 18:30:20 +01:00
Peter Kokot 04a9d6b915 [ci skip] Add ffi_parser.c info 2019-03-30 16:09:23 +01:00
Peter Kokot a8e879c53f Join README.GIT-RULES and CONTRIBUTING.md
This patch joins two very much related pieces of docs together in a
single file dedicated to all sorts of contributing info.

Some more changes:
- Branches info copied from the current master branch
- LXR and bonsai info removed
- Duplicated info reduced a bit
- Security branch updated to 7.1
- Refactor intro for Git commit rules
- Updated README.GIT-RULES file usage in win32/build/confutils.js
- Refactored configure.ac
2019-03-30 15:58:23 +01:00
Peter Kokot acf0411855 [ci skip] Mention PHP_PROG_BISON and PHP_PROG_RE2C 2019-03-30 13:59:14 +01:00
Anatol Belski 039500adb6 Fix handling and extend ext/ffi/tests/044.phpt 2019-03-30 12:53:32 +01:00
Peter Kokot 3207741df0 Refactor PHP_PROG_BISON and PHP_PROG_RE2C
This patch refactors these macros to also checks for the required given
versions of bison and re2c.

- PHP_PROG_RE2C and PHP_PROG_BISON take optional args - minmimum version
  required, and bison also excluded versions.
- Instead of caching values this uses manual checking and messaging
  outputs.
- It looks like the minimum version of RE2C 0.13.4 is working ok so far.

The genfiles script improvements:
- Add make override in genfiles
- Move checkings from makedist to genfiles
- Refactored output messages
- Various minor enhancements
2019-03-30 02:01:02 +01:00
Joe Watkins 072eb6dd77 tsrm environment lock 2019-03-29 19:06:02 +01:00
Dmitry Stogov 61ad294f26 Partial support for GCC mode attribute. 2019-03-29 17:28:57 +03:00
Matteo Beccati 4726c35ca3 Removed declaration inside for loops 2019-03-29 14:24:09 +01:00
Matteo Beccati 16b40a1806 Fixed SKIPIF when --disable-mbregex is used 2019-03-29 14:09:39 +01:00
Dmitry Stogov a2b39aa0de Fixed memory leaks 2019-03-29 14:33:49 +03:00
Dmitry Stogov 24fa2008dd Allow usage of incomplete types for external variables, function parameters and return values 2019-03-29 14:14:56 +03:00
Christoph M. Becker 6219815110 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test expectation
2019-03-29 09:58:37 +01:00
Dmitry Stogov 745dd94e55 Added support for more GCC extensions: attributes, __extension__, __asm__ (ignored) 2019-03-29 02:36:55 +03:00
Bob Weinand 3b23694aac Deprecate unparenthesized concatenation and addition/subtraction
Implementing RFC https://wiki.php.net/rfc/concatenation_precedence
2019-03-28 23:54:38 +01:00
Dmitry Stogov adf930c038 Ignore "__format__" attribute 2019-03-29 00:52:39 +03:00
Dmitry Stogov 94e3db64b2 Allow incomplete array variables - extern const char * const sys_errlist[] 2019-03-29 00:15:12 +03:00
Dmitry Stogov a3e52afebe Fixed bug #77768 (FFI: Builtin Types Should Not Raise Error On Redeclaration) 2019-03-29 00:02:26 +03:00
Peter Kokot 5e16f5b8d8 Remove php7.spec.in file
RPM specification file was introduced via
7c2f1384d4 for PHP to include official
RPM packages long time agon. With removal of the makerpm script via
3d51d4c90c and Linux repositories to
manage such updated and customized info in their repositories this file
is most likely not needed anymore.
2019-03-28 17:42:11 +01:00
Nikita Popov d9fbbbc868 Add additional protected visibility prototype test
See https://github.com/php/php-src/pull/3993 for context.
2019-03-28 10:14:58 +01:00
Nikita Popov 7f72d771e8 Revert "Switch to bison location tracking"
This reverts commit e528762c1c.

Dmitry reports that this has a non-trivial impact on parsing
overhead, especially on 32-bit systems. As we don't have a strong
need for this change right now, I'm reverting it.

See also comments on
https://github.com/php/php-src/commit/e528762c1c59bc0bd0bd6d78246c14269630cf0f.
2019-03-28 09:29:08 +01:00
Stanislav Malyshev bcb99a3bf7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Validate subject encoding in mb_split and mb_ereg_match
  Validate pattern against mbregex encoding
  SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
2019-03-28 00:44:42 -07:00
Joe Watkins 330517987b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix build: readline support must be disabled by default in phpdbg
2019-03-28 07:35:33 +01:00
Dmitry Stogov 363e8dd69d Support for __restrict and few GCC attributes 2019-03-28 03:01:20 +03:00
Dmitry Stogov 984d05f948 Use semantic predicates to simplify lookahead and reduce backtracking 2019-03-28 01:21:06 +03:00
Nikita Popov 0585548106 Treat abstract ctors the same, regardless of origin
Abstract ctor signatures should always be respected by all children,
independently of whether it comes from an interface or an abstract
class. Previously abstract ctor signatures (if they didn't come from
an interface) were only checked to one level of inheritance.
2019-03-27 18:09:09 +01:00
Nikita Popov d1e5006c14 Fix lineno for more inheritance errors
And also include explicit linenos in tests.
2019-03-27 13:02:28 +01:00
Nikita Popov 251f293cb7 Make line numbers for inheritance errors more precise
Use the line of the conflicting child method, rather than either the
first or last line of the class.
2019-03-27 12:42:35 +01:00
Joe Watkins fd5d659779 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Consider phpdbg as cli
2019-03-27 10:38:56 +01:00
Joe Watkins 78f0725e69 Merge branch 'PHP-7.4' of git://github.com/php/php-src into PHP-7.4 2019-03-27 10:09:34 +01:00
Joe Watkins 56293d0637 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77805 phpdbg build fails when readline is shared
2019-03-27 10:04:36 +01:00
Sara Golemon 7e7fa77a2e Validate interoperability between libsodium and libargon for argon2i(d) hashing 2019-03-27 00:36:36 -04:00
Sara Golemon d124640704 Increase default time cost for argon2 password hashing 2019-03-27 00:36:19 -04:00
Joe Watkins f177a2ac58 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  more work on phpdbg conditional breaks
2019-03-27 00:02:43 +01:00
Joe Watkins 903c1e379b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77800 phpdbg segfaults on conditional breakpoints
2019-03-26 23:06:54 +01:00
Peter Kokot 434388a610 Add minimum required PHP version to run-tests.php
This integrates a simple minimum PHP version info in the tool and to
also define the minimum version that the tool syntax should support.
2019-03-26 22:31:01 +01:00
Nikita Popov 0122f395c7 Add zend_error_at API that accepts a filename and lineno
Use this for the opcache preloading warnings, as an example usage.
2019-03-26 15:47:00 +01:00
Nikita Popov a9b01b60d8 Make PCRE cache per-request on CLI
There will only be one request on the CLI SAPI, so there is no
advantage to having a persistent PCRE cache. Using a non-persistent
cache allows us to use arbitrary strings as cache keys.
2019-03-26 10:10:41 +01:00
Peter Kokot 886b2a22e9 [ci skip] Join contributing and patches docs
This joins two similar contextual information together in the main
CONTRIBUTING.md file.

Additionally:
- http links updated to https where possible
- sentences and sections refactored more so they make some sence. GitHub
  pull requests are preferred way for contributing code.
- reorder paragraphs and contextual info
- s/mail list/mailing list
- PHP internals refactorings
- use canonical https://www.php.net
2019-03-25 22:55:50 +01:00
Peter Kokot 0d2dadc0e2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  Fix #77794: Incorrect Date header format in built-in server
2019-03-25 21:57:39 +01:00
Dmitry Stogov 164b7ec549 Regenerate parser 2019-03-25 21:45:10 +03:00
Nikita Popov 065255a0f8 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-25 17:46:28 +01:00
Nikita Popov 0b835e3e24 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-25 17:36:15 +01:00
Nikita Popov 5c26268e76 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-25 16:43:33 +01:00
Nikita Popov 071ffa2e79 Don't use parallel testing with -j1 2019-03-25 14:15:26 +01:00
Nikita Popov 3c61972451 Drop lightning for concurrent worker count
This looked rather awkward even on terminals that have full unicode
support.
2019-03-25 14:13:10 +01:00
Tyson Andre 936356bf1e Make run-tests.php compatible with php 7.0-7.2
Motivation:
As an extension author, I want to speed up running tests in php <=7.3,
both locally and in CI (e.g. with valgrind).
This can be done by manually copying php 7.4's run-tests.php script
to replace the one generated by `phpize`

- list() doesn't work in php 7.0
- negative string offset doesn't work in php 7.2

If run-tests.php can be copied from php-src without any manual patches,
that would be the easiest.

Related to #2822 - I didn't see any discussion for/against compatibility
with older php versions
2019-03-25 13:58:22 +01:00
Peter Kokot 8b94042c47 Enhance Autoconf version checking
With this required Autoconf version is now defined only on two places:
- configure.ac
- scripts/phpize.m4

and additionally:
- Script can be run from other locations
- Synced CS and portability a bit
2019-03-24 02:12:46 +01:00
Peter Kokot 092ebd032c [ci skip] Move CREDITS from root to README 2019-03-24 01:57:19 +01:00
Guilliam Xavier 516d27775d Fix tokenizer_data_gen.sh for non-posix bison
And run it to update tokenizer_data.c after recent changes in
zend_language_parser.y that reordered some tokens
2019-03-24 01:53:59 +01:00
George Peter Banyard 6b362e063c Remove enable-wddx from Travis compile as it WDDX has been unbundled as of PHP 7.4 2019-03-23 23:23:21 +01:00
Peter Kokot f63829852e [ci skip] Remove text editor modelines
These were already removed 92ac598aab
and this fixes some leftovers. These files don't really need these
settings.
2019-03-23 21:09:38 +01:00
Joe Watkins 994a897586 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix bug #76801: phpdbg too many open files error
2019-03-23 09:49:28 +01:00
Remi Collet 88c37e0b84 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  ensure pcre.jit=1 for this test
2019-03-22 15:31:53 +01:00
Remi Collet cf25a3d64d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  ensure pcre.jit=1 for these tests
2019-03-22 15:02:13 +01:00
Nikita Popov 197b0373f6 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-22 13:07:11 +01:00
Nikita Popov 9457cfca37 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-22 12:41:34 +01:00
Nikita Popov d373c11e71 Implement new custom object serialization mechanism
RFC: https://wiki.php.net/rfc/custom_object_serialization
2019-03-22 10:43:06 +01:00
Nikita Popov e7e2056d1a Remove HAVE_PCRE/HAVE_BUNDLED_PCRE checks
PCRE is always available.
2019-03-22 10:29:18 +01:00
rjhdby 5456a6ea92 Deduplicate code in zend_builtin_functions.c 2019-03-22 09:47:09 +01:00
Nikita Popov e528762c1c Switch to bison location tracking
Locations for AST nodes are now tracked with the help of bison
location tracking. This is more accurate than what we currently do
and easier to extend with more information.

A zend_ast_loc structure is introduced, which is used for the location
stack. Currently it only holds the start lineno, but can be extended
to also hold end lineno and offset/column information in the future.

All AST constructors now accept a zend_ast_loc* as first argument, and
will use it to determine their lineno. Previously this used either the
CG(zend_lineno), or the smallest AST lineno of child nodes.

On the parser side, the location structure for a whole rule can be
obtained using the &@$ character salad.
2019-03-21 16:27:48 +01:00
Nikita Popov 1cf84f1579 Try to create interned strings in preg_split as well
And convert last_match to last_match_offset, which is more
convenient now.
2019-03-21 10:19:48 +01:00
Nikita Popov 621b1f0312 Cleanup add_offset_pair API
Accept the two offsets directly, rather than doing length calculations
at all callsites. Also extract the logic to create a possibly interned
string.

Switch the split implementation to work on a char* subject internally,
because ZSTR_VAL(subject_str) is a mouthful...
2019-03-21 10:08:29 +01:00
Nikita Popov 6311581ac6 Fix bug #73948
If PREG_UNMATCHED_AS_NULL is used, make sure that unmatched capturing
groups at the end are also set to null, rather than just those in the
middle.
2019-03-21 09:50:20 +01:00
Remi Collet c1095cfed7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix test
2019-03-21 09:20:03 +01:00
Kalle Sommer Nielsen 26f98ecd19 Sync the changes to ext/filter with 7.4, now that it works.
- Removed --with-pcre-dir
- The filter extension can now be built as shared on Unix with ./configure
2019-03-20 20:09:45 +02:00
Christoph M. Becker 6bbb18a0b6 Unbundle ext/wddx
The extension is now available from <https://pecl.php.net/package/wddx>.

Cf. <https://wiki.php.net/rfc/deprecate-and-remove-ext-wddx>.
2019-03-20 14:15:50 +01:00
Remi Collet c8c86e76cf Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix tests after fix for #76717
2019-03-20 14:08:30 +01:00
Nikita Popov abc457fe1d Fixed bug #74345
Export zend_release_fcall_info_cache(). It is only necessary to
call it if the fcc may not have been used -- if it is passed to
zend_call_function() and friends, then they will take care of
freeing trampolines.
2019-03-20 12:06:42 +01:00
Remi Collet ed808c59e4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  NEWS
  Revert "Fix #77609: Tests from mailparse extension fails"
2019-03-20 11:55:44 +01:00
Nikita Popov fb109bacea Mark bug76348.phpt as online test 2019-03-20 11:40:09 +01:00
Dmitry Stogov 2ccc27bcfc Fixed incorrect error message 2019-03-20 02:41:08 +03:00
Dmitry Stogov 14359eb7eb Fixed typo 2019-03-20 01:31:35 +03:00
Peter Kokot 864366ef20 Upgrade deprecated directives and use non-posix bison
With Bison 3.0 some directives are deprecated:
- %name-prefix "x" should be %define api.prefix {x}
- %error-verbose should be %define parse.error verbose

Bison 3.3 also started emiting more warnings and since PHP souce parsers
are not POSIX compliant this patch fixes this as pointed out via
495a46aa1d.
2019-03-19 20:29:20 +01:00
Peter Kokot 38b22448f8 Remove extension readmes
This patch removes several extension readmes in favor of the PHP manual
and where possible.
2019-03-19 20:25:32 +01:00
Sara Golemon e487390564 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Bump versions for 7.2.18
2019-03-19 14:33:13 -04:00
Remi Collet 11bdc3eca4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  comment out sqlite3.defensive = 1 follow common practice, this is the default value
2019-03-19 16:28:10 +01:00
Christoph M. Becker eae32eee28 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Prepare main branch for PHP 7.3.5
2019-03-19 16:22:12 +01:00
Remi Collet 29fa3ac8b5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  fix test for upcoming pcre2 10.33
2019-03-19 16:16:13 +01:00
Nikita Popov f53e7394eb Respect OFFSET_CAPTURE when padding preg_match_all() results
This issue was mentioned in bug #73948. The PREG_PATTERN_ORDER
padding was performed without respecting the PREF_OFFSET_CAPTURE
flag, which resulted in unmatched subpatterns being either null or
[null, -1] depending on where they occur. Now they will always be
[null, -1], consistent with other usages.
2019-03-19 15:35:15 +01:00
Nikita Popov 2783670daa Merge branch 'PHP-7.3' into PHP-7.4 2019-03-19 13:59:43 +01:00
Nikita Popov 4fe3d108af Don't create a new array for empty/null match every time
If PREG_OFFSET_CAPTURE is used, unmatched subpatterns will be either
[null, -1] or ['', -1] depending on PREG_UNMATCHED_AS_NULL mode.
Instead of creating a new array like this every time, cache it inside
a global (per-request -- could make it immutable though).

Additionally check whether the subpattern is an empty string or
single character string and use an existing interned string in that
case. Empty / single-char subpatterns are common, so let's avoid
allocating strings for them.
2019-03-19 13:06:21 +01:00
Nikita Popov 38b16274d1 Revert unintended change
I wanted to cache subpat names, but we can't do that because the
cache relives request boundaries.
2019-03-19 12:01:37 +01:00
Nikita Popov 525f19bef5 Use zend_string for subpat_names table
When used with preg_match_all or preg_replace_callback(_array),
subpattern names can be used in the matches array many times.
Switch the subpat_names table to use zend_string, so we don't have
to allocate a new string every time. Also don't bother creating the
table if no $matches were passed.

This might be a regression for the case where preg_match() is used
with many trailing named subpatterns that are skipped in the result
array, but that seems rather contrived.
2019-03-19 11:59:25 +01:00
Dmitry Stogov defd421c0f Improve white-space handling 2019-03-19 13:52:55 +03:00
Nikita Popov f2438a57ff Avoid copying subpat twice if named subpats are used 2019-03-19 11:18:43 +01:00
Nikita Popov 12bcdd68b4 Fix #77094: Add flags support for pcre_replace_callback(_array) 2019-03-19 10:38:21 +01:00
Nikita Popov cfa2f0f598 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-19 10:03:11 +01:00
Nikita Popov 97bcfe54e7 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-19 09:55:52 +01:00
Dmitry Stogov 9357953bab micro-optimization 2019-03-19 02:02:14 +03:00
Peter Kokot abfab2148d Leave bundled generated files untouched
When building lexer and parser files leave bundled files untouched as
are tracked in the Git. *.orig files also don't need to be cleaned
anymore.
2019-03-18 23:02:57 +01:00
Christoph M. Becker 5b8a7412f4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix order
2019-03-18 20:08:49 +01:00
Christoph M. Becker fb51f2c7ba Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77578: Crash when php unload
2019-03-18 19:26:08 +01:00
Dmitry Stogov 46d5551fc3 Optimization for ASCII data 2019-03-18 19:33:51 +03:00
Nikita Popov 967037bb8d Don't use random mode in mysqli_query test
MYSQLI_ASYNC is also valid here, at least with mysqlnd. Rather than
using a random mode that is prone to failing once in a blue moon,
use a fixed invalid value.
2019-03-18 16:58:49 +01:00
Nikita Popov 2b9acd37f0 Fixed bug #72685
We currently have a large performance problem when implementing lexers
working on UTF-8 strings in PHP. This kind of code tends to perform a
large number of matches at different offsets on a single string. This
is generally fast. However, if /u mode is used, the full string will
be UTF-8 validated on each match. This results in quadratic runtime.

This patch fixes the issue by adding a IS_STR_VALID_UTF8 flag, which
is set when we have determined that the string is valid UTF8 and
further validation is skipped.

A limitation of this approach is that we can't set the flag for interned
strings. I think this is not a problem for this use-case which will
generally work on dynamic data. If we want to use this flag for other
purposes as well (mbstring?) then it might be worthwhile to UTF-8 validate
strings during interning. But right now this doesn't seem useful.
2019-03-18 16:58:48 +01:00
Christoph M. Becker 8c9d8c3f66 Avoid unnecessary global variable 2019-03-18 15:57:27 +01:00
Christoph M. Becker 7cdb232e37 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add bison version check to configure
2019-03-18 15:05:19 +01:00
Christoph M. Becker 9ca9394f5b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Simplfy test case
2019-03-18 14:59:08 +01:00
Nikita Popov 275fa53564 Accept zend_string* instead of char* in php_pcre_match_impl() 2019-03-18 12:32:06 +01:00
Nikita Popov 7ad04a0537 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-18 12:16:18 +01:00
Nikita Popov 65c9a3f1a1 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-18 11:41:19 +01:00
Nikita Popov 4eb9e93728 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-18 11:07:36 +01:00
Nikita Popov f7abb1e253 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-18 10:51:20 +01:00
Christoph M. Becker e0e5d26c9c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #76956: Wrong value for 'syslog.filter' documented in php.ini
2019-03-18 10:20:41 +01:00
Nikita Popov 1b411c039f Merge branch 'PHP-7.3' into PHP-7.4 2019-03-18 10:14:03 +01:00
Nikita Popov 51ed4a8d8f Merge branch 'PHP-7.3' into PHP-7.4 2019-03-18 10:04:59 +01:00
Peter Kokot 4b081c2783 [ci skip] Update changelog 2019-03-18 02:14:18 +01:00
Peter Kokot ccc29473ec Sync AC_CHECK_SIZEOF m4 macro calls
- AC_CHECK_SIZEOF is now called mostly only in PHP_CHECK_STDINT_TYPES()
  macro except for some parts checking for the 32 or 64 bit architecture.
- SIZEOF_CHAR removed since it is always 1
- ZEND_BIN_ID is now of a more logical pattern `BIN_48888` on 64bit
  architectures and `BIN_44444` on 32bit instead of literal string
  `BIN_SIZEOF_CHAR48888` on 64bit and `BIN_SIZEOF_CHAR44444` on 32bit.
  The unneeded SIZEOF_CHAR part has been removed.
- XMLRPC_TYPE_CHECKS removed
- The `long long int` is the same as `long long` and redundant checks
  removed accordingly.
- Removed PHP_CHECK_64BIT macro. Checking if current platform is 64bit
  or not can be also done simply by using a check of the long type on
  place. This removes redundant m4 macro PHP_CHECK_64BIT.
2019-03-18 02:11:23 +01:00
Fabien Villepinte b6f9ade9f2 Remove unused variables 2019-03-17 23:29:51 +01:00
Derick Rethans eabca6f87a Merge remote-tracking branch 'refs/remotes/origin/PHP-7.4' into PHP-7.4 2019-03-17 15:16:08 -04:00
Derick Rethans dd4ce986d2 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-17 15:13:16 -04:00
Peter Kokot bcaf90e5eb Remove outdated README for ext/json
The php manual already includes introduction to the JSON extension. The
re2c and bison version required to build parser and lexer files have
changed so to move this info on a central place this removes the README.
2019-03-17 20:10:26 +01:00
Derick Rethans 0325e78f4f Merge branch 'PHP-7.3' into PHP-7.4 2019-03-17 14:38:11 -04:00
Nuno Lopes 33d4282526 remove unneeded AC_REQUIRE([AC_PROG_YACC])
thanks Peter Kokot for noticing
2019-03-17 08:10:41 -04:00
Peter Kokot 20af19b9b3 Remove duplicate PHP_C_BIGENDIAN check
The bigendian check is already done via configure.ac and the variable
ac_cv_c_bigendian_php is already set.
2019-03-17 01:31:28 +01:00
Peter Kokot e525ce30a5 Move distribution generator script to scripts/dev
The more proper place for shell scripts dedicated for development, and
releasing PHP should be the scripts/dev directory. Having a cleaner root
project directory helps find the main README.md and files relevant to
install PHP.

These scripts are also used by the release managers mostly who create
release packages and aren't used often by the majority of developers
working on and installing PHP.
2019-03-16 23:51:05 +01:00
Peter Kokot 78ab79b916 Enhance the buildconf script
Changes:
- Added a short introduction what this script does
- Added usually the expected -h and --help options with explanation
  for a reason for this script and its usage.
- Messages changed a bit so the PHP installation procedure becomes
  simpler without needing to constantly remind the reader what to run
  and what not in the documentations and installation instructions.
- cd into current working directory of the buildconf (this enables
  running the script from other locations and inside other scripts).
- check if make exists
2019-03-16 23:43:25 +01:00
Nuno Lopes 2619b138c0 snmp: remove unused var 2019-03-16 19:36:12 +01:00
Peter Kokot 86f2681460 [ci skip] Remove make install step from README
The `make install` step touches files outside of the source directory
and might cause confusions with people. It should be mentioned in more
details elsewhere in the installation chapter instead and how to
override it.
2019-03-16 18:37:49 +01:00
Nuno Lopes 434fae97f2 check for bison binary, not yacc
this fixes compilation with recent bison
2019-03-16 12:22:44 -04:00
Peter Kokot d7022d2d25 [ci skip] Update changelog 2019-03-16 15:18:50 +01:00
Nuno Lopes f9e1d242f5 bump minimum bison version to 3.0 after last parser changes 2019-03-16 06:32:43 -04:00
Peter Kokot 78596973b3 Make credits script executable from other paths 2019-03-16 01:37:34 +01:00
Fabien Villepinte cf8a4b03dc Use separate output files in xmlreader tests 2019-03-15 23:50:22 +01:00
Fabien Villepinte 26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00
Pedro Magalhães 63802a8446 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Added test for #77535 fix
2019-03-15 18:13:37 +00:00
Nikita Popov 585f4cbb21 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-15 17:08:01 +01:00
Nikita Popov 2a04efe0e4 Remove unnecessary precedence/associativity annotations
Some of these are entirely unnecessary. Some specify an associativity
for operators where the concept doesn't make sense and has no effect:
Explicit associativity is only meaningful for binary operators. For
unary operators and constrained operations like instanceof or assignment
the associativity specification has no effect and only serves to confuse.

For example assignments were specified as %left, even though they will
actually behave as right-associative due to the variable requirement on
the LHS. Similarly instanceof was specified as %nonassoc, but it will
behave as left-associative, due to the restrictions places on the RHS.
2019-03-15 12:01:58 +01:00
Thiago Carvalho 4cfa01bfb8 Add tests to XMLReader 2019-03-15 00:12:13 +01:00
Peter Kokot 97d25c87d2 Clean build system
Changes:
- AC_TYPE_SIZE_T called on only one place (configure.ac)
- AC_FUNC_ALLOCA called on only one place (configure.ac)
- AC_TYPE_UID_T called on only one place (configure.ac)
- HAVE_STRSTR removed since strstr is part of C89 standard [1]
- Remove checks for strtol and strpbrk
- Checking for the presence of perror function is not needed anymore
  since it is part of C89 standard and PHP calls it unconditionally.
- Checking for functions strdup, setenv, strerror, and memmove done only
  on one place (configure.ac)
- outdated check for snprintf removed

1: https://port70.net/~nsz/c/c89/c89-draft.html
2019-03-14 20:20:12 +01:00
Peter Kokot 3a857852a8 Remove HAVE_STRFTIME
Function strftime is part of the C89 standard [1] and current systems
don't need to check for its presence anymore.

Additionally, checks for strftime function in tests have been removed
since the PHP strftime function is now always available.

1: https://port70.net/~nsz/c/c89/c89-draft.html
2019-03-14 19:42:29 +01:00
c9s a59881fa04 ext/session: remove the redundant convert_to_long 2019-03-14 17:29:10 +01:00
Nikita Popov 8bb5582751 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-14 17:26:17 +01:00
Dmitry Stogov 9499484ed2 Implemented a faster way to access predefined TSRM resources - CG(), EG(), etc. 2019-03-14 03:01:01 +03:00
Peter Kokot a1b7bc0c81 Integrate README.EXT_SKEL to help option
- Sync help output using heredoc
- Add extension building instructions
- Building with phpize is preferred option. Mention also tests
- Refactor print_success()
2019-03-13 20:56:10 +01:00
Peter Kokot 50a6a0d819 Fix duplicate symbols _zend_ce_weakrefs
The zend_ce_weakref need to be external...
2019-03-13 11:38:21 +01:00
Peter Kokot 75023cf9a9 [ci skip] Mention removed m4 macros 2019-03-13 00:16:34 +01:00
Anatol Belski e10349152b Sync with ZEND_ENABLE_STATIC_TSRMLS_CACHE enablement in ext/mbstring 2019-03-12 21:33:43 +01:00
Dmitry Stogov 824a933398 Better data packing 2019-03-12 22:19:11 +03:00
Dmitry Stogov 04b67bac32 Avoid reinitailization of ZTS cache pointer. Initialize it once in TSRM.c 2019-03-12 17:35:50 +03:00
Dmitry Stogov 7139c381f1 Fixed ZTS cache usage 2019-03-12 16:58:02 +03:00
Dmitry Stogov cf4ee57dc9 Fixed ZTS cache usage 2019-03-12 15:25:51 +03:00
Dmitry Stogov 25d4af9413 Fixed ZTS cache usage 2019-03-12 15:13:52 +03:00
Dmitry Stogov b0d76ed4ad Fixed ZTS cache usage 2019-03-12 15:05:56 +03:00
Dmitry Stogov f1b306fe11 Switch to use ZTS cache 2019-03-12 14:15:47 +03:00
Dmitry Stogov 5aa1176238 Cleanup unused module globals 2019-03-12 13:44:05 +03:00
Dmitry Stogov c48f5fe841 Fixed ZTS cache usage 2019-03-12 12:07:25 +03:00
Nikita Popov 5b778e852e Merge branch 'PHP-7.3' into PHP-7.4 2019-03-12 09:58:29 +01:00
Remi Collet 99ee5db5e0 add --enable-rtld-now in upgrade info 2019-03-12 08:26:22 +01:00
Remi Collet 233888e36a use DL_LOAD in litespeed 2019-03-12 08:23:11 +01:00
Remi Collet d633cbac1c add --enable-rtld-now build option to change dlopen behavior 2019-03-12 08:23:06 +01:00
Joe Watkins b003e0a0f5 weakrefs upgrading note 2019-03-12 06:52:43 +01:00
Joe Watkins 6529d7acd9 zend_weakrefs 2019-03-12 00:35:35 +01:00
Anatol Belski a526a6b4c1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Die hard if mc.exe or mt.exe not found
2019-03-11 20:59:51 +01:00
Christoph M. Becker aefe0dfd61 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
2019-03-11 16:31:26 +01:00
Nikita Popov cc354a0790 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-11 15:36:40 +01:00
Nikita Popov ac79d42ba6 Free trampolines from get_closure in is_callable
Also extract this logic into a function, as it's duplicated a few times.
2019-03-11 14:00:33 +01:00
Dmitry Stogov 409e0dd29f Closure::fromCallable() supports only regular methods and magic method invoked through __call()/__callStatic().
It doesn't support method of internal classes invoked through C object or class handlers.
This commit prevents crash described at bug #77708, but doesn't implement the desired behavior.
2019-03-11 15:39:34 +03:00
Dmitry Stogov e7f0a60d54 Reset fields 2019-03-11 15:38:49 +03:00
Dmitry Stogov e623df650f Fixed bug #77707 (FFI loses type information for opaque types) 2019-03-11 14:26:17 +03:00
Dmitry Stogov a1868d2291 Fixed bug #77706 (Improve error messages in FFI for incompatible arguments) 2019-03-11 13:27:23 +03:00
Andrew Brampton c79ce48ddb Fix #71890: Add support for crc32c Castagnoli's polynomial.
This variant of crc32 is heavily used by storage systems, such as iSCSI, SCTP,
Btrfs, ext4, and is increasingly being used in API (such as Google Cloud
Storage, and Apache Kafka).
2019-03-11 10:19:35 +01:00
David Carlier f8a2497584 Fix shm api detection test for opcache module on FreeBSD
Per man page the shm_open path should start with / and contain no
further slashes.
2019-03-11 10:19:35 +01:00
Joe Watkins df6e9fae8f drop unused parameter from zend_startup 2019-03-11 10:10:14 +01:00
c9s 9f6f6fe219 Remove function_table var from the caller
function_table var is not used in call_user_function macro anymore
hence replace the usage with NULL
2019-03-11 10:00:39 +01:00
Daniel Stenberg d9d253fa6b curl_exec: remove bad check for CURLE_PARTIAL_FILE
This check introduced in 2004 is wrong and removed. A HEAD request with
curl does *not* cause this error code - only if you make a regular GET
request but tell curl to send a HEAD using CURLOPT_CUSTOMREQUEST and
then you've asked for it.

You do a proper HEAD request with curl by setting the CURLOPT_NOBODY
option to 1L.

This was the case in 2004. This is still the case in 2019. This is also
documented in libcurl documentation.

This check hides the possibly serious error when this error code is
genuinely and correctly returned by curl because the transfer was
truncated and ended up partial.

As can be seen, I objected to this change already in the original bug:
https://bugs.php.net/bug.php?id=27341
2019-03-11 09:56:25 +01:00
Stanislav Malyshev 4a12fb4aba This option doesn't exist for a long time. 2019-03-11 01:14:14 -07: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
Gabriel Caruso c67c2c4d8f Fix tests filenames 2019-03-10 23:57:32 -03:00
hassan 173e126a77 Add meaningful error message for ext/zip 2019-03-11 00:15:29 +01:00
Jakub Zelenka bc57efb78f Merge branch 'PHP-7.3' into PHP-7.4 2019-03-10 16:36:55 +00:00
johnstevenson b37a6aafce Fix bc break in Windows readlink
GetFinalPathNameByHandleW is given a file handle to a symbolic link,
rather than one to the target, and therefore returns an incorrect path.

Fix symlink with relative path and add test
2019-03-10 15:48:31 +01:00
Anatol Belski 44b7126c6d Don't use Opcache with the master test process
Additionally, enable opcache.file_cache to mitigate possible reattach
failures in the tests.
2019-03-10 13:56:32 +01:00
Anatol Belski 591d6b86ab Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update libmagic.patch [skip ci]
2019-03-08 21:55:48 +01:00
Anatol Belski 93a38b1f7c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix typo in libmagic version
2019-03-08 21:45:18 +01:00
Anatol Belski c8ebfaa4eb Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #77576 pull the libmagic implementation of gmtime_r
2019-03-08 20:48:24 +01:00
Anatol Belski 6ecdd78d7a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Sync with behavior change in OpenSSL 1.1.1b
  fix news
  bump versions after release
2019-03-08 15:56:48 +01:00
Nikita Popov 59dd1979ef More zpp error/variation test removals 2019-03-08 13:46:39 +01:00
Kalle Sommer Nielsen aa33ab9696 Give Peter credit for his work on the Unix build system 2019-03-07 23:27:10 +02:00
Peter Kokot f5fa9ddbd5 Clean *nix build system
- remove some outdated and not used macro calls
- remove some unused variables
- Remove not needed comment from tokenizer config.m4
- Remove not needed comment
- remove not needed local variables for editors and syntax highlighting
2019-03-07 20:58:14 +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
Nikita Popov 2580a7ba09 More zpp error/variation test removals 2019-03-07 17:09:43 +01:00
Nikita Popov c8e10c6119 More zpp error/variation test removals 2019-03-07 15:54:31 +01:00
Dmitry Stogov 372248d5c2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  ws
2019-03-07 14:00:02 +03:00
Dmitry Stogov 2f2d15791a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #77345 (Stack Overflow caused by circular reference in garbage collection)
2019-03-07 13:53:43 +03:00
Stanislav Malyshev e5860474b7 Add support for MemorySanitizer 2019-03-06 17:07:38 -08:00
2957326956 Refactor README.md file
- Initial refactorings of the README.md file with some more user
  oriented information about the php-src repository and PHP in general.
- SVG logo added
- README.WIN32-BUILD-SYSTEM file contents moved to README.md
- INSTALL file contents moved to README.md
- Windows releases now instead of install.txt file ship with the
  README.md.
- A brief installation section added with help options mentioned for the
  configure and make.
- Also mentioned the `-j` option for build and tests

Co-authored-by: Javier Eguiluz <javier.eguiluz@gmail.com>
Co-authored-by: Gabriel Caruso <carusogabriel34@gmail.com>
Co-authored-by: Matthias Kaschubowski <nihylum@gmail.com>
2019-03-07 01:57:53 +01:00
Peter Kokot c348ed13ac Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update editorconfig
2019-03-07 01:05:43 +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 8c62c69265 More zpp error/variation test removals
Some of these tests also check non-zpp conditions -- however, there is
always some other test that also checks those error conditions.
2019-03-06 13:40:22 +01:00
Stanislav Malyshev db777e9199 Fix shifting signed values too far
Signed shift of 31 for int and 63 for long is flagged as undefined
behavior by UBSan (-fsanitize=undefined) and seems to be indeed so
according to the standard.

The patch converts such cases to use unsigned.
2019-03-06 00:50:09 -08:00
Christoph M. Becker f651397b1f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77700: Writing truecolor images as GIF ignores interlace flag
2019-03-06 00:38:12 +01:00
Nikita Popov 10b4113638 Remove more zpp error tests 2019-03-05 17:09:09 +01:00
Gabriel Caruso e907fbaf7c Remove unnecessary check for always available extension 2019-03-05 12:54:24 -03:00
Nikita Popov 7e3f4a2390 Remove more zpp error/variation tests 2019-03-05 14:09:33 +01:00
Nikita Popov 4bd18db8cc Remove custom error handler in mbstring tests
To make it more obvious what is tested and what the error messages
are.
2019-03-05 11:41:53 +01:00
Nikita Popov 94d509363d Remove more zpp error tests 2019-03-05 11:02:31 +01:00
Nikita Popov b26df0e395 Remove tests for zpp failure conditions
These tests only check zpp error conditions, so drop them per
zpp testing policy.
2019-03-05 10:22:23 +01:00
Remi Collet aeb156d8dc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  add NEWS entry
2019-03-05 07:33:11 +01:00
Dmitry Stogov ff5fa0d631 Fixed support for callbacks with "void" return type 2019-03-05 01:03:47 +03:00
Christoph M. Becker d4d0e2e6b8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
2019-03-04 19:51:17 +01:00
Stanislav Malyshev ebf3711fca Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #77630 - safer rename() procedure
2019-03-04 09:18:55 -08:00
Fabien Villepinte 972a65c882 Replace --with-gd by --enable-gd for Travis 2019-03-04 14:48:09 +01:00
Anatol Belski 53c44a43dd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test portability
2019-03-04 14:30:32 +01:00
Christoph M. Becker 70b69579d3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
2019-03-04 13:47:45 +01:00
Nikita Popov ade5474792 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-04 13:16:25 +01:00
Peter Kokot 2957651c5c Move Makefile.global and Makefile.gcov to build directory
These files can be stored in the build directory instead of bloating the
project root directory.
2019-03-04 12:30:42 +01:00
Nikita Popov deb44d405e Revert "Detect invalid uses of parent:: during compilation"
This reverts commit a9e6667817.

Breakage found in the wild: Mockery uses a parent:: call in the
implementation regardless of whether the class has a parent or not:
https://github.com/mockery/mockery/blob/4324afeaf9d95b492507e6587abb3f024e2576de/library/Mockery/Mock.php#L600

This change is not worth the compat break in 7.4.
2019-03-04 12:24:02 +01:00
Peter Kokot a8c3e22d23 Replace PHP_TM_GMTOFF with AC_CHECK_MEMBERS
Changes:
- PHP_TM_GMTOFF removed
- HAVE_TM_GMTOFF replaced with HAVE_STRUCT_TM_TM_GMTOFF
- HAVE_TM_ZONE replaced with HAVE_STRUCT_TM_TM_ZONE
- HAVE_TZNAME removed

The PHP_TM_GMTOFF macro can be replaced with Autoconf's AC_CHECK_MEMBERS
that defines the HAVE_STRUCT_TM_TM_GMTOFF symbol instead of the
HAVE_TM_ZONE.

The HAVE_TZNAME symbol is not used in current code. The obsolete
HAVE_TM_ZONE symbol has been replaced with more proper
HAVE_STRUCT_TM_TM_ZONE. These are defined by the AC_STRUCT_TIMEZONE
macro.
2019-03-04 12:13:12 +01:00
Peter Kokot 1c32d751c7 Remove mkinstalldirs, install-sh and missing
These scripts are part of Automake [1] and are in current *nix build
system not used anymore nor empty files need to be created.

[1] https://www.gnu.org/software/automake/manual/html_node/Auxiliary-Programs.html
2019-03-04 12:10:50 +01:00
Remi Collet cb1f63f422 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  add NEWS entries
2019-03-04 11:09:31 +01:00
Nikita Popov 6be93b29eb Don't generate script for proc_open_pipes tests
Commit the generated script instead, which is much simpler than
the code generating it...
2019-03-04 10:52:50 +01:00
Nikita Popov e27ba75e0f Use separate output files in x2gd tests 2019-03-04 10:48:09 +01:00
Nikita Popov 15711a4db0 Use separate directories for win32 dir tests
Also remove one redundant piece of cleanup code.
2019-03-04 10:36:55 +01:00
Stanislav Malyshev 071e18c697 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #77586 - phar_tar_writeheaders_int() buffer overflow
2019-03-03 23:33:54 -08:00
Stanislav Malyshev 534a18c08f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
  Fix test error message
  Fix bug #77563 - Uninitialized read in exif_process_IFD_in_MAKERNOTE
  Fix bug #77540 - Invalid Read on exif_process_SOFn
  Fix integer overflows on 32-bits
  Fix #77431 SplFileInfo::__construct() accepts NUL bytes
  Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename
2019-03-03 22:20:49 -08:00
Peter Kokot cb77d9c3cc [ci skip] Remove oniguruma and libzip leftovers
Oniguruma and libzip are unbundled from php-src.
2019-03-04 01:26:56 +01:00
Peter Kokot d6dac94ab1 Remove outdated hack for AIX 4
AIX 4 is not supported anymore for a while. This hack was added very
long time ago into PHP and is not needed anymore.
2019-03-03 14:51:36 +01:00
Peter Kokot 6bb657fc34 Remove AC_PROG_CC_C_O
The AC_PROG_CC_C_O macro checks if compiler can use both -c and -o
options together and if not it defines the NO_MINUS_C_MINUS_O symbol.
It is not used in current codebase and therefore removed.
2019-03-03 14:47:49 +01:00
Anatol Belski 8cd345acb1 Heedlessly enable thread LS cache for ext/hash.
It's always static now and as such always has access to the cached
TLS pointer.
2019-03-02 21:25:35 +01:00
Peter Kokot 6a54282728 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
  Fix shared module generation on AIX bug #77676
2019-03-02 18:52:30 +01:00
Peter Kokot 7431eb72fe Remove LIBZEND_CHECK_INT_TYPE and PHP_CHECK_TYPES
Checking for int32_t and uint32_t types is already done by the
PHP_CHECK_STDINT_TYPES m4 macro.

The PHP_CHECK_TYPES m4 macro has been once used by the mysqlnd and has
been removed via 14caf174ff and
additionally, the internal unused macro _PHP_DEF_HAVE_FILE has been
removed.

Additionally, the unused PHP_HAVE_STDINT_TYPES symbol has been removed.
2019-03-02 12:23:21 +01:00
Peter Kokot 220e682710 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
  Fix #77609: Tests from mailparse extension fails
2019-03-01 22:45:32 +01:00
Peter Kokot a700451706 Remove obsolescent AC_HEADER_STDC and memcpy check
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_HEADER_STDC`.

This macro checks if given system has C89 compliant header files such
as `<string.h>`, `<stdlib.h>`, `<stdarg.h>`, `<float.h>`,... and defines
the `STDC_HEADERS` symbol [2]. Case is that current systems should be
well supported with at least C89 standard headers [3].

Given headers are still additionally checked with the `AC_PROG_CC`
macro, yet not needed anyway.

Additionally, the HAVE_MEMCPY check has been removed. The memcpy
function is standardized by C89 and later.

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
[3] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
2019-03-01 19:22:44 +01:00
c9s 7c351ba65c Fix out-dated docs and typo
[ci skip]
2019-03-01 16:14:11 +01:00
Nikita Popov 51dacafc64 Use separate files for SplFileObject::setCsvControl() tests 2019-03-01 15:32:02 +01:00
Nikita Popov 6878d1026b Merge branch 'PHP-7.3' into PHP-7.4 2019-03-01 14:55:24 +01:00
Nikita Popov 2e31786627 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-01 14:52:02 +01:00
Nikita Popov df93506f56 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-01 14:35:26 +01:00
Dmitry Stogov c896b3ea48 Unused parameter 2019-03-01 14:34:17 +03:00
Dmitry Stogov a1109b28f4 Keep original debug info 2019-03-01 14:11:37 +03:00
Dmitry Stogov 7d5e2e532c Enable Posix Shared Memory on Linux 2019-03-01 12:15:56 +03:00
Rodrigo Prado 54ef8d13d8 Test for function posix_getpwnam() basic functionality
The coverage for the function posix_getpwnam() that was not covered yet.
http://gcov.php.net/PHP_HEAD/lcov_html/ext/posix/posix.c.gcov.php#1182
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
User Group: PHPSP #PHPTestFestBrasil
2019-03-01 02:01:52 +01:00
Peter Kokot e763cc7425 Fix file permissions
Git can track executable (0755) and non-executable (0644) file modes.

This patch fixes file permissions in the php-src repository according to
the predefined executable files with 0755 permissions (shell scripts)
and all others with 0644 permissions.
2019-02-28 22:07:16 +01:00
Peter Kokot f64ae64f52 Remove PHP_DECLARED_TIMEZONE and HAVE_DECLARED_TIMEZONE
The HAVE_DECLARED_TIMEZONE symbol usage has been introduced in
2fd8cbff2a
and then removed via
667a9b9bce.
2019-02-28 21:17:49 +01:00
Nikita Popov ff315098f4 Free map_base_ptr during post_startup 2019-02-28 17:23:18 +01:00
Nikita Popov 105a04aaac Don't remove CONST CAST in CONCAT operand
CONCAT assumes that CONST operands are strings, so we cannot
blindly remove CAST operands.
2019-02-28 16:42:30 +01:00
Nikita Popov 1b998bb9cb Remove unnecessary convert_to_string_safe macro
I'm assuming that the reason this existed was to avoid modifying
an interned string. However, the current code handles this case
fine already.
2019-02-28 16:30:05 +01:00
Nikita Popov 89a7b7cc96 Fix leak in resolve_property_types
We need to free the original string as well, not just the lowercased
one.
2019-02-28 16:14:56 +01:00
Nikita Popov f4ded492c9 Don't return inside _DO_THROW macro
Returning inside _DO_THROW() is kind of pointless if we are going
to comment most uses with "this is gonna return".
2019-02-28 15:45:47 +01:00
Nikita Popov 248f9cf33f Remove more leftovers of mysqli embedded server 2019-02-28 15:43:29 +01:00
Derick Rethans 9624e87a8f Merge branch 'PHP-7.3' into PHP-7.4 2019-02-28 13:52:33 +00:00
Anatol Belski 9d356bab50 Sync with 7be0e06b48 2019-02-28 14:03:49 +01:00
Christoph M. Becker 345a75f541 Remove dead code
`_php_image_output()` is only ever called for `PHP_GDIMG_CONVERT_WBM`,
`PHP_GDIMG_TYPE_GD` and `PHP_GDIMG_TYPE_GD2`.  All other image types
solely use the more flexible `_php_image_output_ctx()`.
2019-02-28 13:11:41 +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
Anatol Belski a5e986181a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Sync with behavior change in OpenSSL 1.1.1b
2019-02-28 12:53:05 +01:00
Nikita Popov a0b527eb33 Disable test parallelization on AppVeyor with opcache
This is too unstable due to shared opcache state. Disabling it until
this issue is resolved to reduce the number of spurious failures.
2019-02-28 10:57:24 +01:00
Nikita Popov a18e5c61cd Mark ext/xmlreader/tests/bug70309.phpt as online test
The relax NG schema is fetched from a remote server. We could
include it in the repo, but it's 500KB. A minimized test case would
be better.

Also, apparently this bug has never been reported upstream and just
patched in the libxml we build on Windows?
2019-02-28 10:12:40 +01:00
Nikita Popov 5e6846cad7 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-28 09:59:07 +01:00
Bob Weinand 9d5db37cee Fix test (order of warning / notice changes due to delaying until runtime) 2019-02-28 09:10:35 +01:00
Peter Kokot 6d487ee177 Remove unused package2.xml file 2019-02-28 01:09:19 +01:00
Peter Kokot 6ee82a2a48 Remove not needed PHP_PDO_PEAR_CHECK m4 macro 2019-02-28 01:08:48 +01:00
Peter Kokot 00e050e7c7 Remove ZEND_FP_EXCEPT macro and HAVE_FP_EXCEPT
Usage of the HAVE_FP_EXCEPT symbol has been removed via
c334058412 and isn't used in current code
anymore.
2019-02-27 22:53:55 +01:00
Peter Kokot 5cf570c914 Remove unused PHP_AC_BROKEN_SNPRINTF m4 macro
The snprintf function is part of the C99 standard and newer systems in
most cases all support it as defined in the standard. However, some old
Windows and HP-UX systems the function behaves differently. These checks
were also removed and PHP now uses a replacement for the snprintf
function. With gradual transition to C99 usage as a minimum requirement,
it will also be able to be replaced to system's snprintf function
directly.

Additionally in this context the unused HAVE_VSNPRINTF and check for
vsnprintf have been removed. PHP uses its own vsnprintf implementation
for now until more reliable C99 compliant function can be used from the
C libraries.
2019-02-27 21:20:30 +01:00
Peter Kokot 3aeb7b0e77 Remove deprecated PHP_EXTENSION m4 macro
The PHP_EXTENSION macro was used before the introduction of the updated
build system in the 9d9d39a0de. The
extensions at that time possibly still used the Makefile.in and Automake
and the PHP_EXTENSION macro has been replaced with the PHP_NEW_EXTENSION
macro.

Today, the once deprecated macro can be removed in favor of only
PHP_NEW_EXTENSION macro.
2019-02-27 20:12:53 +01:00
Bob Weinand 94d3e40102 Delay array to string conversion notice until runtime 2019-02-27 18:46:31 +01:00
Bob Weinand a72c741624 Uncomment cleanup for runtime_compile_time_binary_operands.phpt 2019-02-27 13:02:14 +01:00
rjhdby fcfec9102b Add runtime_compile_time_binary_operands.phpt 2019-02-27 12:59:06 +01:00
Joe Watkins b9ab686179 Merge branch 'PHP-7.4' of git://github.com/php/php-src into PHP-7.4 2019-02-27 09:18:04 +01:00
Joe Watkins 1ca9d818b8 Fix #77673 ReflectionClass::getDefaultProperties returns spooky array 2019-02-27 09:17:09 +01:00
Nikita Popov d73789ef91 Sync types in .gdbinit, improve property dumping
If an object doesn't have a property table, we need to go through
the property into table and read the corresponding slots.
2019-02-26 17:26:16 +01:00
Benjamin Eberlei d303225c3a Make regex replacements in zend_vm_gen.php more obvious
Change specializing preg_replace code in VM to be map of search to
replacement for easier understanding.
2019-02-25 17:44:26 +01:00
Nikita Popov b4cbf6faca Fix tests bareword fallback with error suppression
Re-merge commit a369326003995c137046c908e79b6ab482d34cec into PHP-7.4
(cherry picked from commit aad39879f2)
(cherry picked from commit 76f8a908bb)
2019-02-25 17:43:07 +01:00
Nikita Popov a8daef51e1 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-25 13:02:58 +01:00
Nikita Popov 251e948946 Fix some directory collisions in dir tests 2019-02-25 09:34:20 +01:00
Nikita Popov c937c55d75 Fix some port collisions in sockets tests 2019-02-25 09:24:45 +01:00
Jakub Zelenka 20af026acd Merge branch 'PHP-7.3' into PHP-7.4 2019-02-24 13:15:17 +00:00
Jakub Zelenka 043ce4c8a1 Revert "Disable bug77390.phpt"
This reverts commit 139492b1ae.
2019-02-24 13:12:38 +00:00
Peter Kokot b33fa18eab Remove unused PHP_AC_BROKEN_SPRINTF and AC_ZEND_BROKEN_SPRINTF
The sprintf function has been normalized to php_sprintf via
61364b5bb1.

This patch removes the checks to make a custom sprintf function

The ZEND_BROKEN_SPRINTF has been removed and the
hardcoded #define zend_sprintf sprintf is used.

The php_sprintf and zend_sprintf are now symbols to sprintf.

This patch now removes the custom PHP definitions of the php_sprintf and
zend_sprintf functions in favor of the C99 sprintf which is also
standardized in C89 already. Once, on some systems sprintf didn't behave
in same way.
2019-02-23 22:26:47 +01:00
Peter Kokot 6926cf356e Replace Hebrew characters with escape sequences
calendar.c includes ISO-8859-8 encoded Hebrew characters, which may
cause compile errors, and is causing issues when saving file as UTF-8.
This patch replaces characters with appropriate escape sequences.

Following 99fdf5916e.
2019-02-23 22:17:15 +01:00
Nikita Popov 139492b1ae Disable bug77390.phpt
This is causing a lot of spurious failures on AppVeyor.
2019-02-22 17:39:43 +01:00
Nikita Popov 52605aafc5 Fix anon class handling in ext mode
Opcode order changes in 7.4 and the EXT_STMT is now declare the
DECLARE_ANON. Fix this by returning the opline from compile_class_decl
to avoid any fragile opcode searching.
2019-02-22 15:43:08 +01:00
Nikita Popov dda2074bf7 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-22 13:42:13 +01:00
Nikita Popov ea115a617f Fix removal of unreachable code in SCCP
Due to a wrongly placed check, we were only performing the
unreachable code removal if there were loop vars...
2019-02-22 12:44:36 +01:00
Nikita Popov 4a98f42330 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-22 12:00:35 +01:00
Nikita Popov bb75a53771 Fix get_unresolved_initializer for static props
For static props the offset is a simple index.
2019-02-22 11:25:52 +01:00
Nikita Popov 1c9fe30425 Fix directory collisions in zlib tests 2019-02-22 11:25:52 +01:00
Nikita Popov e2cc0b823c Fix more file name collisions in phar tests 2019-02-22 11:25:52 +01:00
Christoph M. Becker b6d8d9cb7e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77648: BOM in sapi/apache2handler/php_functions.c
2019-02-22 11:11:27 +01:00
Nikita Popov d3e00decd4 Use separate files in phar tests 2019-02-22 10:50:56 +01:00
Nikita Popov 914c1ec1d4 Stricter validation for popen mode argument on Windows
Context: The ext/standard/tests/file/popen_pclose_error-win32.phpt
test often fails under parallel testing, because the "is not recognized
as an internal or external command" message doesn't actually have a
guaranteed position in the output.

While looking into this, I noticed that this test on Windows tests
something very different (invalid comand) than on Linux (invalid mode).
Here I'm adjusting the Windows popen implementation so it immediately
fails on a `rw` mode, just like it does on Linux.
2019-02-22 10:50:56 +01:00
Christoph M. Becker 427ebce629 Avoid potentially superfluous string reallocation
If we're not going to register the constant, it makes no sense to
allocate a `zend_string` and free it shortly after.
2019-02-22 10:35:19 +01:00
Nikita Popov a37c926591 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-22 10:14:28 +01:00
Christoph M. Becker f319419d51 Properly clean up test case
If we had to create an initial $start directory, we should remove it
at the end of the test.
2019-02-22 09:43:12 +01:00
Dmitry Stogov 22691f9ef7 Use different method to suppress "false" memory leak reports 2019-02-22 10:11:43 +03:00
Joe Watkins 4d3415636d While the compiler does not have the FBC set for zend_get_call_op, optimizer does, and so incorrectly results in ignoring these flags.
If someone has a better patch, please merge it ASAP, this appears to be correct as I and Nikita originally thought.

Revert "Revert "zend_get_call_op ignoring compiler flags zend_get_call_op will ignore ZEND_COMPILE_IGNORE_USER_FUNCTIONS and ZEND_COMPILE_IGNORE_USER_FUNCTIONS, breaking the intention of these flags""

This reverts commit 0bbbd0f9e7.
2019-02-21 23:54:26 +01:00
Joe Watkins 0bbbd0f9e7 Revert "zend_get_call_op ignoring compiler flags zend_get_call_op will ignore ZEND_COMPILE_IGNORE_USER_FUNCTIONS and ZEND_COMPILE_IGNORE_USER_FUNCTIONS, breaking the intention of these flags"
This reverts commit 46807ec5da.
2019-02-21 22:40:02 +01:00
Peter Kokot dd9a7d91a5 Remove unused PDO_MYSQL_LIB_CHK m4 macro
This was once used by the ext/mysql extension named as MYSQL_LIB_CHK.
The call got removed via fd1578c196. In
PDO this is not called anymore and can be removed.
2019-02-21 21:44:02 +01:00
Fabien Villepinte 9a4926b25f Fix typo in error message 2019-02-21 18:24:39 +01:00
Frank Denis b824424481 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #77646
2019-02-21 16:45:43 +01:00
Frank Denis 9609950331 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #77646
2019-02-21 16:19:44 +01:00
Nikita Popov be6f1f68bd Remove use of file resources from string function tests
These tests are pointless (they don't even have anything to do
with resources, they just use get_resource_type() as a peculiar way
to create a string), and cause unnecessary IO dependency.
2019-02-21 15:50:35 +01:00
Nikita Popov cc4c313886 Make (v)fprintf tests more robust
By using a separate file for each test. Also drop some unnecessary
SKIPIF checks for file creation. We assume that files can be created in
the test directories all over the place, so don't check for it here.
2019-02-21 15:40:43 +01:00
Nikita Popov 8c2288bb0a Merge branch 'PHP-7.3' into PHP-7.4 2019-02-21 13:46:31 +01:00
Nikita Popov 6964ba0905 Make zip oo_addglob test more robust
Use a separate directory for the test, so files created in the main
test directory cannot influence it.
2019-02-21 12:19:02 +01:00
Nikita Popov caee56d709 Don't parallelize dba tests 2019-02-21 12:13:38 +01:00
Nikita Popov 2210c6823c Merge branch 'PHP-7.3' into PHP-7.4 2019-02-21 12:06:48 +01:00
Joe Watkins 46807ec5da zend_get_call_op ignoring compiler flags zend_get_call_op will ignore ZEND_COMPILE_IGNORE_USER_FUNCTIONS and ZEND_COMPILE_IGNORE_USER_FUNCTIONS, breaking the intention of these flags 2019-02-21 11:22:30 +01:00
Nikita Popov e3d502f4de Enable parallel tests on AppVeyor
I'll be keeping an eye on spurious failures resulting from this...
2019-02-21 11:05:36 +01:00
Nikita Popov 152e5393e5 Add special "all" conflict
If a test conflicts with "all", then no other tests may be run in
parallel. This is needed for windows_mb_path tests, which rely on
the console codepage, which is shared across all parallel workers.

Also add support for comments in the CONFLICTS section/file.
2019-02-21 11:04:43 +01:00
Nikita Popov 6b110b151d Fixed bug #77643
Resolve property initializers against the correct class, even when
parent slots are reused.
2019-02-21 10:59:30 +01:00
Nikita Popov 0989b70015 Print more precise warning for unresolved constants 2019-02-21 10:35:59 +01:00
Dmitry Stogov 67682356fb Reinstall pcntl tick handler on each request (it cleared after the first request). 2019-02-20 22:36:51 +03:00
Peter Kokot 3d05a6bfea [ci skip] Update changelog 2019-02-20 20:07:23 +01:00
Peter Kokot acfafc2083 Remove unused PHP_SYS_LFS m4 macro
This was once named as AC_SYS_LFS and today it is not used in current
PHP code base anymore.
2019-02-20 20:03:21 +01:00
Peter Kokot 44b874ac75 Remove unused PHP_SOLARIS_PIC_WEIRDNESS m4 macro
This has been once used for Solaris systems and has been removed via
827ad656cb
2019-02-20 20:02:59 +01:00
Peter Kokot d936b2c4fd Remove unused PHP_TARGET_RDYNAMIC m4 macro
This has been once used with apache sapi. Since PHP 7.0 it is not used
in the PHP anymore.
2019-02-20 20:02:25 +01:00
Peter Kokot 3a6ac84aaf Remove unused AM_SET_LIBTOOL_VARIABLE m4 macro
It was once used with Automake and Zend's build files. Call has been
removed via e1f101d798
2019-02-20 20:01:31 +01:00
Dmitry Stogov 16d0824aef Supress memory leak reports 2019-02-20 18:18:44 +03:00
Nikita Popov 967fa51db0 Don't use uniqid for temporary POST data files
uniqid() is not necessarily unique when multiple testing processes
run in parallel.
2019-02-20 16:01:15 +01:00
Nikita Popov e5304bb647 Add a --shuffle mode to run-tests
Makes it easier to find paralellization issues. Of course only works
if the tests aren't order-dependent...
2019-02-20 15:59:13 +01:00
Dmitry Stogov 4f2ad75dbe Remember __COMPILER_HALT_OFFSET__(s) in preloaded scripts 2019-02-20 17:10:10 +03:00
Nikita Popov e53e753c0e Support passing single file to bless_tests.php
Or a mix of multiple directories/files. Also make the file executable.
2019-02-20 12:45:27 +01:00
Nikita Popov 57fef27521 Use PHP_BINARY by default in run-tests.php
You pretty much always want to run with -P, make it the default.
2019-02-20 12:38:40 +01:00
Nikita Popov 10e189de76 Enable parallel tests on Travis
I'll keep an eye on spurious failures resulting from this.
2019-02-20 12:19:01 +01:00
Nikita Popov 4f2b46dbaf Merge branch 'PHP-7.3' into PHP-7.4 2019-02-20 12:12:11 +01:00
Nikita Popov 991ea9cc60 Make zip oo_addpattern test more robust
Use a separate directory for the tests, so that no other tests can
concurrently create files in the same directory.
2019-02-20 12:06:02 +01:00
Nikita Popov a92db42568 Use "modify" error message for FUNC_ARG fetch as well
Avoid differences based on whether a W or FUNC_ARG fetch is performed.
2019-02-20 11:54:22 +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
Nikita Popov 0513d59ed3 Make proc_open_bug69900.phpt more robust against parallelization
With multiple workers running this might take more than 1ms. Bump
this up to the same threshold that was already used for CI.
2019-02-20 11:20:14 +01:00
Nikita Popov f5872614d8 Make ext/spl/tests/bug42364.phpt more robust
If tests are run in parallel, files may be created and deleted in
the directory. Create a separate directory just for this test to
avoid this dependence.
2019-02-20 11:19:55 +01:00
Dmitry Stogov 12edc453e5 Disable preloading for sensetive opcache tests 2019-02-20 11:47:19 +03:00
Dmitry Stogov c143794dd9 Prevent error reporting during preloading request start-up 2019-02-20 11:35:56 +03:00
Nikita Popov d94a1907b7 Use zend_parse_parameters_none() in XmlWriter::openMemory()
And fix incorrect uses in tests
2019-02-20 09:31:08 +01:00
Dmitry Stogov 6e17fbefde Added reference to parser generator 2019-02-20 10:26:56 +03:00
Peter Kokot a3e3fa78f2 Fix typo 2019-02-20 09:32:42 +03:00
Peter Kokot e765e9a8e0 Simplify even more - use PHP_VERSION directly 2019-02-20 09:32:42 +03:00
Peter Kokot e5fe8ad6e5 Bump FFI extension version to PHP_VERSION
This simplifies bumping the FFI extension version.
2019-02-20 09:32:42 +03:00
Christopher Jones 7317de59ec Correct skipif use for OCI8 password tests 2019-02-20 11:12:08 +11:00
Christopher Jones 55b539bdc2 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-20 11:11:16 +11:00
Dmitry Stogov 2cd24e9d7a Skip tests f oci8 extension is not loaded 2019-02-20 02:35:25 +03:00
Dmitry Stogov a7c99f3dc5 Reorder conditions 2019-02-20 02:33:21 +03:00
Dmitry Stogov f2e515e9eb Use ZEND_ACC_REUSE_GET_ITERATOR flag instead of run-time class modification 2019-02-20 02:32:29 +03:00
Dmitry Stogov 555fb294ec Don't preload tests without --FILE-- section 2019-02-20 00:06:57 +03:00
Dmitry Stogov 6b00238979 Order of classes may matter 2019-02-19 23:50:17 +03:00
Dmitry Stogov 0510b41a06 Don't restrict preloading with "open_basedir" directive. 2019-02-19 23:17:38 +03:00
Peter Kokot b1b392763e Rename non-existing site phpdbg.com to localhost 2019-02-19 20:21:20 +01:00
Joe Watkins a3994a9e16 begin handlers are currently invoked without access to the arguments being sent, this moves the opcode after SEND 2019-02-19 18:21:32 +01:00
Dmitry Stogov b2073253bf Better new-line handling 2019-02-19 19:22:42 +03:00
Dmitry Stogov 723acab660 Fixed memory leak 2019-02-19 19:21:36 +03:00
Nikita Popov 002c096871 Remove some zpp failure tests
These tests exclusively check zpp failure conditions, so drop them.
2019-02-19 17:12:08 +01:00
Dmitry Stogov 1133ee1167 Check for USER_FUNCTION 2019-02-19 18:39:44 +03:00
Dmitry Stogov 26ab6edffc Accurate handling of not preloaded classes 2019-02-19 18:09:44 +03:00
Nikita Popov d9094d4d64 Avoid port conflicts in stream socket tests
Also drop some useless --CLEAN-- sections.
2019-02-19 15:55:13 +01:00
Nikita Popov 2f447dd61f Remove spurious + before --CREDITS-- 2019-02-19 15:55:00 +01:00
Nikita Popov 7207686fcf Avoid file conflicts in mail tests 2019-02-19 15:54:46 +01:00
Nikita Popov 832b89d108 Avoid file conflicts in XmlWriter tests 2019-02-19 15:54:11 +01:00
Nikita Popov db894844e7 Avoid port conflicts in ext/sockets tests 2019-02-19 15:53:24 +01:00
Nikita Popov fa915614fe Make parallel run-tests compatible with IO capture tests
Inherit the main stdin/stdout/stderr streams into the worker processes.
We don't talk to workers via these pipes, so there shouldn't be a
problem doing this.
2019-02-19 15:53:15 +01:00
Dmitry Stogov 5cde3afda7 Better line handling 2019-02-19 17:16:48 +03:00
Dmitry Stogov bf51b081f5 Filter preloading warning messages 2019-02-19 17:09:07 +03:00
Dmitry Stogov 1f2dc0492d Don't try to eliminate requre/include with stream wrappers 2019-02-19 16:54:51 +03:00
Dmitry Stogov 440cdf7837 Stop PHP in case of fatal error during preloading 2019-02-19 16:46:56 +03:00
Dmitry Stogov eb03df813c ws 2019-02-19 15:51:12 +03:00
Christoph M. Becker 7f09fb021f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Prepare main branch for PHP 7.3.4
2019-02-19 13:10:04 +01:00
Remi Collet c6640b2397 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  bump version to 7.2.17-dev
2019-02-19 12:47:09 +01:00
Nikita Popov 32c0cbcbc1 Merge remote-tracking branch 'php-src/PHP-7.4' into PHP-7.4 2019-02-19 10:09:06 +01:00
Tyson Andre 12ffee57d6 Fixed bug #77631
Do not include unbound anonymous classes in get_declared_classes().

Note that earlier PHP versions would include the anonymous class in
get_declared_classes(), and return false until the class was bound,
but would not crash.
2019-02-19 10:07:40 +01:00
Joe Watkins f8cd8eb740 ZEND_COMPILE_EXTENDED_INFO split Currently a tool may not decide between debugging and profiling behaviour: We split ZEND_COMPILE_EXTENDED_INFO into ZEND_COMPILE_EXTENDED_FCALL and ZEND_COMPILE_EXTENDED_STMT We define ZEND_COMPILE_EXTENDED_INFO as ZEND_COMPILE_EXTENDED_STMT|ZEND_COMPILE_EXTENDED_FCALL 2019-02-19 10:07:02 +01:00
Tyson Andre cdfe11f80d Fix ffi test on Windows
Fixes a bug in test added in
5661feb1ef, by checking that the
relevant SO exists.

Also adds an additional test that is based on zend_printf, and
should work on both Linux and Windows.
2019-02-19 10:03:14 +01:00
Remi Collet 24433e9d25 fix build with external libpcre2 2019-02-19 09:54:32 +01:00
Remi Collet b537203d20 use pkg-config for libedit 2019-02-19 09:10:06 +01:00
Remi Collet 2850e09cbc add readline_list_history with libedit >= 3.1 and mingweditline 2019-02-19 08:51:56 +01:00
BlackEagle a8336fb7b9 gd imageloadfont, verify error while reading header
when reading the header verify we get an error when the header is
invalid.

Signed-off-by: BlackEagle <ike.devolder@gmail.com>
2019-02-19 03:26:00 +01:00
Andy McNeice 5bbf0c698f added basic test for UConverter::setSourceEncoding() 2019-02-19 03:18:26 +01:00
Andy McNeice d194ceb0c2 added basic test for UConverter::getDestinationEncoding() 2019-02-19 03:15:01 +01:00
Andy McNeice 6d9a4f11e6 added basic test for UConverter::getSourceEncoding() 2019-02-19 03:09:49 +01:00
Pedro Magalhães 40278879fd UPGRADING entry for pcntl_unshare [skip ci] 2019-02-18 19:58:56 +00:00
Andrea Faulds 5ee81e0b9d run-tests.php: fix typo 2019-02-18 20:32:16 +01:00
Pedro Magalhães bc54e59a3a Implement pcntl_unshare 2019-02-18 19:20:18 +00:00
Peter Kokot 3068a32cd0 Sync header and footer with the rest of the files
- Local variables for editors have been removed
- Copyright year ranges can be also simplified
2019-02-18 18:16:07 +01:00
Tyson Andre da3316ff0f Fix typos in code comments in Zend/ [skip ci] 2019-02-18 17:56:28 +01:00
Tyson Andre 8588a45851 Fix arginfo for tidy's global functions
See https://secure.php.net/tidy_getopt , etc.

I can't find any other obvious incorrect reflection.
2019-02-18 17:49:02 +01:00
Tyson Andre 9249d82019 Fix typos in code comments [skip ci] 2019-02-18 17:48:12 +01:00
Tyson Andre cb4c74dfe3 Fix a typo in the error messages for FFI [skip ci] 2019-02-18 17:47:41 +01:00
Dmitry Stogov 5661feb1ef Fixed bug #77632 (FFI Segfaults When Called With Variadics) 2019-02-18 18:11:55 +03:00
Dmitry Stogov 2ed013c38a Use "quick" macro variants for known argument numbers 2019-02-18 17:52:33 +03:00
Andrea Faulds 39792f5bb7 run-tests.php: experimental parallel testing support 2019-02-18 14:58:53 +01:00
Nikita Popov 709b8aaf9f Merge branch 'PHP-7.3' into PHP-7.4 2019-02-18 14:04:30 +01:00
Dmitry Stogov c9ffae1bec Fixed bug #77633
Add a new class flag to inherit get_iterator() when implementing
the Iterator/IteratorAggregate interfaces and use it for
ArrayIterator.
2019-02-18 13:47:44 +01:00
Nikita Popov 7d0d94e230 Use mremap in zend_mm_chunk_extend if available
As suggested by https://twitter.com/grsecurity. This saves an
mmap+munmap cycle in case the mapping cannot be extended in-place.
2019-02-18 12:06:59 +01:00
Dmitry Stogov 3ef9f23fce Fixed use-after-free during preloading, when q class with unresolved constant uses a preloaded trait. 2019-02-18 13:46:13 +03:00
Nikita Popov 05363890a0 Release constant names during preloading 2019-02-18 11:15:32 +01:00
Nikita Popov b7b3a600cb Don't suppress errors during in preload testing 2019-02-18 11:03:38 +01:00
Nikita Popov 2f3d61971f Don't catch opcache_compile_file failures during preloading
Compiler failures are not side-effect free, they may leave behind
parts of the file that were successfully compiled before the
failure occurred. The preloading code is not prepared to deal with
this.
2019-02-18 11:03:38 +01:00
Nikita Popov cc0e01a2fa Handle exception patterns in bless_tests.php 2019-02-18 11:03:38 +01:00
Tom Van Herreweghe 5b15908ed7 Test the warning for giving full path to dl() 2019-02-17 20:22:23 +01:00
MarkBaker cf0dd817f2 Tests for XMLWriter write cdata and raw 2019-02-17 19:43:19 +01:00
MarkBaker a84227650a SplDoublyLinkedList Iterating a DLL by reference shouldn't be permitted 2019-02-17 19:35:13 +01:00
MarkBaker 40a26587e8 Range of new tests for xmlreader functionality and exceptions/errors 2019-02-17 19:23:01 +01:00
Peter Kokot 90054c1a69 Remove unused --copy option from the makedist
The --copy option was once used with Automake. It has been
removed via 128119b9ab.
2019-02-16 21:48:45 +01:00
Peter Kokot e0c88039b6 Move some scripts from root directory to scripts/dev/
At the time of this commit, there is a dedicated folder for development
related tools and such scripts might fit better there to not bloat the
project root directory too much.

Move snapshot to scripts/dev/snapshot
2019-02-16 16:58:48 +01:00
Andrea Faulds 6662fb5c8f run-tests.php: fix all tab-space indentation inconsistency 2019-02-16 01:54:16 +01:00
Andrea Faulds 41fbeb6c56 run-tests.php: move all top-level code into a function
Prerequisite for parallelised testing:
https://github.com/php/php-src/pull/2822

Quoth Nikita @
https://github.com/php/php-src/pull/3789#issuecomment-462724550:

> @hikari-no-yume Please feel free to directly commit the first commit
> (to PHP-7.4). That's probably a big and unnecessary source of
> conflicts, and makes reviewing harder as well.
2019-02-16 01:05:04 +01:00
Christoph M. Becker f1588d841c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77626: Persistence confusion in php_com_import_typelib()
2019-02-15 18:57:17 +01:00
Nikita Popov e15d657c1a Link anonymous classes during preloading 2019-02-15 17:50:40 +01:00
Nikita Popov 970dcd240f Don't assume that all includes have been executed 2019-02-15 17:36:40 +01:00
Nikita Popov 1b31b45f6f Set filename & lineno information for preload inheritance error 2019-02-15 17:03:57 +01:00
Nikita Popov 92fae00ee0 Handle bailouts during preload linking 2019-02-15 16:56:32 +01:00
Nikita Popov a9497cecf3 Fix preload auto globals handling
We need to compute the auto globals mask before EG(symbol_table)
is cleaned out.
2019-02-15 16:37:12 +01:00
Christoph M. Becker 0520eb8772 Deprecate marking typelibs to load constants case-insensitively
This is an amendment to commit fae2246[1] which missed this opportunity
to still introduce case-insensitive constants without a deprecation
warning.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=fae22461f95dfe8153fb74a53b9c5daeec47387f>
2019-02-15 16:24:54 +01:00
Dmitry Stogov d4bef4ce7b Avoid useless code duplication, because of unused specialization 2019-02-15 17:49:39 +03:00
rjhdby d6a53ed5e0 Unify clone method error message 2019-02-15 15:08:02 +01:00
Dmitry Stogov 78a1d76962 Reduce slow code size 2019-02-15 17:03:04 +03:00
Nikita Popov e6e9bea257 Avoid uninitialized entries in properties_info_table
Also don't place it into xlat, there's only ever one user.
2019-02-15 14:43:37 +01:00
Christoph M. Becker fae22461f9 Deprecate case-insensitive constants via typelib import
As of PHP 7.3.0, case-insensitive constants are deprecated.  We catch
up on this with regard to ext/com_dotnet, which allows to import
constants from typelibs, by triggering a deprecation notice whenever
`com_load_typelib()` is called with `$case_sensitive` being `false`,
and whenever `com.autoregister_casesensitive` is set to `false`,
regardless of whether there are actually constants in the typelib which
would be imported.
2019-02-15 13:07:56 +01:00
Nikita Popov ade9d5e95b Suppress zend_throw_error during preload constant resolution
Related to bug #77615.
2019-02-15 13:03:46 +01:00
Nikita Popov c15007956d Add preloading support for typed properties
During preloading, try to resolve all property types to CEs. Add a
flag that tracks this. If not all property types can be resolved,
then the class is not eligible for preloading.
2019-02-15 12:41:45 +01:00
Nikita Popov a2e9534798 Add a --preload testing mode to run-tests.php
Not intended for general use, it has many false positives.
2019-02-15 11:23:23 +01:00
Nikita Popov 3cafa7f4df Assign (un)serialize_func during compilation
This avoids writing this cache at runtime, which is illegal if
preloading is used.

Not every serialize/unserialize function actually belongs to the
Serializable interface, but I think it's not a problem to assign
these anyway -- whether they are used ultimately depends on whether
Serializable is implemented.

Alternatively it might make sense to just drop these entirely. I
don't think this is performance critical functionality.
2019-02-15 11:20:28 +01:00
Nikita Popov ffc7e953ea properties_info_table may be in arena or shm
For immutable classes it should be shm instead of in arena.

Related to bug #77615.
2019-02-15 10:27:30 +01:00
Christoph M. Becker c62e106610 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77621: Already defined constants are not properly reported
2019-02-15 00:39:10 +01:00
BlackEagle fee9f3a8f4 gd imageloadfont test while reading header
Cover error when the header of an gd font loading is interrupted by end
of file.

Signed-off-by: BlackEagle <ike.devolder@gmail.com>
2019-02-14 22:29:35 +01:00
Rodrigo Prado de Jesus c2eb68aafe Add test to function posix_getlogin()
Increased the coverage lines 587-595 in file ext/posix/posix.c

User Groups: PHPVale   PHPSP   PHPDF    PHPWomenBR

Hangout presented by #PHPTestFestBrasil on 2017-11-14
https://www.youtube.com/watch?v=bBWkzZEadNo
2019-02-14 20:49:25 +01:00
Rodrigo Prado 2c90beacf0 Create posix_getpwnam_basic_01.phpt
User Group: PHPSP #phptestfestbrasil
2019-02-14 20:36:53 +01:00
Riccardo Magliocchetti 4411cb6656 Add basic test for posix getgrnam 2019-02-14 20:28:11 +01:00
Rodrigo Prado 34ca922125 Small change in the test to pass
This test was not passing because the VM called by travis CI is slow, see below the failure:
http://gcov.php.net/viewer.php?version=PHP_HEAD&func=tests&file=ext%2Ffileinfo%2Ftests%2Fcve-2014-3538-mb.phpt
User Group: PHPSP #phptestfestbrasil
http://phpsp.org.br/
2019-02-14 20:12:00 +01:00
Robrecht Plaisier 31a01302dd Added basic stream_filter_register test 2019-02-14 20:03:35 +01:00
rjhdby 6bf1f434f0 use local resources instead remote 2019-02-14 19:51:40 +01:00
Fabien Villepinte b996476578 Remove outdated pgsql README
[ci skip]
2019-02-14 17:06:37 +01:00
Nikita Popov adf2f39745 Fix build without global regs 2019-02-14 14:01:39 +01:00
Nikita Popov 29d87caebf Fix typo in XML test
Uncovered by the change in e63febb1c7.
2019-02-14 12:59:08 +01:00
David Walker e63febb1c7 Fixed bug #75921
Ensure that the "creating default object from empty value" warning is
always thrown. Previously some cases were missing the warning, in
particular those going through FETCH_OBJ_W rather than a dedicated
opcode (like ASSIGN_OBJ).

One slightly unfortunate side-effect of this change is that something
like $a->b->c = 'd' will now generate two warnings rather than one
when $a is null (one for property b, one for property c).
2019-02-14 12:50:25 +01:00
Nikita Popov dab5462484 Use #ifdef instead of #if 2019-02-14 11:56:33 +01:00
Nikita Popov 96daef0458 Make ABI of SIMD optimized functions independent of compiler flags
Always export these as normal functions and only use function pointers
internally if necessary.
2019-02-14 11:49:21 +01:00
Nikita Popov 1a5cff334d Remove bogus ctor checks in get_class_methods() + reflection
Contrary to the comments, these only hide constructors (old or new
style) if they a) are inherited b) come from a trait and c) are
aliased -- which doesn't make any sense at all.
2019-02-14 11:47:31 +01:00
Dmitry Stogov 43a7d95016 Fixed bug #77613 (method visibility change) (reverted ZEND_ACC_CTOR and ZEND_ACC_DTOR flags removal) 2019-02-14 13:12:50 +03:00
Nikita Popov 8b6dba25c7 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-14 10:43:45 +01:00
Nikita Popov 3ece2640ea Merge branch 'PHP-7.3' into PHP-7.4 2019-02-14 10:02:58 +01:00
Manuel Kea Baldassarri ea3cda0315 http_build_query add type cases 2019-02-13 22:00:09 +01:00
Peter Kokot 17310fd7d7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Refactor timelib.m4
2019-02-13 19:26:37 +01:00
Nikita Popov 6347f0b937 Implement ReflectionReference
RFC: https://wiki.php.net/rfc/reference_reflection
2019-02-13 12:21:18 +01:00
Anatol Belski 34122ede21 Update NEWS and UPGRADING [ci skip] 2019-02-12 19:14:32 -08:00
Anatol Belski 4f4cf9874d Change the way timer queue timer is deleted
As discussed in bug #77580, passing INVALID_HANDLE_VALUE for the
completion event improves compatibility with Wine/ReactOS. The timer
callback itself is supposed to complete fast enough, no behavior change
is to expect.
2019-02-12 18:30:55 -08:00
Rodrigo Prado b86d7738fb Add test socket_setopt() basic functionality
Rodrigo Prado de Jesus royopa@gmail.com
User Group: PHPSP #PHPTestFestBrasil
---------------------------------------------------------------
The function was not coveraged yet
sockets	Function	socket_setopt	no
http://gcov.php.net/viewer.php?version=PHP_HEAD&func=tested_functions
2019-02-13 02:30:48 +01:00
Nikita Popov e1cc714445 Fix test
Missing this change in 9364153942.
2019-02-12 18:02:16 +01:00
Nikita Popov 9364153942 Fixed bug #76430
It's somewhat ambiguous what exactly the correct behavior is
supposed to be, I'm just picking something more or less reasonable
here.
2019-02-12 17:36:07 +01:00
legale d77ad27415 Implement mb_str_split()
RFC: https://wiki.php.net/rfc/mb_str_split
2019-02-12 16:42:51 +01:00
Dmitry Stogov 083cfc07cc Use TSRM macros 2019-02-12 17:40:29 +03:00
Dmitry Stogov 626bc3a2de More accurate handling of global registers (allow VM with single global register) 2019-02-12 17:39:02 +03:00
kasper Franz c4b77e03b1 Correct section number in UPGRADING
This make the top list follow the bottom numbering

[ci skip]
2019-02-12 15:09:09 +01:00
Johannes Schlüter 10cbf9f886 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-12 15:01:06 +01:00
Johannes Schlüter 6043e66739 Merge remote-tracking branch 'origin/PHP-7.4' into PHP-7.4 2019-02-12 15:00:51 +01:00
Nikita Popov 1449d49670 Fix FFI test on Windows 2019-02-12 13:57:44 +01:00
Nikita Popov aaebf3b653 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-12 11:43:53 +01:00
Dmitry Stogov dbd7fbabe9 typo 2019-02-12 13:24:14 +03:00
Nikita Popov 9848f24a6a Merge branch 'PHP-7.3' into PHP-7.4 2019-02-12 10:50:29 +01:00
David Carlier 4e87e56e22 Adding bunch of FreeBSD socket options flags specifics.
SO_USER_COOKIE primarly to be traced via dtrace instrumentation.
If SO_USER_COOKIE is available, the rest is so the former is
two years old while the rest is from around 2008.
2019-02-12 10:27:33 +01:00
Nikita Popov 120137ca14 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-12 10:10:30 +01:00
Nikita Popov e27af3bbea Merge branch 'PHP-7.3' into PHP-7.4 2019-02-12 09:57:38 +01:00
Jachim Coudenys d8b2705d62 Test mb_str* functions for 'unknown encoding' warnings 2019-02-12 09:31:58 +01:00
Nikita Popov 478ff4027c Merge branch 'PHP-7.3' into PHP-7.4 2019-02-12 09:29:19 +01:00
Dmitry Stogov 7d4de1a77e Fixed possible crash 2019-02-12 11:21:09 +03:00
Dmitry Stogov 62fd45f530 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #77599 (Unbuffered queries; native prepared statements memory leak)
2019-02-12 11:03:55 +03:00
Dmitry Stogov 26e26969c1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Avoid dependency on "struct flock" fields order.
2019-02-12 10:22:13 +03:00
Anatol Belski 8724f9b38e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Replace broken binary SDK version
2019-02-11 22:30:49 -08:00
Anatol Belski 3cfba42b0e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update SDK version for AppVeyor
2019-02-11 22:14:17 -08:00
Christoph M. Becker 6ac8b0a783 Deprecate ext/wddx
Cf. <https://wiki.php.net/rfc/deprecate-and-remove-ext-wddx>.
2019-02-11 19:31:46 +01:00
Anatol Belski 877ce69b30 Fix 32-bit build 2019-02-11 10:24:16 -08:00
Darek Slusarczyk 9eacd9174c Merge branch 'PHP-7.3' into PHP-7.4 2019-02-11 18:47:58 +01:00
Nikita Popov 2ca123e8f0 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-11 15:50:53 +01:00
Nikita Popov 7a17be7f31 Add bless_tests.php
Helper script to perform certain kinds of trivial test updates.
2019-02-11 15:35:34 +01:00
Nikita Popov 6054b2363c Remove oniguruma lines from CONTRIBUTING 2019-02-11 15:33:28 +01:00
Nikita Popov a6c535e658 Add UPGRADING notes for oniguruma unbundling 2019-02-11 15:00:33 +01:00
Anatol Belski 2d7658959e Unbundle oniguruma in config.w32 2019-02-11 14:53:19 +01:00
Nikita Popov e91d8ac5f6 Add MB_ONIGURUMA_VERSION and use it in a version dependent test 2019-02-11 14:53:19 +01:00
Nikita Popov d1c1481081 Unbundle oniguruma
And also switch detection over to pkg-config.
2019-02-11 14:53:19 +01:00
Nikita Popov f5d2a30466 Validate subject encoding in mb_split and mb_ereg_match
We were already validating the subject encoding in most functions,
but not these two.
2019-02-11 12:31:59 +01:00
Nikita Popov 2e594265b8 Validate pattern against mbregex encoding
Oniguruma does not consistently perform this validation itself (at least
on older versions), so make sure we check pattern encoding validity on the
PHP side.
2019-02-11 12:10:40 +01:00
Nikita Popov 52c2d47c90 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-11 11:33:18 +01:00
Nikita Popov e93d6d97aa Disable PEAR by default
Installation of PEAR can be enabled using --with-pear, but will
through a deprecation warning during ./configure.
2019-02-11 11:10:13 +01:00
Nikita Popov 5ee11887df Merge branch 'PHP-7.3' into PHP-7.4 2019-02-11 09:36:35 +01:00
Christopher Jones 98b73dbd94 Merge PDO_OCI tracing attribute PR 2019-02-11 17:05:36 +11:00
Christopher Jones a1b8e6b1c1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Merge PDO_OCI PR
  PDO_OCI tracing attribute PR merge
  pdo_oci: Add client identifier and module attrs
  pdo_oci: Register new attr constants and add tests
  pdo_oci: Add PDO_OCI_ATTR_ACTION and CLIENT_INFO
2019-02-11 17:03:51 +11:00
Mark Niebergall f28bf785fd Added test for non existent file for iptcembed 2019-02-10 22:43:12 +01:00
Peter Kokot eaddc9f7d9 Fix failing tests for readline() without input
If PHP readline extension is using libedit or readline the output is
different with the readline library also the prompt is output.
2019-02-10 22:31:32 +01:00
Ward Cappelle f9d66caddf Expand FTP delete basic test with "unknown file" coverage
A port of the original https://github.com/phpcommunity/phptestfest-php-src/pull/148 pull
request, created earlier during #PHPTestFest (User Group: PHP-WVL & PHPGent).
Expands the existing FTP delete command test with coverage for deletion of
non-existing files (which returns a 550 status code).
2019-02-10 20:41:08 +01:00
Jonathan Stevens e94d98e288 Tests for readline() without input 2019-02-10 20:31:23 +01:00
Enrico Zimuel f57acf08aa Added test for openssl_pkcs12_export_to_file_error 2019-02-10 20:18:17 +01:00
Tom Van Herreweghe 3f93f1591e Tests the 'Dynamically loaded extensions are not enabled' warning for dl()
Signed-off-by: Tom Van Herreweghe <tom.van.herreweghe@dx-solutions.be>
2019-02-10 20:13:12 +01:00
Rodrigo Prado 27b366c9e4 Test function quotemeta() - using an empty string is given as str.
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
User Group: PHPSP #PHPTestFestBrasil

Test function quotemeta() - using an empty string is given as str.
This test coverage line 2722 from file /ext/standard/string.c and is not a ZPP test.
http://gcov.php.net/PHP_HEAD/lcov_html/ext/standard/string.c.gcov.php#L2722
2019-02-10 20:06:35 +01:00
Er Galvão Abbott eadfdb9617 Add test case for pcntl_setpriority basic behaviour 2019-02-10 20:03:08 +01:00
Mark Niebergall e727facd47 Added test for xml_parser_set_option
- For skipping white space and triggering invalid encoding value error
2019-02-10 19:52:31 +01:00
Pete Albrecht 76703ae5a1 fnmatch error when pattern or filename too long
i3logix PHP Testfest 2017
2019-02-10 19:38:46 +01:00
Peter Kokot 5ca12f6c5f [ci skip] Update changelog 2019-02-10 19:18:07 +01:00
Guilliam Xavier 3dd2abe3e6 Delete duplicate test file
`Zend/tests/cast_to_array_fixed.phpt` was created as exact duplicate of
`Zend/tests/cast_to_array.phpt`
2019-02-10 12:41:30 +01:00
Peter Kokot 650a217b0c Fix failing tests
The run-tests script executes the cleaning section separately and interfers
with the running test itself less. This fixes two failing tests on Windows
platforms.
2019-02-10 01:27:38 +01:00
Peter Kokot 4ae5691a60 Fix failing readline() basic test
Test for readline() basic doesn't seem to capture the STDIN in the
output for some systems such as macOS and Windows.
2019-02-09 23:40:42 +01:00
MarkBaker 31b2dcb26c Tests for __set_state magic method
Tests for __set_state magic method for DateTime, DateTimeImmutable,
DateTimeZone and DatePeriod.
2019-02-09 17:18:23 +01:00
Mark Niebergall 1253a68926 Add test for date_time_immutable invalid arguments 2019-02-09 17:05:22 +01:00
Florian Engelhardt 1227284fb5 Added basic test for ZipArchive::unchangeName() 2019-02-09 16:33:43 +01:00
Florian Engelhardt ec814c3a62 Added basic test for ZipArchive::unchangeIndex() 2019-02-09 16:27:30 +01:00
Anatol Belski 2ca3becd17 Fix TS build, ref #77377 2019-02-08 18:42:48 -08:00
Anatol Belski 12bfd9a5f5 Implement FR #77377 handle CTRL+C in Windows 2019-02-08 18:10:31 -08:00
David Stockton e1dd8cd678 Add test for null return on version_compare with bad operator 2019-02-09 02:52:17 +01:00
MarkBaker c5f9855283 Test to verify that closures can't be instantiated 2019-02-09 02:46:09 +01:00
Er Galvão Abbott d22dd5f93a Add test for pcntl_getpriority() basic behaviour 2019-02-09 02:39:46 +01:00
Joel Clermont 0506c0224a readline - add basic test 2019-02-09 01:21:52 +01:00
Rodrigo Prado dc1937e386 updated typo in test
User Group: PHPSP #phptestfestbrasil
2019-02-09 00:07:20 +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
Nikita Popov c0ce258b53 Fix incorrect outbuf freeing 2019-02-08 12:59:48 +01:00
Nikita Popov 0d4471fd28 Fix double free if post inc of typed property throws
We either need to add an extra ref because the copy is used as the
retval, which is freed by HANDLE_EXCEPTION, or we need to undef it
(done here).
2019-02-08 12:43:11 +01:00
Nikita Popov a9d4caeece Add ZEND_TRY_ASSIGN_BOOL API
Cherry-picked from master, this is of course also necessary in 7.4...
2019-02-08 12:30:54 +01:00
Nikita Popov 7a6fa7f624 Fix refcounting of prop types coming from traits 2019-02-08 12:20:31 +01:00
Nikita Popov fa123b51cc Fix invalid free 2019-02-08 10:49:54 +01:00
Nikita Popov cf7406b1f4 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-08 10:10:00 +01:00
Anatol Belski 206a925a17 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Sync test with changes in libcurl 7.64.0
  Sync test for libcurl 7.64.0
2019-02-07 22:29:30 -08:00
Peter Kokot 2b4495bf4d [ci skip] Move OPcache configure option changes 2019-02-08 00:31:25 +01:00
Peter Kokot c706a26d69 [ci skip] Update changelog 2019-02-07 18:13:45 +01:00
Derick Rethans 125045a9b1 Merge branch 'PHP-7.4' of git.php.net:php-src into PHP-7.4 2019-02-07 11:14:10 +00:00
Derick Rethans b65a5b2aec Merge branch 'PHP-7.3' into PHP-7.4 2019-02-07 11:13:01 +00:00
Nikita Popov c32da66e12 Remove --disable-opcache-filecache option
This is no longer an experimental feature, and we have the ability
to control this at runtime via an ini setting.
2019-02-07 12:07:25 +01:00
Nikita Popov a093de8cc1 Require icu-uc and icu-i18n next to icu-io 2019-02-07 11:00:51 +01:00
Nikita Popov 1a4ffcd2b4 Fix DIM_OBJ specialization in zend_vm_get_opcode_handler_func
DIM_OBJ also specializes over ASSIGN_STATIC_PROP nowadays.
2019-02-07 10:06:25 +01:00
Christoph M. Becker edb7ef4f8c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix NEWS
2019-02-05 23:05:37 +01:00
Nikita Popov b5f852a8cb Some more test removals
Noticed these while implementing error handler changes.
2019-02-05 12:42:18 +01:00
Nikita Popov 8bc663f43b Remove zpp variation tests 2019-02-05 09:38:55 +01:00
Dmitry Stogov da919a8b65 Remove copyright years. 2019-02-05 10:33:28 +03:00
Côme Chilliet d93ce17959 Mark ldap_control_paged_result and ldap_control_paged_result_response as deprecated
These functions have serious limitations and may confuse users.
Same operations can be done using the new ldap control system in search
 operations.
2019-02-04 12:20:51 +01:00
Dmitry Stogov 223d535d05 Reset common fields of EG(trampoline) 2019-02-04 13:57:03 +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
Christoph M. Becker 020ca5bf2b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Add missing notes regarding gc_status()
2019-02-03 18:32:01 +01:00
Joe Watkins ed1afdd617 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Properly check for array_replace_recursive in sccp.c
2019-02-03 08:42:07 +01:00
Nikita Popov e366ceebad Deprecate mb_ereg_replace with non-string pattern
I'm counting this towards the non-string needle deprecation from
https://wiki.php.net/rfc/deprecations_php_7_3. I wasn't aware that
mb_ereg_replace() is also affected by this issue. It's even more
ridiculous than usual here, because the integer is interpreted as
an ASCII codepoint, even though these are supposed to be multibyte
functions :(
2019-02-01 15:02:31 +01:00
Nikita Popov 882dcb43f7 Fix bogus $PHP_PCRE_REGEX checks
This variable was dropped in the pkg-config migration, which resulted
in spurious warnings about using valgrind with external PCRE. Fix the
checks to use the right variable.
2019-02-01 11:42:41 +01:00
Dmitry Stogov d91e3beaa3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #77329 (Buffer Overflow via overly long Error Messages)
2019-02-01 11:13:25 +03:00
Nikita Popov 340c6d3927 Revert "Don't silence fatal errors with @"
This reverts commit abd36289e2.

This wasn't ready for merging yet, there are still some test
failures.
2019-01-31 09:39:10 +01:00
Nikita Popov abd36289e2 Don't silence fatal errors with @ 2019-01-31 07:11:05 +01:00
Joe Watkins 25dc5f18e4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug 76596: phpdbg supports display_errors=stderr
2019-01-30 18:28:55 +01:00
Joe Watkins b8e683e868 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77546 iptcembed broken function
2019-01-30 17:10:33 +01:00
David Carlier 6a8260a0ac opcache/FreeBSD huge code page pragma support
Sort of following up on super pages support earlier, here
we also detect page mappings possibly eligible to go to
super pages.
2019-01-30 12:01:44 +01:00
Zeev Suraski a453619499 Take out some last remnants of the yearly copyright range 2019-01-30 11:48:30 +01:00
Zeev Suraski a81202ac49 Adios, yearly copyright ranges 2019-01-30 11:48:28 +01:00
Zeev Suraski 0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Christoph M. Becker 73733b9a2d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Prepare main branch for PHP 7.2.16
2019-01-30 01:30:37 +01:00
Nikita Popov 16460ebc81 Merge branch 'PHP-7.3' into PHP-7.4 2019-01-29 09:40:19 +01:00
Nikita Popov 8eeb1102d0 Avoid mention of php7 in credits script 2019-01-28 11:26:45 +01:00
Nikita Popov 768bc7a0b8 Merge branch 'PHP-7.3' 2019-01-28 09:23:53 +01:00
Nikita Popov b93aefc1a7 Fix assign to self detection 2019-01-27 20:50:08 +01:00
rjhdby 3a0fc00424 zend_compile.c: zend_is_variable(). Removed unnecessary checks. Naming according to internal logic. 2019-01-27 08:38:08 +01:00
Jakub Zelenka 9be6b16983 Merge branch 'PHP-7.3' 2019-01-25 14:16:57 +00:00
Dmitry Stogov 662243cb30 Don't hide real peak usage. 2019-01-25 13:36:32 +03:00
Nikita Popov 909d0a3d78 Fixed bug #77518 2019-01-25 11:12:34 +01:00
Nikita Popov 7f13557843 Merge branch 'PHP-7.3' 2019-01-25 11:03:29 +01:00
Dmitry Stogov 0ff71aead1 Fixed crash 2019-01-25 11:53:31 +03:00
Nikita Popov 24085b187a Remove unused prototype in mbstring
Reported by legale.
2019-01-24 16:11:35 +01:00
Andreas Treichel b1e9c73b27 Allow strip_tags with an array of allowed tagnames 2019-01-24 15:56:32 +01:00
Dmitry Stogov bf774d4d75 Reduce amount of updated memory 2019-01-24 18:01:24 +03:00
Dmitry Stogov 4887896e21 Fixed crash 2019-01-24 18:00:45 +03:00
Nikita Popov 5e4c6dec12 Merge branch 'PHP-7.3' 2019-01-24 15:14:09 +01:00
Dmitry Stogov f80b1b0c56 Delay hash table allocation 2019-01-24 16:01:04 +03:00
Dmitry Stogov ab9a9a6b20 Disallow PHP startup, in case some ext ext/standard sub-module is not initialized sucessfully. 2019-01-24 15:59:33 +03:00
Nikita Popov 2baae68961 Merge branch 'PHP-7.3' 2019-01-24 13:45:48 +01:00
Nikita Popov e7089a830a Merge branch 'PHP-7.3' 2019-01-24 13:40:54 +01:00
Christoph M. Becker 6f3880c62f Improve wording
As suggested by Tom Sommer[1].

[1] <https://github.com/php/php-src/commit/8a4c2f16217fb8f8d098355f3943f31e82bcfd71#r32037340>
2019-01-24 13:09:18 +01:00
Christoph M. Becker d7480bda76 Fix README.RELEASE_PROCESS
According to current practice, and as discussed with other RMs.
2019-01-24 12:41:53 +01:00
Dmitry Stogov fd41b99d58 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77494 (Disabling class causes segfault on member access)
2019-01-24 13:08:00 +03:00
Nikita Popov 1d984cc707 Merge branch 'PHP-7.3' 2019-01-24 10:58:24 +01:00
Gabriel Caruso 04723f2101 Make more tests run os MacOS 2019-01-22 19:17:27 -02:00
Nikita Popov 89a4c172e2 Remove the "o" serialization format
We never generate the "o" format during serialization, so let's not
keep this unnecessary attack surface around.
2019-01-22 18:09:49 +01:00
Christoph M. Becker 0daebf9a01 Merge branch 'PHP-7.3'
* PHP-7.3:
  Prepare main branch for PHP 7.3.3
2019-01-22 14:06:34 +01:00
Nikita Popov d3e5a2487f Merge branch 'PHP-7.3' 2019-01-22 12:28:44 +01:00
Nikita Popov a50198d0fe Implement ??= operator
RFC: https://wiki.php.net/rfc/null_coalesce_equal_operator

$a ??= $b is $a ?? ($a = $b), with the difference that $a is only
evaluated once, to the degree that this is possible. In particular
in $a[foo()] ?? $b function foo() is only ever called once.
However, the variable access themselves will be reevaluated.
2019-01-22 11:12:04 +01:00
Nikita Popov 50ddff94b9 Make tokenizer test robust against token renumbering 2019-01-22 11:12:04 +01:00
Dmitry Stogov a3503f0402 Most opcodes that don't consume their OP1 operand, must be terminated with real consumer, and don't have to be checked.
These checks are replaced by ZEND_ASSERT.
2019-01-22 02:11:50 +03:00
Dmitry Stogov 8cb1ae92e6 Use SSA instead of bogus reverse linear scan. 2019-01-22 01:33:35 +03:00
Dmitry Stogov 960f922ed2 Fixed odd ROPE_ADD instruction placement. 2019-01-21 23:34:09 +03:00
Christoph M. Becker d0092c2125 [ci skip] List FFI extension 2019-01-21 20:24:16 +01:00
Dmitry Stogov 6c983c6221 Use ZEND_FUNC_FREE_LOOP_VAR flag to avoid useless iterations. 2019-01-21 22:18:07 +03:00
Christoph M. Becker 467d8b3ff7 [ci skip] Add opcache.preload directive 2019-01-21 17:55:53 +01:00
Dmitry Stogov abd0651020 Avoid double live ranges recalculation. 2019-01-21 18:17:10 +03:00
Christoph M. Becker 36c825575e [ci skip] Note preloading and ext/ffi in UPGRADING 2019-01-21 15:58:02 +01:00
Christoph M. Becker 3815a03117 Remove superfluous variable
This has been missed when libsqlite3 has been unbundled.
2019-01-21 15:32:34 +01:00
Dmitry Stogov 97ccafd4c6 Live ranges construction optimization 2019-01-21 17:25:24 +03:00
Christoph M. Becker 570d4311b6 Use pkg-config to detect and configure for system libgd
Formerly, a single option `--with-gd` was sufficient to enable the
extension, and to determine whether to use the system or the bundled
libgd depending on whether a directory was passed.  Since pkg-config
determines the path automatically, we now offer `--enable-gd` (whether
the extension should be build) and `--with-external-gd` (whether to use
the system libgd).
2019-01-21 14:01:34 +01:00
Nikita Popov 3269e88468 Implement single-pass live range calculation
Instead of interleaving creation of live-ranges with the main
compiler code, compute them in a separate pass over the opcodes
as part of pass_two. Additionally, do not keep live ranges
synchronized during optimization in opcache and instead use the
same mechanism to recompute them after optimization.
2019-01-21 11:47:27 +01:00
George Wang 276d3a7d15 Merge branch 'PHP-7.3' 2019-01-20 15:11:58 -05:00
Anatol Belski 52f81c9551 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS [ci skip]
  Update NEWS [ci skip]
2019-01-20 16:00:46 +01:00
Tyson Andre 58a2ced052 [ci skip] Fix typos in UPGRADING 2019-01-19 17:46:03 +01:00
Anatol Belski 1bd7a9d6d1 Merge branch 'PHP-7.3'
* PHP-7.3:
  Skip test on unsuitable build
2019-01-19 13:56:51 +01:00
Christoph M. Becker 089f7c0bc2 Sync with upstream
Even though libgd/libgd#492 is not a relevant bug fix for PHP, since
the binding doesn't use the `gdImage*Ptr()` functions at all, we're
porting the fix to stay in sync here.
2019-01-19 11:30:12 +01:00
Christoph M. Becker 6aff4d01c7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix failing test
2019-01-19 11:21:07 +01:00
Christoph M. Becker 387c45a9bb Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77479: imagewbmp() segfaults with very large images
2019-01-19 10:18:55 +01:00
Anatol Belski 52057c3aa2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Make test output more reliable
2019-01-19 03:34:36 +01:00
Anatol Belski 1f4a04fb3f Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77484 Zend engine crashes when calling realpath in invalid working dir
2019-01-19 02:39:42 +01:00
Nikita Popov 1bc86bcdd8 Merge branch 'PHP-7.3' 2019-01-18 15:03:00 +01:00
Nikita Popov 345936aeb1 Merge branch 'PHP-7.3' 2019-01-18 12:49:08 +01:00
Nikita Popov 6beecbb0aa Merge branch 'PHP-7.3' 2019-01-18 12:06:42 +01:00
Dmitry Stogov c69d830d45 Micro-optimization 2019-01-18 12:43:42 +03:00
Dmitry Stogov 77db3d524e Optimize zend_handle_fetch_obj_flags() 2019-01-18 01:22:14 +03:00
Dmitry Stogov e6182bd4ea Improved ZEND_TRY_ASSIGN... API to avoid unnecessary double copying and reduce code bloat. 2019-01-18 00:53:48 +03:00
Jakub Zelenka c16ea99f5d Merge branch 'PHP-7.3' 2019-01-17 20:05:09 +00:00
Jakub Zelenka 4f7b6fc8ec Merge branch 'PHP-7.3' 2019-01-17 18:38:59 +00:00
Dmitry Stogov 0941f25811 Removed useless Z_REFCOUNTED_P() checks. 2019-01-17 10:53:58 +03:00
Christoph M. Becker 6d11d8d3ed Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #73614: gdImageFilledArc() doesn't properly draw pies
2019-01-16 20:23:17 +01:00
Dmitry Stogov 8661b6dd5d Reduce slow code size 2019-01-16 14:26:32 +03:00
Dmitry Stogov 44f4370880 Micro-optimization 2019-01-16 12:49:28 +03:00
Dmitry Stogov 9f05f64240 Extend zend_get_property_offset() to return property_info for typed properties. 2019-01-16 11:56:53 +03:00
Dmitry Stogov cbfb3f3fff Fixed tests 2019-01-16 11:55:52 +03:00
Dmitry Stogov fd27fd4a15 Fixed and improved incorrect usage of value_type argument. 2019-01-16 11:06:19 +03:00
Dmitry Stogov 6a2d2af06a Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fix param list for build without global reg
2019-01-16 02:30:15 +03:00
Dmitry Stogov 0b21a4ba45 Separated zend_assign_to_typed_prop() 2019-01-16 02:13:43 +03:00
Anatol Belski cd43a4629f Fix param list for build without global reg 2019-01-15 22:31:52 +01:00
Dmitry Stogov a5446cc01c Reuse zend_incdec_typed_ref() and separate zend_incdec_typed_prop() 2019-01-16 00:22:34 +03:00
Dmitry Stogov 938ba93f4a Separated zend_binary_assign_op_typed_ref() and zend_binary_assign_op_typed_prop() helpers 2019-01-15 18:49:05 +03:00
Dmitry Stogov 239305d12e Fixed uninitialized result of PRE_INC/PRE_DEC in case of exception.
Separated increment/decrement of typed reference into helper.
2019-01-15 18:03:46 +03:00
Nikita Popov 97fc84ca06 Add dummy get_gc handler for iterator wrapper
get_gc is assumed to be non-NULL in master, and get_gc can be called
on the iterator wrapper if during generator GC, so we need to define
this handler. For now it's just a dummy, though for full support we'd
have to also add a get_gc iterator handler that is called here.
2019-01-15 13:52:32 +01:00
Nikita Popov 48ca2c0833 Document pkg-config related changes
Creating a separate section in UPGRADING for this, as there are a
lot of these, and there's going to be more of them.
2019-01-15 10:15:05 +01:00
Nikita Popov 19d8a6b771 Migrate ext/gd to pkg-config
* --with-webp-dir becomes --with-webp
* --with-jpeg-dir becomes --with-jpeg
* --with-png-dir is removed. libpng is required.
* --with-zlib-dir is removed. zlib is required.
* --with-xpm-dir becomes --with-xpm.

We also enable --with-webp on Travis.
2019-01-15 10:15:05 +01:00
Nikita Popov 61d00c0c55 Fix handling of UNDEF properties in compound assign
Restore NULLing of UNDEF values in get_property_ptr_ptr for the
BP_VAR_R and BP_VAR_RW cases.
2019-01-15 09:55:55 +01:00
Dmitry Stogov 6f6532d32b Use fastcall calling convention 2019-01-15 11:14:33 +03:00
Dmitry Stogov c87c6f81f0 Removed missed and unused function declaration 2019-01-15 10:28:01 +03:00
David Carlier 62c7432fa3 Refactor subset of openssl module.
Proposal to abstract a subset of the openssl module,
to be able to use two ways encryption outside of this context.
2019-01-14 19:38:26 +00:00
Dmitry Stogov ccdd8d6a3c Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77308 (Unbuffered queries memory leak)
2019-01-14 13:59:58 +03:00
Nikita Popov 38d0c5bacd Merge branch 'PHP-7.3'
[ci skip]
2019-01-14 11:50:09 +01:00
Nikita Popov 3b74e8c165 Merge branch 'PHP-7.3' 2019-01-14 11:45:07 +01:00
Dmitry Stogov 7f053c2c49 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77263 (Segfault when using 2 RecursiveFilterIterator)
2019-01-14 13:21:03 +03:00
Dmitry Stogov 2f89baf5c7 Fixed 32/64-bit mismatch 2019-01-14 13:15:52 +03:00
Nikita Popov 93a221ec4b Merge branch 'PHP-7.3' 2019-01-14 10:24:11 +01:00
Dmitry Stogov e089d506d5 Added FFI extension 2019-01-14 11:47:50 +03:00
Nikita Popov d0fd2be642 Revert removal of private __clone() methods
I thought these were redundant, because we already NULL out the
clone_obj object handler. However, it turns out that reflection is
using private __clone() to determine clonability (isCloneable) for
the case where we only have a class, rather than an object.

As such, removing these methods would be a BC break.

This reverts commit e7131a4e9f.
This reverts commit 55bd88ce0d.
2019-01-14 09:19:30 +01:00
Nikita Popov e25e2bd9bd Change zend_try_array_init_size arg to uint32_t
If this is all the underlying API supports, it doesn't make sense to
accept something larger here...
2019-01-14 09:16:07 +01:00
Kalle Sommer Nielsen 1ff33f3161 Kill this new and insanely annoying warning
Nikita, if this is not the right way to go about it, then please amend it
2019-01-14 09:05:44 +02:00
Anatol Belski 30668755b6 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update SDK version for AppVeyor
2019-01-12 22:15:13 +01:00
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
Eli Schwartz fe8fdfa3bd ext/openssl: port to pkg-config macro and consistently require its use
openssl 0.9.8 in July 2005 first added pkg-config support, which is
earlier than the minimum supported version for php. This should
therefore be uiversally supported.
2019-01-11 11:49:37 +01:00
Sammy Kaye Powers 74c0e580ef Improve openssl_random_pseudo_bytes()
CSPRNG implementations should always fail closed. Now
openssl_random_pseudo_bytes() will fail closed by throwing an
`\Exception` in fail conditions.

RFC: https://wiki.php.net/rfc/improve-openssl-random-pseudo-bytes
2019-01-11 11:16:05 +01:00
Nikita Popov 894e78b494 Merge branch 'PHP-7.3' 2019-01-11 10:55:36 +01:00
Nikita Popov 42cd5db142 Merge branch 'PHP-7.3' 2019-01-11 10:29:45 +01:00
Christoph M. Becker 8c21ce5b2e Fix misleading variable type
We port libgd/libgd@0414bb2da0.
2019-01-11 00:21:44 +01:00
Jakub Zelenka 4eeacba6cb Merge branch 'PHP-7.3' 2019-01-10 20:17:58 +00:00
Christoph M. Becker 41c3e3d853 Remove unused variables and functions
We remove the unused variables altogether, and port
libgd/libgd@f50c24e467 to silence the
compiler warnings.
2019-01-10 18:00:27 +01:00
Christoph M. Becker d1f3746c94 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #73281: imagescale(…, IMG_BILINEAR_FIXED) can cause black border
2019-01-10 16:28:43 +01:00
Nikita Popov e88a081641 Remove unnecessary Z_PARAM_ZVAL_DEREFs 2019-01-10 15:35:00 +01:00
Christoph M. Becker 50ba0149d9 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77272: imagescale() may return image resource on failure
2019-01-10 14:25:53 +01:00
Nikita Popov a0d0cb847f Return only debug props in PDORow
Previously this returned properties of a different object, including
INDIRECTs directly, which violates our invariants. Switch this to
only return properties for debugging purposes, without INDIRECTs.
If someone complains we can extend this to other purposes, as needed.
2019-01-10 12:37:28 +01:00
Nikita Popov 5f7b934f8b Use serialize_deny handler in PDORow
Instead of a custom handler denying serialization, use the standard
one.
2019-01-10 12:37:26 +01:00
Nikita Popov 32de3469d9 Manually initialize PDORow handlers
Makes it easier to see what is specified and what isn't, and allows
grepping...
2019-01-10 12:37:24 +01:00
Nikita Popov cf3317c790 Merge branch 'PHP-7.3' 2019-01-10 10:58:07 +01:00
Nikita Popov 61b0122698 Merge branch 'PHP-7.3' 2019-01-10 10:27:57 +01:00
Xinchen Hui b1a4f90ea9 Merge branch 'PHP-7.3'
* PHP-7.3:
  Incase of invalid read
2019-01-10 14:53:36 +08:00
Nikita Popov d6e32c6ba7 Require that write_property value is not a reference
We explicitly dereference values before claling write_property,
so no need to do duplicate work.
2019-01-09 17:09:48 +01:00
Anatol Belski 537454cf60 Merge branch 'PHP-7.3'
* PHP-7.3:
  Revert visibility
2019-01-09 16:17:11 +01:00
Christoph M. Becker 50f38f9027 Update oniguruma.patch wrt. latest security fixes 2019-01-09 12:26:38 +01:00
Christoph M. Becker d13a74f72d Merge branch 'PHP-7.3'
* PHP-7.3:
  Sync NEWS with 7.3.1
2019-01-09 11:47:39 +01:00
jvoisin fbdaabba62 Fix some sign-related issues in comparisons 2019-01-09 10:01:12 +01:00
Nikita Popov 270e137ff0 Merge branch 'PHP-7.3' 2019-01-09 09:51:28 +01:00
Nikita Popov a22881520c Merge branch 'PHP-7.3' 2019-01-09 09:28:04 +01:00
Sara Golemon 2ecd13232a Merge branch 'PHP-7.3'
* PHP-7.3:
  Bump for 7.1.27
2019-01-08 14:20:30 -05:00
Christoph M. Becker 0b395ad532 Merge branch 'PHP-7.3'
* PHP-7.3:
  Sync NEWS with 7.3.1
2019-01-08 17:24:35 +01:00
Christoph M. Becker d7873ad8ff Sync NEWS with 7.3.1
All these bugs are fixed in PHP-7.3.1 already.
2019-01-08 17:23:30 +01:00
Xinchen Hui dd61845cf8 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77266 (Assertion failed in dce_live_ranges)
2019-01-08 19:19:44 +08:00
Nikita Popov 579c7d0412 Merge branch 'PHP-7.3' 2019-01-08 10:21:54 +01:00
Nikita Popov c8a5deaddd Merge branch 'PHP-7.3' 2019-01-08 09:38:11 +01:00
Remi Collet 7f22abe286 Merge branch 'PHP-7.3'
* PHP-7.3:
  cleanup merge
2019-01-08 09:34:24 +01:00
Nikita Popov 466cf77aa4 Merge branch 'PHP-7.3' 2019-01-08 09:26:44 +01:00
Andrey Hristov d12443efc7 Const changes 2019-01-07 20:16:33 +02:00
Andrey Hristov 8975e4dcd7 Simplify the command factory
Since more than an year it not possible to create commands in the heap
but they are allocated on the stack and directly run. In this regard, it
doesn't make sense to have all the vararg stuff. Commands made sense
to be created and pushed onto a stack then a general executor will
run thru the stack and execute/handle the commands.
2019-01-07 18:47:39 +02: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
Andrey Hristov 711e1fb33b Mark const what should not be changed 2019-01-07 15:07:24 +02:00
Derick Rethans 362f8b5f97 Merge branch 'PHP-7.3' 2019-01-07 12:49:01 +00:00
Christoph M. Becker 90364da364 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix NEWS
  Updated to version 2018.9 (2018i)
2019-01-07 13:11:31 +01:00
Derick Rethans 1eedfe70ae Updated to version 2018.9 (2018i) 2019-01-07 11:50:17 +00:00
Derick Rethans 4aa430dafa Empty merge 2019-01-07 11:50:17 +00:00
Remi Collet 2747b70fdd Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] fix NEWS
2019-01-07 11:12:58 +01:00
Remi Collet 36cb111150 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] fix NEWS
2019-01-07 11:03:14 +01:00
Nikita Popov 767cbd93c9 Merge branch 'PHP-7.3' 2019-01-07 10:05:33 +01:00
Stanislav Malyshev ea168c706a Merge branch 'PHP-7.2'
* PHP-7.2:
  Still leaking for some reason, XFAIL for now, I'll look into it later.
2019-01-07 01:03:55 -08:00
Stanislav Malyshev 8eff852c1b Still leaking for some reason, XFAIL for now, I'll look into it later. 2019-01-07 01:03:55 -08:00
Stanislav Malyshev 28057f3827 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix bug #77418 - Heap overflow in utf32be_mbc_to_code
  Add NEWS
  [ci skip] Add NEWS
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 23:35:27 -08:00
Stanislav Malyshev 8fa0bc68b8 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix tests - newer versions check Unicode
  Add NEWS
  Add NEWS
  Fix test
2019-01-06 13:50:48 -08:00
Stanislav Malyshev 0f148839b5 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77367: Negative size parameter in mb_split
  Fix #77369 - memcpy with negative length via crafted DNS response
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 12:50:10 -08: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
Andreas Treichel 3c9af3095c Preserve aspect ratio for width or height 2019-01-05 13:39:49 +01:00
Peter Kokot e1f101d798 Remove separate *nix system build for Zend engine
Removed files used to provide building Zend engine separately using
Autoconf and Automake:
  cd Zend && ./buildconf && ./configure

Since Zend engine is tightly integrated in the PHP code itself and
current root configure.ac and acinclude provide this patch removes
these. Removed files also included several obsolete macros and
Automake dependency which is not used in main *nix PHP build system.
2019-01-04 22:04:05 +01:00
Andrey Hristov f1ede80781 const-ify some functions 2019-01-04 13:55:34 +02:00
Nikita Popov 1be8b3cbd8 Merge branch 'PHP-7.3' 2019-01-04 12:41:30 +01:00
Andrey Hristov 4c4216bcab Add type safety for mysqlnd plugin developers 2019-01-04 13:12:04 +02:00
Nikita Popov 9ca217f506 Resolve parent::class at compile-time if possible
And remove some dead code.
2019-01-04 12:10:22 +01:00
Nikita Popov a9e6667817 Detect invalid uses of parent:: during compilation
We already detect the case where we're entirely outside a class --
now also check whether there actually is a parent.

This is a minor BC break, in that code that was never executed
might have previously contained an invalid parent:: reference without
generating an error.
2019-01-04 11:55:41 +01:00
Nikita Popov 447b3470de Support parent::class inside constexpr contexts 2019-01-04 11:46:57 +01:00
Nikita Popov f58846a15d Handle self::class separately from __CLASS__ in const eval 2019-01-04 11:46:57 +01:00
Andrey Hristov 71ffae9605 Revert visibility 2019-01-04 12:24:10 +02:00
Nikita Popov 9b3fda4342 Don't replace self::class with __CLASS__ during const eval
Instead delay this until const expression compilation. Otherwise
self::class and [self::class] have different behavior...
2019-01-04 11:16:59 +01:00
Nikita Popov 6aa55a28b5 Fix intl build
class is a reserved keyword in C++...
2019-01-04 11:03:03 +01:00
Nikita Popov 290adc4132 Introduce separate ZEND_AST_CLASS_NAME AST node
Instead of representing this as a ZEND_AST_CLASS_CONST with a
"class" constant name.

Class constants and ::class are unrelated features that happen to
share syntax, so represent and handle them separately.
2019-01-04 10:49:23 +01:00
Nikita Popov 03094c7af3 Merge branch 'PHP-7.3' 2019-01-04 09:53:36 +01:00
Nikita Popov b8e9f30e93 Merge branch 'PHP-7.3'
[ci skip]
2019-01-04 09:08:19 +01:00
Nikita Popov beaea5c560 Merge branch 'PHP-7.3' 2019-01-03 10:26:17 +01:00
Nikita Popov 043a11cf01 Merge branch 'PHP-7.3' 2019-01-03 09:40:49 +01:00
Nikita Popov fe359cf1ff Fix undefined function error message
This got fixed on 7.3, but the implementation is slightly different
on master and the new test was failing.
2019-01-02 15:41:38 +01:00
Nikita Popov 31375c5ca3 Merge branch 'PHP-7.3' 2019-01-02 14:14:07 +01:00
Nikita Popov acd3bae001 Merge branch 'PHP-7.3' 2019-01-02 13:00:29 +01:00
Nikita Popov f9208e9bf8 Merge branch 'PHP-7.3' 2019-01-02 11:34:24 +01:00
Andrey Hristov d64b74869c Test commit 2019-01-02 12:30:12 +02:00
Nikita Popov 25d56a594d Merge branch 'PHP-7.3' 2019-01-02 11:21:30 +01:00
Nikita Popov 2fab3302ae Use ZEND_PARSE_PARAMETERS_NONE in pcre
Instead of the manual ZEND_PARSE_PARAMETERS_START(0, 0) form.
2019-01-02 11:18:35 +01:00
Anatol Belski 5c3bac9c21 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS
  Fixed bug #75684 In mysqlnd_ext_plugin.h the plugin methods family has no external visibility
2019-01-02 11:03:16 +01:00
Nikita Popov 7ac3c2fa65 Fix ZEND_NORMALIZE_BOOL usage
Typo introduced in cdd8368d6f.
2019-01-02 09:56:40 +01:00
Nikita Popov 636b1c3d26 Drop _ex from zend_compile_class_ref_ex
The non-ex version no longer exists.
2019-01-02 09:56:40 +01:00
Xinchen Hui b04829d10f Merge branch 'PHP-7.3'
* PHP-7.3:
  Entry get lost while merging
2019-01-02 16:46:56 +08:00
Xinchen Hui 85983602d1 Merge branch 'master' of git.php.net:/php-src
* 'master' of git.php.net:/php-src:
  Fixed bug #77257
2019-01-02 16:46:02 +08:00
Xinchen Hui 384b02d058 Fixed bug #77387 (Recursion detection broken when printing GLOBALS) 2019-01-02 16:42:21 +08:00
Xinchen Hui 476eba13d8 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77387 (Recursion detection broken when printing GLOBALS)
2019-01-02 16:42:13 +08:00
Nikita Popov 685307b081 Merge branch 'PHP-7.3' 2019-01-02 09:32:59 +01:00
Xinchen Hui 1a0c325b89 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77376 ("undefined function" message no longer includes namespace)
2019-01-02 15:32:29 +08:00
Xinchen Hui c5c76fbd61 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS
  Fixed bug #77395 (segfault about array_multisort)
2019-01-02 12:10:41 +08:00
Christoph M. Becker c670b622ab Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77391: 1bpp BMPs may fail to be loaded
2018-12-31 20:52:27 +01:00
Christoph M. Becker 0f9d369921 Merge branch 'PHP-7.3'
* PHP-7.3:
  Regenerate certs for openssl tests
2018-12-31 18:28:11 +01:00
Christoph M. Becker 9a497f5c10 Merge branch 'PHP-7.3'
* PHP-7.3:
  Drop deprecated /Gm compile option
2018-12-30 14:37:31 +01:00
Anatol Belski 67c0415d86 Merge branch 'PHP-7.3'
* PHP-7.3:
  Increase timeout for test on AppVeyor
2018-12-29 17:52:10 +01:00
Anatol Belski e1ec033d1b Merge branch 'PHP-7.3'
* PHP-7.3:
  Add memory check to the test
2018-12-29 16:23:54 +01:00
Anatol Belski 731b82eb71 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
2018-12-28 16:41:47 +01:00
Dmitry Stogov a9bbc827f1 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fixed bug #77346 webm files incorrectly detected as application/octet-stream
2018-12-28 15:35:08 +03:00
Dmitry Stogov b8d6aac5ad Micro optimization 2018-12-28 15:34:33 +03:00
Anatol Belski a11e7d2c1f Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77346 webm files incorrectly detected as application/octet-stream
2018-12-28 13:27:31 +01:00
Dmitry Stogov 617c90bcb9 Eliminate zend_string_destroy() wrapper in release build 2018-12-28 15:25:57 +03:00
Dmitry Stogov 76d8f3923e Revert HASH_FLAG_INITIALIZED into HASH_FLAG_UNINITIALIZED. 2018-12-28 11:22:18 +03:00
Dmitry Stogov c706adaaab Added missing invalidations. 2018-12-28 00:14:49 +03:00
Dmitry Stogov 675a8a64c3 Use HT_IS_INITIALIZED() and HT_INVALIDATE() macros instead of hackish HT_FLAGS assumtions. 2018-12-27 22:48:25 +03:00
Dmitry Stogov c2179309f4 Removed useless check 2018-12-27 22:35:37 +03:00
Nikita Popov cd7601ebfc Merge branch 'PHP-7.3' 2018-12-27 15:34:22 +01:00
Nikita Popov 6a06190850 Merge branch 'PHP-7.3' 2018-12-27 15:29:51 +01:00
Dmitry Stogov 9bf80ef385 Respect static method visibility 2018-12-27 10:42:52 +03:00
Dmitry Stogov e8daada82e Tune ARRAY_KEY_EXISTS opcode handler for speed and code size 2018-12-27 02:34:52 +03:00
Nikita Popov f1c0e671e9 Add performance improvement section to UPGRADING
[ci skip]
2018-12-26 22:26:49 +01:00
Dmitry Stogov 70fcbe3524 Fixed ext/spl/tests/bug61347.phpt failure introduced by ZEND_ARRAY_KEY_EXISTS opcode 2018-12-27 00:20:20 +03:00
Nikita Popov 0bbfebb6d9 Add SCCP support for ZEND_ARRAY_KEY_EXISTS 2018-12-26 23:54:11 +03:00
Michael Moravec f5044a12dd Implement ZEND_ARRAY_KEY_EXISTS opcode to speed up array_key_exists() 2018-12-26 23:54:11 +03:00
Anatol Belski 9bd4aab081 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS [ci skip]
2018-12-26 20:46:16 +01:00
Anatol Belski c8dc8d0839 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS [ci skip]
  Update NEWS [ci skip]
2018-12-26 20:08:06 +01:00
Anatol Belski 8789348364 Merge branch 'PHP-7.3'
* PHP-7.3:
  Initialize s_un (sockaddr_un) to zero before using it. Fixes #76839.
2018-12-26 19:03:04 +01:00
Nikita Popov 27e9c05e81 Remove preg_options param from pcre_get_compiled_regex()
This parameter is always zero and not necessary to call pcre2_match.

I'm leaving the parameter behind on the _ex() variant, so the preg_flags
are still accessible in some way.
2018-12-26 17:20:13 +01:00
Nikita Popov fc30c0f7ad Merge branch 'PHP-7.3' 2018-12-26 17:13:21 +01:00
Nikita Popov e595f5cd8a Migrate ext/zlib to use pkg-config
There are other extensions checking for zlib as well, not quite
sure what to do there with regard to option names.
2018-12-26 16:59:24 +01:00
Dmitry Stogov df850bf2d2 Reduce agressive inlining 2018-12-26 18:29:04 +03:00
Dmitry Stogov 9882929bfa Removed transparent wrapper 2018-12-26 17:34:03 +03:00
Anatol Belski 92ecc93aca Merge branch 'PHP-7.3'
* PHP-7.3:
  Update binary SDK version for AppVeyor
2018-12-26 14:19:04 +01:00
Eli Schwartz c1a22f3d4e Require pkg-config for external PCRE
Use standard PKG_CHECK_MODULES macro and remove the fallback case.
The option is renamed to --with-external-pcre and no longer accepts
an explicit path -- it should be specified through pkg-config instead.
2018-12-26 13:51:15 +01:00
Eli Schwartz 285a077c12 ext/gd: use --with instead of --enable
By convention it probably makes sense to stick with this even when
dropping the *-dir=DIR part.

See:
https://github.com/php/php-src/pull/3632#discussion_r229474568
https://autotools.io/autoconf/arguments.html
2018-12-26 13:37:39 +01:00
Anatol Belski f44d53bb4a Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77317 __DIR__, __FILE__, realpath() reveal physical path for subst virtual drive
2018-12-26 13:05:46 +01:00
Dmitry Stogov 95d8e05554 Merge branch 'PHP-7.3'
* PHP-7.3:
  Respect EG(vm_stack_page_size)
2018-12-26 13:10:02 +03:00
Dmitry Stogov cbf642b715 Create object only after parameter checks 2018-12-26 13:06:33 +03:00
Dmitry Stogov 22c9d19144 Removed useless zval_ptr_dtor(return_value) 2018-12-26 12:58:11 +03:00
Dmitry Stogov d90a5d2e1a Micro optimization 2018-12-26 12:30:30 +03:00
Dmitry Stogov 636b16402b Fixed crashes introduced by 7e597f48e9 (only master was affected) 2018-12-25 23:30:59 +03:00
Dmitry Stogov a111dfae0b Removed dead condition 2018-12-25 19:23:40 +03:00
Dmitry Stogov 2954a309de Avoid code duplication 2018-12-25 17:48:29 +03:00
Dmitry Stogov f153f11595 Merge branch 'PHP-7.3'
* PHP-7.3:
  Backport later interned strings destruction.
2018-12-24 13:45:52 +03:00
Dmitry Stogov 773ed62555 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77339 (__callStatic may get incorrect arguments)
2018-12-24 13:25:24 +03:00
Dmitry Stogov b95cd92b9d Added note about changes in class declaration opcodes 2018-12-24 10:51:48 +03:00
Nikita Popov 1fbc309e2c Merge branch 'PHP-7.3' 2018-12-23 20:21:16 +01:00
Derick Rethans e7e8112fcd Merge branch 'PHP-7.3' 2018-12-23 17:57:23 +00:00
Christoph M. Becker 9a095416b7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77298: segfault occurs when add property to unserialized empty ArrayObject
2018-12-21 17:47:02 +01:00
Dmitry Stogov 6ccdb904ae Fixed ws 2018-12-21 19:03:28 +03:00
Dmitry Stogov 7155239669 Merge branch 'PHP-7.3'
* PHP-7.3:
  Removed /e modifirer and fixed ws.
2018-12-21 19:01:36 +03:00
Dmitry Stogov d6f4652255 Added specialized code for small arrays 2018-12-20 17:55:01 +03:00
Dmitry Stogov dddf3c501e Added specialized code for small arrays 2018-12-19 17:40:34 +03:00
Dmitry Stogov 493f830355 Reuse add_property_zval_ex() instead of code duplication 2018-12-19 17:24:56 +03:00
Dmitry Stogov d356f6d72b Removed add_get_assoc_*() and add_get_index_*() API functions 2018-12-19 16:47:48 +03:00
Dmitry Stogov 85e1df6fdc Replace add_index_zval() and add_next_index_zval() functions by macros 2018-12-19 16:43:38 +03:00
Dmitry Stogov 9acfe1f8f0 Fixed compilation warnings 2018-12-19 16:15:49 +03:00
Dmitry Stogov cec091176c Replace zend_hash_apply... with ZEND_HASH_FOREACH... 2018-12-19 02:49:56 +03:00
Christoph M. Becker f67f42122a Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Add missing entry for bug 77020
2018-12-18 23:23:40 +01:00
Dmitry Stogov ae9e956ef9 Reorder conditions 2018-12-18 23:23:44 +03:00
Remi Collet e5fcea0bcd Merge branch 'PHP-7.3'
* PHP-7.3:
  missing entry for #77020
2018-12-18 16:30:09 +01:00
Dmitry Stogov 868c1b7377 Reduce executor size 2018-12-18 17:34:18 +03:00
Remi Collet 6ff95809b0 Merge branch 'PHP-7.3'
* PHP-7.3:
  bump to 7.2.15-dev
2018-12-18 13:12:25 +01:00
Christoph M. Becker f0b79bf798 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Fix release date
2018-12-18 13:10:35 +01:00
Christoph M. Becker 1df1acb871 Merge branch 'PHP-7.3'
* PHP-7.3:
  Prepare main branch for 7.3.2
2018-12-18 12:16:40 +01:00
Dmitry Stogov 5341d17c34 Fixed expectation 2018-12-17 15:59:16 +03:00
Nikita Popov da1e6679b7 CFG construction: Avoid code duplication
These code for those two cases is the same nowadays, so merge them.
2018-12-17 11:29:23 +01:00
Christoph M. Becker cde2e35bf0 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77297: SodiumException segfaults on PHP 7.3
2018-12-16 16:37:15 +01:00
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
BohwaZ 82af24f2b2 Implement SQLite3Stmt::getSQL method, returning the original statement SQL, eventually expanded 2018-12-15 17:27:33 +01:00
Christoph M. Becker 3b0f051193 Allow empty $escape to eschew escaping CSV
Albeit CSV is still a widespread data exchange format, it has never been
officially standardized.  There exists, however, the “informational” RFC
4180[1] which has no notion of escape characters, but rather defines
`escaped` as strings enclosed in double-quotes where contained
double-quotes have to be doubled.  While this concept is supported by
PHP's implementation (`$enclosure`), the `$escape` sometimes interferes,
so that `fgetcsv()` is unable to correctly parse externally generated
CSV, and `fputcsv()` is sometimes generating non-compliant CSV.  Since
PHP's `$escape` concept is availble for many years, we cannot drop it
for BC reasons (even though many consider it as bug).  Instead we allow
to pass an empty string as `$escape` parameter to the respective
functions, which results in ignoring/omitting any escaping, and as such
is more inline with RFC 4180.  It is noteworthy that this is almost no
userland BC break, since formerly most functions did not accept an empty
string, and failed in this case.  The only exception was `str_getcsv()`
which did accept an empty string, and used a backslash as escape
character then (which appears to be unintended behavior, anyway).

The changed functions are `fputcsv()`, `fgetcsv()` and `str_getcsv()`,
and also the `::setCsvControl()`, `::getCsvControl()`, `::fputcsv()`,
and `::fgetcsv()` methods of `SplFileObject`.

The implementation also changes the type of the escape parameter of the
PHP_APIs `php_fgetcsv()` and `php_fputcsv()` from `char` to `int`, where
`PHP_CSV_NO_ESCAPE` means to ignore/omit escaping.  The parameter
accepts the same values as `isalpha()` and friends, i.e. “the value of
which shall be representable as an `unsigned char` or shall equal the
value of the macro `EOF`.  If the argument has any other value, the
behavior is undefined.”  This is a subtle BC break, since the character
`chr(128)` has the value `-1` if `char` is signed, and so likely would
be confused with `EOF` when converted to `int`.  We consider this BC
break to be acceptable, since it's rather unlikely that anybody uses
`chr(128)` as escape character, and it easily can be fixed by casting
all `escape` arguments to `unsigned char`.

This patch implements the feature requests 38301[2] and 51496[3].

[1] <https://tools.ietf.org/html/rfc4180>
[2] <https://bugs.php.net/bug.php?id=38301>
[3] <https://bugs.php.net/bug.php?id=51496>
2018-12-15 14:38:15 +01:00
Dmitry Stogov d206630f13 Fixed memory leaks 2018-12-13 16:21:08 +03:00
Dmitry Stogov db30e0ce16 Improve unserialize() 2018-12-13 12:55:29 +03:00
Dmitry Stogov 71f430cf06 Improve unserialize() 2018-12-12 20:04:36 +03:00
Christoph M. Becker 8c781c1c20 Resolve imagecropauto() default $mode quirk
The `$mode` parameter of `imagecropauto()` defaults to `-1`.  However,
`-1` is changed to `GD_CROP_DEFAULT` right away, so basically the
default is `GD_CROP_DEFAULT`, which is rather confusing and
unnecessary.

Therefore, we change the default to `IMG_CROP_DEFAULT`, but still allow
an explicit `-1` to be passed for BC reasons, in which case we trigger
a deprecation notice, so we can rid the `-1` support eventually.
2018-12-12 17:25:37 +01:00
Craig Andrews 40c4d7f182 Implement FR #72510: systemd service should be hardened 2018-12-12 17:12:02 +01:00
Dmitry Stogov 4d0a2f68a9 Provide is_zend_ptr() function to check if a pointer lays in Zend MM heap. 2018-12-12 13:02:28 +03:00
Dmitry Stogov 05f3706588 Split php_array_merge_or_replace_wrapper() into php_array_merge_wrapper() and php_array_replace_wrapper().
Avoid array duplication when merging with an empty array.
2018-12-11 15:59:44 +03:00
Xinchen Hui b3804831ad Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS
2018-12-11 15:25:29 +08:00
Xinchen Hui 3ecaba68e4 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix __zend_cpuid on i386 PIC without __cpuid_count
2018-12-11 15:23:25 +08:00
Anatol Belski 282581ee8c Merge branch 'PHP-7.3'
* PHP-7.3:
  Remove BOM
2018-12-11 00:39:55 +01:00
Christoph M. Becker ad06f1aa2e Merge branch 'PHP-7.3'
* PHP-7.3:
  Update/fix UPGRADING
2018-12-10 14:33:04 +01:00
Nikita Popov 6debea2fd8 Merge branch 'PHP-7.3' 2018-12-10 13:36:54 +01:00
Christopher Jones be318f1720 Merge branch 'PHP-7.3' 2018-12-10 21:54:35 +11:00
Peter Kokot 7e445ef3b1 Set AC_CONFIG_AUX_DIR to build directory
The Autoconf macro AC_CONFIG_AUX_DIR can set the location of the
auxiliary build tools such as config.guess, config.sub, and bundled
libtool scripts and moves these bundled files from the root directory
to the build subdirectory.

Additionally some changes in this context or as a part of obsoletion:
- The LT_TARGETS variable in build/build2.mk file was once used as a part
  of the Automake step. It's not used anymore and has been refactored to
  separate makedist script directly.
- ltconfig is not used anymore since libtool 1.4+
  cf8d1563c2
- phpize file locations for the config.guess, config.sub, and ltmain.sh
  has been refactored accordingly.
2018-12-10 08:11:44 +01:00
Christopher Jones a680f4f2be Link to the fast_zpp RFC 2018-12-10 12:53:12 +11:00
Christopher Jones 46a4bc140d Merge branch 'master' of https://git.php.net/repository/php-src 2018-12-10 11:00:38 +11:00
Christopher Jones 211b64f950 Merge branch 'PHP-7.3' 2018-12-10 10:58:44 +11:00
Christoph M. Becker 222b7e78e3 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix version numbers in main branch
2018-12-10 00:21:59 +01:00
Christopher Jones c18d2a801a Merge branch 'PHP-7.3'
* PHP-7.3:
  Improve test portability
  Update for newer Oracle versions
2018-12-10 10:16:53 +11:00
Anatol Belski 2598dd5ca2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix syntax error
2018-12-09 19:15:57 +01:00
Anatol Belski 94200f1a2d Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix libtidy exports when ext/tidy compiled static
2018-12-09 19:02:18 +01:00
Eli Schwartz 78e4f04752 ext/curl: port to pkg-config macro and consistently require its use
curl 7.15.1 in December 2006 first added pkg-config support, which is
earlier than the minimum supported version for php. This should
therefore be uiversally supported.
2018-12-09 17:28:02 +01:00
Derick Rethans c74b9990ca Merge branch 'PHP-7.3' 2018-12-09 16:25:37 +00:00
Eli Schwartz bdd4eb2d9e ext/pdo_pgsql: drop unneeded code
This check was added in 0db373883f and
greps for a private implementation detail of the postgres headers,
removed in https://github.com/postgres/postgres/commit/3c4768d0d17d4569f2417aa5741e0317404b6c45

It hasn't worked as intended for 12 years, and can safely be assumed to
not be needed.
2018-12-09 17:15:58 +01:00
Nikita Popov 30024071d2 Fix unused variable warning in curl 2018-12-09 17:05:02 +01:00
Hugh McMaster 20fa2e7b58 ext/intl: Use pkg-config to detect icu
The developers of icu recommend using pkg-config to detect icu,
because icu-config is deprecated.
2018-12-09 16:59:24 +01:00
Christopher Jones 02513f1075 Merge branch 'PHP-7.3' 2018-12-09 20:56:48 +11:00
Christopher Jones b2a1c14dcd Merge branch 'PHP-7.3' 2018-12-09 12:39:02 +11:00
Christopher Jones 36efc39db1 Merge branch 'PHP-7.3' 2018-12-09 12:17:23 +11:00
Christopher Jones ecd533d1de Merge branch 'PHP-7.3' 2018-12-09 11:30:47 +11:00
Pierrick Charron c43ad5fd30 Merge branch 'PHP-7.3' 2018-12-08 15:20:24 -05:00
Remi Collet f2ac27e73c Merge branch 'PHP-7.3'
* PHP-7.3:
  add imap.enable_insecure_rsh in php.ini
2018-12-08 10:25:35 +01:00
Christopher Jones 5c8587e583 Merge branch 'master' of https://git.php.net/repository/php-src 2018-12-08 20:20:09 +11:00
Christopher Jones 5f80fa0bc7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Note that PECL install now works on PHP 7.3
  Don't skip with 18c DB
2018-12-08 20:14:35 +11:00
Remi Collet 9e787ec6c0 Merge branch 'PHP-7.3'
* PHP-7.3:
  missing entry for #77020
  missing entry for #77020
2018-12-08 10:07:33 +01:00
Christopher Jones c999be3fb5 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix resource warning value
  Bump OCI8 version
2018-12-08 19:25:41 +11:00
Christopher Jones 56912eb85d Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS
  Update NEWS
2018-12-08 19:17:25 +11:00
Christopher Jones 4a8d5ae239 Merge branch 'PHP-7.3'
* PHP-7.3:
  When releasing an oci8 connection always set the resource to null.
2018-12-08 18:51:38 +11:00
Dmitry Stogov f12e6a076f Reorder conditions 2018-12-07 19:21:26 +03:00
Dmitry Stogov 99658f682e Improve zend_check_live_ranges() 2018-12-07 18:15:14 +03:00
Dmitry Stogov be4c67a40a Stop passing CG(active_op_array) between internal compiler functions. 2018-12-07 17:47:56 +03:00
BohwaZ abd9f08752 SQLite3: Separating parameters binding in a function 2018-12-07 15:17:20 +01:00
Christoph M. Becker 8f46f6dd6f ZEND_VERSION should be in sync with PHP_VERSION and friends
While the major version is different, and the minor version may be
different, the revision and the extra should always be synced, as
recently discussed on the release manager's list.  We add the
respective info to README.RELEASE_PROCESS, to not forget about it in
the future.
2018-12-07 15:11:48 +01:00
Christoph M. Becker c4e9f6fc33 Note additional RM tasks 2018-12-07 15:11:47 +01:00
Christoph M. Becker 1a2577093b Add note that release manager karma is required
Cf. <http://svn.php.net/viewvc?view=revision&revision=346164>.
2018-12-07 15:11:46 +01:00
Christoph M. Becker ec027d5f3a Remove outdated note regarding Windows
As of PHP 5.3, there are no more Windows specific version keys.
2018-12-07 15:11:45 +01:00
Christoph M. Becker 257696a0c2 MD5 checksums are history
According to a respective RFC[1], the MD5 checksums have been removed
from the release notes and the API.  Also, no checksums are generated
after uploading the tarballs to the user directories
on downloads.php.net.

[1] <https://wiki.php.net/rfc/release-md5-deprecation>
2018-12-07 15:11:44 +01:00
Christopher Jones b6bb9696b9 Merge branch 'PHP-7.3' 2018-12-07 23:22:49 +11:00
Christopher Jones c4d08c87eb Merge branch 'PHP-7.3' 2018-12-07 23:20:58 +11:00
Christopher Jones 153cf5bc50 Merge branch 'PHP-7.3' 2018-12-07 21:41:57 +11:00
Christoph M. Becker 8b275b5249 Stable releases also should be on frontpage 2018-12-06 18:20:13 +01:00
Christoph M. Becker 61c82e5b7f Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Fix NEWS wrt. ChangeLog conversion
2018-12-06 17:21:50 +01:00
Christoph M. Becker 36f0d00c3f scripts/dev/gen_verify_stub can also be used for stable releases 2018-12-06 00:43:17 +01:00
Christoph M. Becker 70162ef7c9 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Fix typo
2018-12-06 00:24:51 +01:00
Ferenc Kovacs 8e7efa764b Merge branch 'PHP-7.3' 2018-12-05 09:53:01 +01:00
Christoph M. Becker 4dd7177224 Merge branch 'PHP-7.3'
* PHP-7.3:
  Add LDAP information in UPGRADING
2018-12-04 23:43:32 +01:00
Nikita Popov 7674a542aa Remove commented zend_ini_displayer_cb 2018-12-04 19:02:13 +01:00
Nikita Popov 3b70dc078f Fix unused variable warnings 2018-12-04 19:01:36 +01:00
Nikita Popov 2a32c1cafd Remove unused import_used_extension utility value 2018-12-04 19:01:01 +01:00
Anatol Belski f482fd4798 Merge branch 'PHP-7.3'
* PHP-7.3:
  Sync NEWS [ci skip]
2018-12-04 12:50:57 +01:00
Jakub Zelenka 41e2fa5870 Merge branch 'PHP-7.3' 2018-12-03 18:32:12 +00:00
Stanislav Malyshev 7bd513a492 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix null pointer deref in qprint-encode filter (bug #77231)
2018-12-03 10:20:17 -08:00
Dmitry Stogov 4f26b3b51b Mark preloaded op_arrays 2018-12-03 16:57:27 +03:00
Christoph M. Becker 511643fb87 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Prepare NEWS for 7.3 GA
2018-12-03 13:56:48 +01:00
Stanislav Malyshev c3ca95dad2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix bug #77143 - add more checks to buffer reads
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
2018-12-03 00:43:00 -08:00
Gabriel Caruso 51004a9c5e Remove old generated files
These files were remove in f0251a8, as well 22c2493
2018-12-02 22:45:34 -02:00
Gabriel Caruso 2970989ed9 Add forked and maintained extension in php-src from GCOV
The libbcmath, libmagic libmbfl and libxmlrpc are maintained in php-src,
so we should ensure these with tests.
2018-12-02 22:36:52 -02:00
Peter Kokot ea01d7837c Replace LT_AC_PROG_SED with AC_PROG_SED
The LT_AC_PROG_SED libtool's macro has been integrated in the Autoconf
since Autoconf 2.59b [1] and is recommended to be replaced with it [2].

[1] https://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] http://git.savannah.gnu.org/cgit/libtool.git/tree/m4/libtool.m4
2018-12-02 16:26:17 -08:00
Gabriel Caruso cdd8368d6f Clean up unnecessary ternary expressions and simplify some returns
- Simplify conditions
- Use ZEND_HASH_APPLY_* instead of hard-coded booleans
- Use ZEND_NORMALIZE_BOOL
- Drop sign in favor of ZEND_NORMALIZE_BOOL
2018-12-03 01:22:14 +01:00
Stanislav Malyshev 6c16f9b69c Merge remote-tracking branch 'github/pr/3375'
* github/pr/3375:
  Don't need interactive progress on git clones in Travis
2018-12-02 16:05:38 -08:00
Stanislav Malyshev 3faac769fa Merge branch 'PHP-7.2'
* PHP-7.2:
  Don't need interactive progress on git clones in Travis
2018-12-02 16:05:14 -08:00
Stanislav Malyshev 05776094f7 Merge remote-tracking branch 'github/pr/3345'
* github/pr/3345:
  Update Coding style
2018-12-02 16:00:44 -08:00
Stanislav Malyshev 377562fc6f Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix TSRM signature - php_stream_stat macro has it's own TSRM
  Regenerate certificates for openssl tests
  Improve test for bug77022
2018-12-02 15:12:21 -08:00
Jakub Zelenka 8acc70316d Merge branch 'PHP-7.3' 2018-12-02 19:39:25 +00:00
Peter Kokot bde96f293a Remove support for Rhapsody code name
The Rhapsody code name was once used for computers with operating system
by Apple and was mostly replaced with a newer code name Darwin:
- https://en.wikipedia.org/wiki/Rhapsody_(operating_system)
- https://en.wikipedia.org/wiki/Darwin_(operating_system)

This patch removes obsolete checks from the *nix build script files.
2018-12-02 11:41:57 +01:00
Stanislav Malyshev 494d5d2429 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix bug #77022 - use file mode or umask for new files
2018-12-01 21:49:53 -08:00
Stanislav Malyshev b1446521d7 Fix bug #77022 - use file mode or umask for new files 2018-12-01 21:48:49 -08:00
Christoph M. Becker f0f4ab4b02 [ci skip] Fix names of the constants
`GD_CROP_DEFAULT` and `GD_CROP_SIDES` are names of libgd constants, and
as such they are not relevant for userland developers.  Therefore, we
replace them by the constant names of our wrapper, i.e.
`IMG_CROP_DEFAULT` and `IMG_CROP_SIDES`, respectively.
2018-12-01 23:54:17 +01:00
Peter Kokot 72087c8921 Replace AC_CHECK_FILE with test -f
The AC_CHECK_FILE macro is designed to emit a warning about possible
cross compiling issues if file is not present on the target system.
Since the generated PHP lexer file is part of the build files and not
target system this can be simplified by a usual shell check with
`test -f` instead as in other usages.
2018-12-01 21:40:51 +01:00
Christoph M. Becker dcad13e8c9 Fix #73291: imagecropauto() $threshold differs from external libgd
Since upstream does not appear to move in any way[1], we sync our
behavior.  Even though the BC break is ugly (which is the reason we
target master only), having to deal with different algorithms is even
worse for portable userland code.

[1] <https://github.com/libgd/libgd/issues/334>
2018-12-01 18:49:30 +01:00
Anatol Belski 8aa716734e Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS [ci skip]
2018-12-01 17:11:31 +01:00
Christoph M. Becker 947ca9f43d Sync behavior of gdImageAutoCrop() with upstream
Since cropping support has been added to our bundled libgd,
`gdImageAutoCrop` differs from upstream in that `GD_CROP_DEFAULT` falls
back on `GD_CROP_SIDES` if there is no transparent color in the image.
While this difference seem to be a useful improvement in our bundled
libgd, upstream has not yet signaled that there willing to back-port
it[1], so we revert it to stay in sync with upstream.

We also remove the additional NULL bailout at the end of the function,
which doesn't appear to be relevant any longer since bug 77198 has been
fixed.

[1] <https://github.com/libgd/libgd/issues/298>
2018-12-01 15:34:10 +01:00
Anatol Belski 31f28961a7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77193 Infinite loop in preg_replace_callback
2018-12-01 10:28:56 +01:00
Christoph M. Becker 12410df5fb Fix illogical strncpy size
While both source and destination buffers have the same size (6 bytes),
and this is unlikely to change in the future, we nonetheless fix the
illogical `strncpy` size.

Based on a pull request provided by Cristian Rodríguez.
2018-12-01 00:13:58 +01:00
Steve Walk ea1ea33bd5 [ci skip] remove test per discussion on github 2018-11-29 23:20:49 +01:00
Steve Walk 4e63df88d5 fix bad assumption of strncmp return value 2018-11-29 23:19:16 +01:00
Christoph M. Becker a757ebb5b5 Require SQLite ≥ 3.7.4 for ext/sqlite3
`SQLite3::readOnly()` uses `sqlite3_stmt_readonly()` which is only
available as of libsqlite 3.7.4.  For older SQLite3 versions we return
always `false`, which can be confusing.  Instead of sticking with this
behavior, or even undefining the method for old SQLite3 versions, we
lift the requirements to SQLite 3.7.4 (released on 2010-12-08),
according to a respective discussion[1].

Since pdo_sqlite doesn't use `sqlite3_stmt_readonly()`, we stick with
the minimum requirement of SQLite 3.5.0.

[1] <https://github.com/php/php-src/pull/3614>
2018-11-29 15:10:39 +01:00
Christoph M. Becker 1674db8c40 [ci skip] Add myself as sqlite3 maintainer, officially 2018-11-29 13:49:55 +01:00
Christoph M. Becker 525d3ae858 Handle potential sqlite3_bind_*() call failures
Since bug 77051 has been fixed, it is unlikely that any of the
 `sqlite3_bind_*` calls will ever fail, but we add respective checks
nonetheless, and call `php_sqlite3_error()` in case of bind failures.
2018-11-29 13:19:26 +01:00
Christoph M. Becker 0d3799dedc Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77051: Issue with re-binding on SQLite3
2018-11-29 02:20:20 +01:00
Christoph M. Becker 035de21d77 Deny (un)serialization of SQLite3, SQLite3Stmt and SQLite3Result
Serializing `SQLite3`, `SQLite3Stmt` and `SQLite3Result` instances is
possible but pointless, since unserializing results in uninitialized
instances, which will bail out of any method call.  Therefore, we deny
serialization and unserialization in the first place.
2018-11-29 01:08:03 +01:00
Stanislav Malyshev 7f34c9ea7d Merge branch 'PHP-7.3'
* PHP-7.3:
  Add DISPLAY_INI_ENTRIES for imap
  Disable rsh/ssh functionality in imap by default (bug #77153)
  Disable rsh/ssh functionality in imap by default (bug #77153)
2018-11-28 15:47:14 -08:00
Derick Rethans 6863afe055 Merge branch 'PHP-7.3' 2018-11-28 20:35:35 +00:00
Nikita Popov 745e250a21 Merge branch 'PHP-7.3' 2018-11-28 20:10:32 +01:00
Christoph M. Becker 80e387cf6c [ci skip] Add missing extension maintainership years 2018-11-28 00:18:16 +01:00
David Carlier 5d4938956a Support huge pages on FreeBSD
FreeBSD provides MAP_ALIGNED_SUPER for a similar purpose as
MAP_HUGETLB on Linux, so add it as an alias.

Huge pages still have to be explicitly enabled through the
USE_ZEND_ALLOC_HUGE_PAGES environment variable.
2018-11-27 19:48:24 +01:00
Nikita Popov 9adc8d546c Merge branch 'PHP-7.3' 2018-11-27 19:44:52 +01:00
Nikita Popov 6faa625cb8 Merge branch 'PHP-7.3' 2018-11-27 16:39:35 +01:00
Dmitry Stogov 5f2817ad61 Avoid early reference check 2018-11-27 15:27:40 +03:00
Dmitry Stogov 23d3deb8be Added ZEND_COMPILE_WITHOUT_EXECUTION and ZEND_COMPILE_PRELOAD to determine when PHP compiler is invoked by opcache_compile_file() or preloading. 2018-11-27 11:52:53 +03:00
Nikita Popov fbf2914e1f Merge branch 'PHP-7.3' 2018-11-26 22:49:29 +01:00
Adam Baratz 2c3b1767e2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Check column number before trying to fetch the value
2018-11-26 10:37:42 -05:00
Christoph M. Becker 7cad44be11 Merge branch 'PHP-7.3'
* PHP-7.3:
  Use zend_empty_array
2018-11-26 15:35:30 +01:00
Nikita Popov 55bd88ce0d Remove redundant __clone() methods from Reflection
Reflection classes already use NULLed clone_obj to signal that they
cannot be cloned, so it's not necessary to additionally declare a
throwing __clone() method.
2018-11-26 14:00:42 +01:00
Nikita Popov e7131a4e9f Remove redundant Exception::__clone() method
Exceptions already prohibit cloning by setting clone_obj to NULL
(which is integrated with reflection). No need to additionally
define a dummy __clone() method.
2018-11-26 13:57:17 +01:00
Nikita Popov 28edeb2ba3 User serialize_deny for PDOStatement as well 2018-11-26 13:30:57 +01:00
Nikita Popov 6e4b202694 Switch PDO to use serialize_deny
And remove dummy __sleep/__wakeup. This switches the thrown
exception type from PDOException to Exception.
2018-11-26 13:28:14 +01:00
Nikita Popov a624c2bd13 Use serialize_deny for CURLFile
Instead of a throwing __wakeup() method.
2018-11-26 13:20:51 +01:00
Nikita Popov 43417953f4 Remove redundant Generator::__wakeup() method
Generators already make use of (un)serialize_deny, so there's no
need to additionally have a throwing __wakeup() implementation.
2018-11-26 13:13:26 +01:00
Peter Kokot 67b9108478 Add re2c checking with error exit code
To make installation experience better instead of only outputting
warning when re2c is not present this patch also exits if the PHP lexer
file(s) were not generated yet and re2c is not present on the system.
2018-11-25 21:01:21 +01:00
Christoph M. Becker 9a5669bc7b Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77200: imagecropauto(…, GD_CROP_SIDES) crops left but not right
2018-11-25 19:04:03 +01:00
Christoph M. Becker 65b34bfa1e Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77198: auto cropping has insufficient precision
2018-11-25 15:57:25 +01:00
Frank Denis 333f985163 Merge branch 'PHP-7.3'
* PHP-7.3:
  ext/sodium: remove redundant code
  ext/sodium: Correct base64 decoding with unpadded variants
2018-11-24 17:57:23 +01:00
Christoph M. Becker c005c67ee7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix test case
2018-11-24 13:41:40 +01:00
Christoph M. Becker 2e4b6624cb Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77195: Incorrect error handling of imagecreatefromjpeg()
2018-11-24 12:58:57 +01:00
Peter Kokot 0c82597ae3 [ci skip] PHP 7.1 is now security-only branch
Refs:
- http://news.php.net/php.internals/103486
2018-11-23 21:20:13 +01:00
Christoph M. Becker 9eac14c794 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Preliminary fix for NEWS
2018-11-23 18:42:53 +01:00
Christoph M. Becker a4093d0531 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77177: Serializing or unserializing COM objects crashes
2018-11-23 16:36:48 +01:00
Christoph M. Becker 1acac320c5 Clean up server-tests.php remains
sapi/tests/ has been introduced as a generic means to test different
SAPIs[1].  run-tests2.php has later be renamed to server-tests.php and
recently been dropped[2].  However, the sapi/tests/test00?.php test
cases remained, even though they make no sense for run-tests.php,
since they use an unsupported format for the `--ENV--` section and the
completely unsupported `--HEADERS--` section, respectively.  While
these tests ran successfully under run-tests.php, that was only by
accident, and they did not really test something useful.  Therefore, we
remove these tests altogether.

sapi/tests/bug69487.phpt is actually a CGI test (CGI is enforced due to
the `--POST--` section), so we move it to sapi/cgi/tests, which leaves
sapi/tests/ empty.  Thus, we also remove the sapi/ directory from
run-tests.php.

Finally, we remove the `--HEADERS--` and `--REQUEST--` sections from
the list of allowed run-tests.php sections.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=b671380b6b5b6e1f4f235e810afa4199e989d2ba>
[2] <http://git.php.net/?p=php-src.git;a=commit;h=4f36acb9e65935aa657f1f22e2320a401bdbdad3>
2018-11-23 16:24:51 +01:00
Nikita Popov 62dc39edda Document --show-mem as a valid run-tests.php option
[ci skip]
2018-11-23 16:15:40 +01:00
Dmitry Stogov 48b9594227 Don't preload functions and classes declared outside of preloaded scripts (e.g. by eval code). 2018-11-23 03:59:47 +03:00
Dmitry Stogov b076a91c50 Refactored script creation and classes/functions copying. 2018-11-23 03:19:16 +03:00
Nikita Popov c6009dae34 Remove unused do_free parameter from ADD_INTERNED_STRING 2018-11-22 16:23:03 +01:00
Sara Golemon 5a5f361755 Merge branch 'PHP-7.3'
* PHP-7.3:
  Prep for 7.1.26
2018-11-21 14:39:49 -05:00
Nikita Popov 4f06e67ad2 Re-commit MySQL 8 cached SHA auth support
With changes to (hopefully) correctly fall back if OpenSSL support
is missing. Furthermore the hard-coded dependency on ext/hash is
no longer an issue, as this extension is required in master.

This reverts commit 63072e9c0e, reversing
changes made to 4cbabb6852.
2018-11-21 20:16:44 +01:00
Gabriel Caruso 35be0590ed Remove unecessaries SKIPIF sections for necessary extensions 2018-11-21 08:08:09 -02:00
Xinchen Hui 1f74300138 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77088 (Segfault when using SoapClient with null options)
  Fixed proto & folder mark
2018-11-21 11:30:42 +08:00
Sara Golemon 534df87c9e Implement password mechanism registry
RFC: https://wiki.php.net/rfc/password_registry
2018-11-20 17:26:55 -05:00
Nikita Popov f4faa69b57 Merge branch 'PHP-7.3' 2018-11-20 21:30:58 +01:00
Rijnard van Tonder 8881c3c82f Remove redundant continue in for loops 2018-11-20 21:23:24 +01:00
Nikita Popov ef8fbd6fc9 Merge branch 'PHP-7.3' 2018-11-20 21:16:36 +01:00
Mizunashi Mana 10ae8b685f Fix opcache blacklist test on macOS 2018-11-20 21:11:56 +01:00
Sara Golemon 82e0fb6651 Merge branch 'PHP-7.3'
* PHP-7.3:
  Bump for 7.2.14
2018-11-20 14:41:40 -05:00
Stanislav Malyshev b901d31b77 Merge branch 'PHP-7.3'
* PHP-7.3:
  Disable rsh/ssh functionality in imap by default (bug #77153)
  Disable rsh/ssh functionality in imap by default (bug #77153)
2018-11-20 11:21:35 -08:00
Stanislav Malyshev d4797f836e Disable rsh/ssh functionality in imap by default (bug #77153) 2018-11-20 11:21:29 -08:00
Dmitry Stogov 05875bcfc6 Improved error messages 2018-11-20 17:50:22 +03:00
Christoph M. Becker 800edccee2 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS wrt. php-7.3.0RC6 tagging
2018-11-20 13:36:41 +01:00
Remi Collet ad6060601a Merge branch 'PHP-7.3'
* PHP-7.3:
  NEWS
  NEWS
  NEWS
  Fix #77151 ftp_close(): SSL_read on shutdown
2018-11-20 11:20:57 +01:00
Dmitry Stogov 1f3a535324 Delay exceptional case check 2018-11-20 13:06:23 +03:00
Dmitry Stogov 93f7cbf29b fixed typo 2018-11-20 12:53:05 +03:00
Dmitry Stogov a5a3d507d2 Optimization 2018-11-20 11:55:16 +03:00
Fabien Villepinte 2b9ceffb41 Fix typo in tests 2018-11-19 22:17:58 +01:00
Anatol Belski e00add198c Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-11-18 14:41:44 +01:00
Anatol Belski b6367ebae3 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77047 pg_convert has a broken regex for the 'TIME WITHOUT TIMEZONE' data type
2018-11-18 12:34:04 +01:00
Anatol Belski 8b05bbdd0a Merge branch 'PHP-7.3'
* PHP-7.3:
  Add test for bug #77047
  FIX #77047: fixes regex for "time" data type
2018-11-18 11:52:33 +01:00
Anatol Belski 819f857894 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-11-17 23:03:14 +01:00
Anatol Belski 3c4cf40064 Merge branch 'PHP-7.3'
* PHP-7.3:
  Simplify assignment on 64-bit
2018-11-17 22:57:16 +01:00
Anatol Belski b0cf54c5b8 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77111 php-win.exe corrupts unicode symbols from cli parameters
2018-11-16 23:23:00 +01: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 2766a8e66b Fix leaks
For some reason I'm no longer getting memory leak errors for my
local build :/
2018-11-15 21:34:46 +01:00
Nikita Popov 022eea8be1 Check for zero SplPriorityQueue extract flags earlier
Generate an exception during the SplPriorityQueue::setExtracFlags()
call instead of generating E_RECOVERABLE_FATAL all over the place
later.
2018-11-15 21:05:05 +01:00
Nikita Popov e965fee904 Optimize SplPriorityQueue implementation
Do not create an array with two keys for every element. That's a
huge waste of memory. Instead we allocate a two-element structure.
This reduces memory usage and avoids having to perform hashtable
lookups to get at the data and priority.

The only thing this might impact negatively is the non-default
EXTR_BOTH mode, in which case the array has to be created anyway.
2018-11-15 20:52:01 +01:00
Dmitry Stogov 0f7f1498be Use ZEND_THIS macro to hide implementation details in extensions code. 2018-11-15 19:54:19 +03:00
Nikita Popov 8f2f80668e Merge branch 'PHP-7.3' 2018-11-15 17:17:06 +01:00
Dmitry Stogov 71d6899e53 micro-optimization 2018-11-15 18:47:23 +03:00
Gabriel Caruso 5ae1524dc3 Remove unused variables 2018-11-15 12:32:00 -02:00
Gabriel Caruso 74f26ba816 Remove missing SKIPIF sections for mbstring tests 2018-11-15 12:21:55 -02:00
Dmitry Stogov 9ab3b42888 Split zend_objects_store_put() into hot/cold parts 2018-11-15 16:31:22 +03:00
Peter Kokot 35a9ec1b0d [ci skip] Update UPGRADING 2018-11-15 10:46:48 +01:00
Anatol Belski 164edffb99 Merge branch 'PHP-7.3'
* PHP-7.3:
  Rework magic data once more
2018-11-14 22:35:47 +01:00
Dmitry Stogov d5955d9587 typo 2018-11-15 00:10:17 +03:00
Peter Kokot 698f8bec93 [ci skip] Update NEWS 2018-11-14 21:45:24 +01:00
Ben Scholzen (DASPRiD) ee939b70d3 Add openssl_x509_verify() function
This patch introduces a wrapper around OpenSSL's X509_verify() function.
2018-11-14 21:40:34 +01:00
Christoph M. Becker 22889c94d1 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77147: Fix for 60494 ignores ICONV_MIME_DECODE_CONTINUE_ON_ERROR
2018-11-14 14:59:56 +01:00
Dmitry Stogov f6d227ed4f Implemented preloading RFC: https://wiki.php.net/rfc/preload.
Squashed commit of the following:

commit 106c815fffb8eb3efe00a27a5229cb1f8ffc9736
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Nov 14 16:36:44 2018 +0300

    Added NEWS entry

commit 1dacd5e20b7043368ef9e80db296d1781134b6fd
Merge: d516139abf ba99aa133c
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Nov 14 16:33:37 2018 +0300

    Merge branch 'master' into preload

    * master:
      Fixed issues related to optimization and persitence of classes linked with interfaces, traits or internal classes.
      Added possiblity to avoid signal handlers reinitialization on each request.

commit d516139abf5ffbd495ee6037f1dc04a1cfe588a7
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Nov 14 16:13:15 2018 +0300

    Override opcache.preload for testing

commit 162b154d0bbfbaf8ef93975f7e56a1353236903d
Merge: 45fdd034ce 8bda22592e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Nov 14 15:38:09 2018 +0300

    Merge branch 'master' into preload

    * master: (34 commits)
      Eliminate useless $this related check
      Eliminate useless $this related checks
      Replace zend_parse_method_parameters() by zend_parse_parameters() and avoid useless checks.
      Replace getThis() by EX(This), when additional check is not necessary.
      Fixed tests
      Validate length on socket_write
      Fix compilation on x32
      Fix #77141: Signedness issue in SOAP when precision=-1
      Support SQLite3 @name notation
      Remove lexer files generated by RE2C
      Update libmagic.patch [ci skip]
      Update libmagic.patch [ci skip]
      Fork test with pcre.jit=0
      Rework magic data
      Fix regex
      Fix regex
      Rework magic data
      Sync one more upstream libmagic piece
      Suppress already used warning
      Ignore getaddrinfo failed message
      ...

commit 45fdd034ceceb68e8fb23bd6e70d627f17dfd411
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 9 13:07:03 2018 +0300

    Properly resolve magic method of preloaded classes inherited from internal ones.

commit 34645aeb4272b71a81a7e0d91f27eded557b78be
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Nov 8 15:29:17 2018 +0300

    Don't preload constants defined during preload script excution.

commit cef0d67c3e5aac89b3d606fbd8d445225c07c83f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Nov 7 15:56:54 2018 +0300

    Support for class aliasses

commit 08ffc9a552c7cf4fbff1a4b3d2de4e7c33f4120d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Nov 7 15:34:39 2018 +0300

    Resolve constants only in linked classes

commit 8d3429cda83c87646eef0006d5cda075f2400b24
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Nov 6 11:56:39 2018 +0300

    Fixed preloading of references to internal classes.

commit 7ae3a47d20e83f7d804506c6d50f6a392199260b
Merge: 9b0a53ed1c 049f239cfc
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Nov 6 11:37:15 2018 +0300

    Merge branch 'master' into preload

    * master:
      Update NEWS [ci skip]
      Update NEWS [ci skip]
      Update libmagic.patch [ci skip]
      Update libmagic.patch [ci skip]
      Declare function proto in header
      Declare function proto in header
      Fix #76825: Undefined symbols ___cpuid_count
      NEWS
      Fix: #77110 undefined symbol zend_string_equal_val in C++ build
      Fix #77105: Use position:sticky for <th> in `phpinfo()`
      Implement handling for JIT recognition when cross compiling
      Backport 7f5f4601 for 7.2
      Fix #76348: WSDL_CACHE_MEMORY causes Segmentation fault
      Rework places in libmagic regarding previous CVE-2014-3538 fixes
      Change the way JIT availability is checked
      Fix a test for ldap extension
      Fixed bug #77092
      Future-proof email addresses

commit 9b0a53ed1cd5995efae0d71e1941d1db4ef6ba39
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 2 14:54:44 2018 +0300

    We don't need preload_restart() here

commit 0bd17bd43890423e1e98a5925f11cea93da3df55
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 2 14:44:30 2018 +0300

    EG(*) may be not initializd at this point - use CG(*).

commit b610467051d8a3687a60ffc2957bc353cb6b3bd4
Merge: 3a9d90f74a 67e0138c0d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 2 11:33:37 2018 +0300

    Merge branch 'master' into preload

    * master:
      Future-proof email addresses...
      Update email addresses.  We're still @Zend, but future proofing it...

commit 3a9d90f74a3d890cb59658d604d5a202e3aee256
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Nov 1 15:19:48 2018 +0300

    Fexed resolution of method clones

commit aea85c65bd1795d0750dee6ac0e476acd2ac9dd7
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Nov 1 11:45:50 2018 +0300

    Prevent inlining of method copied from trait

commit 36b644fbb738e7548ccb436e5d04d653d93cce14
Merge: 7a20781d2e b91690c892
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Nov 1 10:56:02 2018 +0300

    Merge branch 'master' into preload

    * master:
      Fix stray newline that caused this test to fail
      Fix session tests that fail if error_log is set
      This test needs to log to stdout
      Fix error condition
      Fixed bug #77081 ftruncate() changes seek pointer in c mode
      Fix and improve test case

commit 7a20781d2ee694262f913a612d8b0b6a24ceff7b
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 31 00:52:46 2018 +0300

    Added test

commit 4a57b5d563f9c9616f3c236f57ccd09d8a66f146
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 31 00:50:21 2018 +0300

    Fixed preloading of classes linked with traits

commit 68c4f99e23695e74eafa43097ecab62392bad3ee
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Oct 30 16:25:14 2018 +0300

    Added test

commit 38ab7ef4cf429dcfd5dfb18f844242cdf3a4d61f
Merge: eb6e2c529f bf38e6c10a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Oct 30 16:14:39 2018 +0300

    Merge branch 'master' into preload

    * master:
      Keep original value of "prototype"

commit eb6e2c529f8cedf6823346387dd8b0ba6a4f045b
Merge: 562049510f 2fefa8c61e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Oct 30 15:35:39 2018 +0300

    Merge branch 'master' into preload

    * master:
      Call function_add_ref() in proper place
      Updated to version 2018.7 (2018g)
      Updated to version 2018.7 (2018g)
      Updated to version 2018.7 (2018g)
      Reslove inherited op_array references once afrer all optimizations.

commit 562049510f605c21cd46fc3b6f97ed15bfe7b0dc
Merge: e806cb732a 4828fb7b6b
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Oct 30 10:29:49 2018 +0300

    Merge branch 'master' into preload

    * master:
      [ci skip] Update NEWS
      [ci skip] Update NEWS
      [ci skip] Update NEWS
      fix bug #77079
      Add missing null initialization
      Remove redundant mbfl_string_init calls
      Use zend_string for mbstring last encoding cache

commit e806cb732a2a3f1e409528988a0571421c541078
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 29 22:32:15 2018 +0300

    Fixed double-free

commit 2f697ef8af0e7b21c47707b2d688880e8c987a8b
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 29 22:07:32 2018 +0300

    typo

commit c559f22b3e61b38761831d9610889d28ba6875e0
Merge: 310631cc05 ea2e67876a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 29 21:59:27 2018 +0300

    Merge branch 'master' into preload

    * master:
      Stop Apache if PHP wasn't started successful.
      Execute zend_post_startup() with module_initialized flag set.
      Removed dead code
      Fix mb_strrpos() with encoding passed as 3rd param

commit 310631cc0565ac87091c4f1a8a9f739a13e7e778
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 29 16:48:42 2018 +0300

    Stop Apache if PHP wasn't started successful.

commit 0a24d7ba8f3280507c9663b32e14030212cf8491
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 29 16:25:49 2018 +0300

    Avoid use-after-free in main thread

commit 17a3cb4a2ab271c2b2357c04e36efa64e02444ff
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 29 15:25:17 2018 +0300

    Execute zend_post_startup() with module_initialized flag set.

commit 6d4b22c518bec956e9632fad4329360304d17fd7
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 29 14:12:20 2018 +0300

    Override SAPI.ub_write and SAPI.flush for preloading

commit 386c9d3470168f70afe5d3b72a58ea0c0da1519c
Merge: d7fbb4d402 359f19edc9
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 29 13:49:24 2018 +0300

    Merge branch 'master' into preload

    * master:
      Optimize substr() edge-case conditions
      [ci skip] Update UPGRADING
      Fix #71592: External entity processing never fails
      Add TIDY_TAG_* constants supported by libtidy 5
      Add is_iterable to opcache Optimizer

commit d7fbb4d402a18c8fd1c49e0c92afd9f9e513bc7a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Oct 26 13:11:54 2018 +0300

    Restore preload state if it was already loaded in another process.

commit 0fe9ea1c07822b5d4672cece2c180bf9795e16e4
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Oct 26 12:29:06 2018 +0300

    Removed dead code

commit 3a2d1bcc1fd27b6983522c262931fc0187c0afef
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Oct 26 00:19:40 2018 +0300

    Support for builds without ZEND_SIGNALS

commit e6b76ecb4beea3b922bf7529050e3828f745dedb
Merge: 4531fbf931 68694c9997
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Oct 25 23:43:25 2018 +0300

    Merge branch 'master' into preload

    * master:
      Don't wrap php_module_shutdown() with zend_try. executor_globals are released in ZTS build, and this leads to crash.
      [ci skip] Fix indentation in UPGRADING.

commit 4531fbf9310bfb7bb579134cc84e8c10c5d42059
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Oct 25 22:44:49 2018 +0300

    Disable linking and preloading of classes those parent or one of interface or trait is an internal class.

commit a594a618ce98242c1d273eb9ede75b4f6b4635d8
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Oct 25 22:30:51 2018 +0300

    Cleanup

    - remove useless ZCSG(saved_map_ptr_last)
    - move preloaded classes/functions clean-up code back into better place

commit ab9a40f63cfa1a205b8f853b7e0c2ce61edabb32
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Oct 25 20:52:51 2018 +0300

    Added support for preloaded classes/functions in ZTS build

commit e3c65db099517082b66dd20ea57e1bda649a7aa5
Merge: 4f57c1e029 33e777acbf
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Oct 25 20:52:26 2018 +0300

    Merge branch 'master' into preload

    * master:
      Improved shared interned strings handling. The previous implementation worked incorrectly in ZTS build. It changed strings only in function/class tables of one thread. Now all threads gets the same shared interned strings. Also, on shutdown, we don't try to replace SHM interned strings back to process strings, but delay dettachment of SHM instead.
      Don't use request heap at shutdown
      Don't optimize function if inference failed
      Fixed bug #77058
      Improve "narrowing" error message
      bump versions

commit 4f57c1e029ce9c24bd699ea61b05973c4665bc32
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Oct 25 15:29:58 2018 +0300

    Cleanup (move preload_shutdown() call to better place)

commit 26587a95c071cf9dd098199eb3708fca8adae243
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Oct 25 14:30:51 2018 +0300

    eol

commit d70cb10480fdc7d814495150cd48e43d4147138f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Oct 25 14:30:20 2018 +0300

    cleanup

commit aabe685dbb887e91c240b6c5553193889bcfc540
Merge: d9fc51bc3b 40808ac41e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Oct 25 12:42:51 2018 +0300

    Merge branch 'master' into preload

    * master:
      Remove unused var
      Remove ext/json parser files generated by bison
      Fix run-tests.php for running phpdbg and certain test sections
      Normalize .gitignore

commit d9fc51bc3bdfbd7f4149a884b09e3c09a41f7a8d
Merge: b5ffba0faf b6ef8998d5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 24 15:59:24 2018 +0300

    Merge branch 'master' into preload

    * master:
      Fixed reseting of interned strings buffer.

commit b5ffba0fafb4d940336d5f5fe93950dad1d8d779
Merge: e4a7ef0c43 a404383118
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 24 12:46:28 2018 +0300

    Merge branch 'master' into preload

    * master:
      Fixed build in directory different from source

commit e4a7ef0c431ec97cdd00e44dfa0ef17887d1e5e3
Merge: 811f20aaa5 d1e14e2cc0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 24 11:59:43 2018 +0300

    Merge branch 'master' into preload

    * master: (29 commits)
      Make php_plain_files_wrapper to be writable (workaround for swoole)
      Remove phpdbg parser files generated by bison
      Fix conflicts in phpdbg parser
      Refetetch function name on exceptional path to allow better code on fast code path.
      fix typo in sysvsem.c
      Fixed bug #50675
      bump to 7.2.13-dev
      [ci skip] Update NEWS wrt. php-7.3.0RC4 tagging
      Inlining in the most frequently used code paths
      Fixed test failurs introduced by 9c144e0d82
      Use persistent strings only for persistent connections
      Fix accessibility checks for dynamic properties
      Updated to version 2018.6 (2018f)
      Updated to version 2018.6 (2018f)
      Updated to version 2018.6 (2018f)
      Fix arginfo and clean up fpm_get_status
      Defragment two Zend related Makefile fragments together
      [ci skip] Remove automake and aclocal in comments
      Fix #75282: xmlrpc_encode_request() crashes
      Fix tests for ICU 63.1
      ...

commit 811f20aaa5030035666d9f325dd7c64632c70a50
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 22 14:10:49 2018 +0300

    Added information about preloading to opcache_get_status()

commit 093e8b1bbffdc07d217a543613ea14c3eeac710e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Oct 19 13:46:23 2018 +0300

    Added warning message

commit a2ba970ce3d0ac51ebfbe1bfc2dc7b99b9750a75
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Oct 19 13:35:40 2018 +0300

    Added test

commit b67e28367c11db50360e664a7ad6ac95b393f2e4
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Oct 19 13:33:12 2018 +0300

    Don't preload functions declared at run-time.

commit b0139dc22854ee000586ef83c149d7d25181da60
Merge: a609520adb 3fe698b904
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Oct 19 13:23:14 2018 +0300

    Merge branch 'master' into preload

    * master:
      Mark "top-level" functions.
      Don't initialize static_member_tables during start-up, when inherit internal classes.
      [ci skip] Update NEWS
      [ci skip] Update NEWS
      [ci skip] Update NEWS
      Fix #77035: The phpize and ./configure create redundant .deps file
      Remove outdated PEAR artefacts
      Fix tests/output/bug74815.phpt generating errors.log
      Revert "Use C++ symbols, when C++11 or upper is compiled"
      Use C++ symbols, when C++11 or upper is compiled
      Added new line
      Remove stamp-h
      Move all testing docs to qa.php.net
      Fix a typo in UPGRADING.INTERNALS
      Fix test when it's run on another drive
      [ci skip] Update UPGRADING wrt. tidyp support
      Fixed incorrect reallocation
      Fix #77027: tidy::getOptDoc() not available on Windows
      Run CI tests under opcache.protect_memory=1

commit a609520adbc0bf12701d467bae4a016fde43231e
Merge: ac8f45f61b b6ac50f9e6
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 17:01:05 2018 +0300

    Merge branch 'master' into preload

    * master:
      Fixed comment
      Micro optimizations
      Mark "top-level" classes

commit ac8f45f61b561af9aee629232bc3705143ceaac3
Merge: 632b30b545 d57cd36e47
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 15:53:41 2018 +0300

    Merge branch 'master' into preload

    * master:
      Immutable clases and op_arrays.

commit 632b30b5451c8fdf0879a3ba4d937ff4ecfc8ce7
Merge: d33908a99a cd0c36c3f9
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 15:04:43 2018 +0300

    Merge branch 'immutable' into preload

    * immutable:
      Remove the "auto" encoding
      Fixed bug #77025
      Add vtbls for EUC-TW encoding

commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9
Merge: 4740dabb84 ad6738e886
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:43:38 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove the "auto" encoding
      Fixed bug #77025
      Add vtbls for EUC-TW encoding

commit d33908a99a3c746f188e268df3db541591f6fcc2
Merge: 21e0bebca3 4740dabb84
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:14:23 2018 +0300

    Merge branch 'immutable' into preload

    * immutable:
      Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes.

commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:12:28 2018 +0300

    Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes.

commit 21e0bebca3e6fff3c3484ee46f9aa3ac4e98eaeb
Merge: c78277ae84 ad7a78b253
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 12:29:59 2018 +0300

    Merge branch 'immutable' into preload

    * immutable:
      Added comment
      Added type cast
      Moved static class members initialization into the proper place.
      Removed redundand assertion
      Removed duplicate code
      Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros.
      typo
      Remove unused variable makefile_am_files
      Classify object handlers are required/optional
      Add support for getting SKIP_TAGSTART and SKIP_WHITE options
      Remove some obsolete config_vars.mk occurrences
      Remove bsd_converted from .gitignore
      Remove configuration parser and scanners ignores
      Remove obsolete buildconf.stamp from .gitignore
      [ci skip] Add magicdata.patch exception to .gitignore
      Remove outdated ext/spl/examples items from .gitignore
      Remove unused test.inc in ext/iconv/tests

commit ad7a78b253be970db70c2251e66f9297d8e7f829
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:46:30 2018 +0300

    Added comment

commit 0276ea51875bab37be01a4dc5e5a047c5698c571
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:42:43 2018 +0300

    Added type cast

commit c63fc5d5f19c58498108d1698055b2b442227eb3
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:36:51 2018 +0300

    Moved static class members initialization into the proper place.

commit b945548e9306b1826c881918858b5e5aa3eb3002
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:21:03 2018 +0300

    Removed redundand assertion

commit d5a41088401814c829847db212488f8aae39bcd2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:19:13 2018 +0300

    Removed duplicate code

commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:05:43 2018 +0300

    Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros.

commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:48:29 2018 +0300

    typo

commit a06f0f3d3aba53e766046221ee44fb9720389ecc
Merge: 94099586ec 3412345ffe
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:47:07 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove unused variable makefile_am_files
      Classify object handlers are required/optional
      Add support for getting SKIP_TAGSTART and SKIP_WHITE options
      Remove some obsolete config_vars.mk occurrences
      Remove bsd_converted from .gitignore
      Remove configuration parser and scanners ignores
      Remove obsolete buildconf.stamp from .gitignore
      [ci skip] Add magicdata.patch exception to .gitignore
      Remove outdated ext/spl/examples items from .gitignore
      Remove unused test.inc in ext/iconv/tests

commit c78277ae84b21067744d1701949e4e1fadd8872a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Oct 16 17:25:35 2018 +0300

    Preloadsing support for opcache restart

commit f76a955c02f6a033d4656d5e0d9dad9a8e83cc86
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Oct 16 13:52:36 2018 +0300

    Fixed incorrect signal handlers overriding

commit 0810ce0d8165d4b752267f035f9fa0aaa1698ceb
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 15 23:38:48 2018 +0300

    An attempt to implemnt "preloading" ability.

commit 94099586ec599117581ca01c15b1f6c5f749e23a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 15 23:34:01 2018 +0300

    Immutable clases and op_arrays
2018-11-14 16:46:05 +03:00
Dmitry Stogov ba99aa133c Fixed issues related to optimization and persitence of classes linked with interfaces, traits or internal classes. 2018-11-14 16:32:07 +03:00
Dmitry Stogov 53ea09e84d Added possiblity to avoid signal handlers reinitialization on each request. 2018-11-14 16:26:14 +03:00
Dmitry Stogov 8bda22592e Eliminate useless $this related check 2018-11-14 11:33:14 +03:00
Dmitry Stogov 5ebefa74cf Eliminate useless $this related checks 2018-11-14 03:46:42 +03:00
Dmitry Stogov 54a7d03934 Replace zend_parse_method_parameters() by zend_parse_parameters() and avoid useless checks. 2018-11-14 03:32:19 +03:00
Dmitry Stogov c6ad0b92b7 Replace getThis() by EX(This), when additional check is not necessary. 2018-11-14 02:44:25 +03:00
Dmitry Stogov 6bb94eacd7 Fixed tests 2018-11-13 17:00:06 +03:00
Joe Watkins 177d45b7e7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Validate length on socket_write
2018-11-13 13:00:50 +01:00
Nikita Popov 12cbe930cd Merge branch 'PHP-7.3' 2018-11-13 12:31:44 +01:00
Christoph M. Becker 78fac5ed95 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77141: Signedness issue in SOAP when precision=-1
2018-11-12 23:25:38 +01:00
Christoph M. Becker 86c6b3bdcd Support SQLite3 @name notation
Besides the common `:param` notation to designate named parameters in
prepared statements, SQLite3 also supports `@param` and `$param`.
While the latter is mostly to support the Tcl programming language, and
would be confusing for PHP's sqlite3 binding due to the similarity with
string interpolation, the former is common under .NET and raises no
such issue.  Therefore we add support for it.

This patch has been developed in cooperation with @BohwaZ.
2018-11-11 14:55:34 +01:00
Peter Kokot f0251a8b16 Remove lexer files generated by RE2C
This patch removes generated lexer files by re2c during the build
process so they are not tracked by Git yet can be still shipped when
PHP is released. The genfiles script additionally provides generation
of these lexer files when creating a release of the PHP source code.

The genfiles script refactorings:
- added file header
- echoing steps instead of comments
- cleaning only lines starting with `#line`
- eval removed in favor of direct executed commands
- the debug mode `set -x` removed
- script can be called from any path
- improved comments
2018-11-11 02:55:46 +01:00
Anatol Belski 1c873c1191 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update libmagic.patch [ci skip]
  Update libmagic.patch [ci skip]
2018-11-10 22:03:07 +01:00
Anatol Belski 854691922a Merge branch 'PHP-7.3'
* PHP-7.3:
  Fork test with pcre.jit=0
2018-11-10 20:07:52 +01:00
Anatol Belski d0226995c9 Merge branch 'PHP-7.3'
* PHP-7.3:
  Rework magic data
2018-11-10 18:26:04 +01:00
Anatol Belski 3c0ac24258 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix regex
  Fix regex
2018-11-10 12:13:29 +01:00
Anatol Belski d0d19c1764 Merge branch 'PHP-7.3'
* PHP-7.3:
  Rework magic data
2018-11-10 01:32:52 +01:00
Anatol Belski 203640bb70 Merge branch 'PHP-7.3'
* PHP-7.3:
  Sync one more upstream libmagic piece
2018-11-10 00:20:56 +01:00
Mizunashi Mana 8021e0f5dc Suppress already used warning 2018-11-09 11:09:16 +01:00
Mizunashi Mana 17d76e530d Ignore getaddrinfo failed message 2018-11-08 21:46:03 +01:00
Mizunashi Mana c180c8c3bd Clean testfile 2018-11-08 14:29:39 +01:00
Mizunashi Mana 705a31b4e5 Skip SQLite3::loadExtension tests if SQLITE_OMIT_LOAD_EXTENSION defined 2018-11-08 14:27:12 +01:00
Nikita Popov 50e7e3a653 Use new option name in travis/compile.sh 2018-11-07 20:22:41 +01:00
Mizunashi Mana 632b6e7aac Add putenv for setlocale for gettext tests 2018-11-07 18:54:47 +01:00
Levi Morrison 74d15b535a Remove do_bind_inherited_class; use do_bind_class
Pass NULL as the second parameter. I don't know if in the past these
differed more, but there isn't any point to having both of them
anymore.
2018-11-07 18:54:00 +01:00
Christoph M. Becker b7b3a65e1d Avoid needless string duplication
Cf. <https://github.com/php/php-src/pull/3636#issuecomment-436638833>.
2018-11-07 17:10:35 +01:00
Eli Schwartz 2d03197749 ext/gd: Use pkg-config to detect the availability of freetype2
The latest version of freetype2 does not install freetype-config by
default, but pkg-config support has been there for approximately 15
years. In order to reliably detect freetype2, pkg-config *must* be used.

See:
https://savannah.nongnu.org/bugs/?53093
https://bugs.php.net/bug.php?id=76324
2018-11-07 13:05:47 +01:00
Dmitry Stogov f200298075 Avoid double copying 2018-11-07 14:23:34 +03:00
Dmitry Stogov 8c7aa88e2d Fixed crash introduced by bfaf662ac2 2018-11-07 09:36:21 +03:00
Dmitry Stogov bc53642c05 *printf() optimization and v*printf() warning message fix. 2018-11-07 02:40:15 +03:00
Dmitry Stogov cdbbc802b4 Removed dead checks 2018-11-06 23:11:28 +03:00
Dmitry Stogov c994d90db2 Reorder conditions and set expectation. 2018-11-06 22:37:04 +03:00
Dmitry Stogov bfaf662ac2 Micro-optimization 2018-11-06 17:04:17 +03:00
Christoph M. Becker 9717a6d3a7 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS wrt. php-7.3.0RC5 tagging
2018-11-06 11:46:47 +01:00
Anatol Belski 049f239cfc Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS [ci skip]
  Update NEWS [ci skip]
2018-11-05 22:54:17 +01:00
Anatol Belski 2e336329e0 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update libmagic.patch [ci skip]
  Update libmagic.patch [ci skip]
2018-11-05 22:25:54 +01:00
Anatol Belski 956708acac Merge branch 'PHP-7.3'
* PHP-7.3:
  Declare function proto in header
  Declare function proto in header
2018-11-05 21:30:02 +01:00
Christoph M. Becker 34e65f73bc Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76825: Undefined symbols ___cpuid_count
2018-11-05 18:25:22 +01:00
Remi Collet dbef28ea8f Merge branch 'PHP-7.3'
* PHP-7.3:
  NEWS
  Fix: #77110 undefined symbol zend_string_equal_val in C++ build
2018-11-05 17:06:49 +01:00
Dan Wallis eb1233533e Fix #77105: Use position:sticky for <th> in phpinfo()
This ensures tables remain legible when scrolling. If the user agent
does not support this feature, then it will gracefully degrade to
existing behaviour.

This patch implements: https://bugs.php.net/bug.php?id=77105
2018-11-05 14:27:06 +01:00
Anatol Belski c364edf7f2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Implement handling for JIT recognition when cross compiling
2018-11-05 01:16:54 +01:00
Anatol Belski 6dfcd4288e Merge branch 'PHP-7.3'
* PHP-7.3:
  Backport 7f5f4601 for 7.2
2018-11-04 17:00:02 +01:00
Christoph M. Becker b6f5183816 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76348: WSDL_CACHE_MEMORY causes Segmentation fault
2018-11-04 16:48:13 +01:00
Anatol Belski 424d5a60dd Merge branch 'PHP-7.3'
* PHP-7.3:
  Rework places in libmagic regarding previous CVE-2014-3538 fixes
2018-11-04 13:18:48 +01:00
Anatol Belski d4761b64e7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Change the way JIT availability is checked
2018-11-03 20:51:22 +01:00
Mizunashi Mana e412195772 Fix a test for ldap extension 2018-11-03 17:37:47 +01:00
Nikita Popov 429c5a0a82 Merge branch 'PHP-7.3' 2018-11-02 14:34:11 +01:00
Zeev Suraski 67e0138c0d Future-proof email addresses... 2018-11-01 18:30:28 +02:00
Zeev Suraski 54dc07f3dc Update email addresses. We're still @Zend, but future proofing it... 2018-11-01 17:20:07 +02:00
Rasmus Lerdorf b91690c892 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix stray newline that caused this test to fail
2018-10-31 11:41:42 -07:00
Rasmus Lerdorf 46b25ee2a9 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix session tests that fail if error_log is set
2018-10-31 10:59:31 -07:00
Rasmus Lerdorf fcb2e1da09 Merge branch 'PHP-7.3'
* PHP-7.3:
  This test needs to log to stdout
2018-10-31 10:44:01 -07:00
Anatol Belski 9c9178af51 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix error condition
  Fixed bug #77081 ftruncate() changes seek pointer in c mode
2018-10-30 20:50:07 +01:00
Christoph M. Becker 0a1ab6ec2f Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix and improve test case
2018-10-30 18:55:16 +01:00
Dmitry Stogov bf38e6c10a Keep original value of "prototype" 2018-10-30 16:13:45 +03:00
Dmitry Stogov 2fefa8c61e Call function_add_ref() in proper place 2018-10-30 15:08:45 +03:00
Dmitry Stogov e5edaed69b Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Updated to version 2018.7 (2018g)
  Updated to version 2018.7 (2018g)
  Updated to version 2018.7 (2018g)
2018-10-30 15:08:30 +03:00
Derick Rethans 6ad8edee92 Updated to version 2018.7 (2018g) 2018-10-30 11:25:49 +00:00
Derick Rethans dcebc1d3cf Empty merge 2018-10-30 11:25:49 +00:00
Dmitry Stogov ebf44fbbda Reslove inherited op_array references once afrer all optimizations. 2018-10-30 13:16:49 +03:00
Peter Kokot 4828fb7b6b Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  fix bug #77079
2018-10-30 00:24:20 +01:00
Nikita Popov 6da3eac56a Add missing null initialization 2018-10-29 20:57:21 +01:00
Nikita Popov 837843ff4a Remove redundant mbfl_string_init calls
No need to do this if we already fully initialize the string.
2018-10-29 20:29:23 +01:00
Nikita Popov a7d6b2c1fb Use zend_string for mbstring last encoding cache
Saves us a string duplication, as well as case-insensitive string
comparisons for the likely case of an interned string encoding.
2018-10-29 20:29:22 +01:00
Dmitry Stogov ea2e67876a Stop Apache if PHP wasn't started successful. 2018-10-29 21:39:26 +03:00
Dmitry Stogov 7a5416b1c5 Execute zend_post_startup() with module_initialized flag set. 2018-10-29 21:38:57 +03:00
Dmitry Stogov 2491b7b65a Removed dead code 2018-10-29 21:38:25 +03:00
Nikita Popov 493b534c84 Merge branch 'PHP-7.3' 2018-10-29 18:56:43 +01:00
Dmitry Stogov 359f19edc9 Optimize substr() edge-case conditions 2018-10-29 13:11:41 +03:00
Christoph M. Becker 52d91260df Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update UPGRADING
2018-10-28 12:48:49 +01:00
Christoph M. Becker c37beb7eb5 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #71592: External entity processing never fails
2018-10-27 17:31:29 +02:00
Christoph M. Becker 0d6490598d Add TIDY_TAG_* constants supported by libtidy 5
Cf. <http://api.html-tidy.org/tidy/tidylib_api_5.0.0/tidyenum_8h.html#ae5b597c0999422ff383f08ab595ef5e8a16d20becf3c3cb022ddabccc83d8c314>.
2018-10-27 16:17:09 +02:00
Gabriel Caruso 388c21e764 Add is_iterable to opcache Optimizer 2018-10-26 08:14:45 -03:00
Dmitry Stogov 68694c9997 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  [ci skip] Fix indentation in UPGRADING.
2018-10-25 23:42:58 +03:00
Dmitry Stogov 10abc1f010 Don't wrap php_module_shutdown() with zend_try. executor_globals are released in ZTS build, and this leads to crash. 2018-10-25 23:41:26 +03:00
Adam Harvey 1eb5bc021b Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Fix indentation in UPGRADING.
2018-10-25 11:59:23 -07:00
Dmitry Stogov 33e777acbf Improved shared interned strings handling. The previous implementation worked incorrectly in ZTS build. It changed strings only in function/class tables of one thread. Now all threads gets the same shared interned strings. Also, on shutdown, we don't try to replace SHM interned strings back to process strings, but delay dettachment of SHM instead. 2018-10-25 20:30:51 +03:00
Dmitry Stogov f33da6f338 Don't use request heap at shutdown 2018-10-25 19:24:39 +03:00
Nikita Popov 3d415644f7 Merge branch 'PHP-7.3' 2018-10-25 16:44:54 +02:00
Anatol Belski 40808ac41e Remove unused var 2018-10-24 23:37:32 +02:00
Peter Kokot 22c249347e Remove ext/json parser files generated by bison
The parser files for ext/json are generated by bison from the *.y file.
Parser files in Zend and sapi/phpdbg already follow such approach of
these files being ignored from tracking in the Git repository and they
are shipped via the release packages later on. This way the end users
still don't need to have bison dependency installed to install PHP.

The genfiles script was refactored to generate the ext/json parser and
lexer files.
2018-10-24 20:13:04 +02:00
Peter Kokot 220a2239a6 Fix run-tests.php for running phpdbg and certain test sections
Certain sections, such as --EXTENSIONS--, --SKIPIF--, and --CLEAN--
require to be executed using only PHP CLI or PHP CGI SAPIs and cannot be
processed with the phpdbg.
2018-10-24 16:21:57 +02:00
Peter Kokot 0b63544f25 Normalize .gitignore
Changes:
- Added introductory paragraph to explain the file for newcomers and
  where to ignore local editor configurations as a common practice
  when using Git.
- Patterns organized into several main context sections for a better
  overview of the php-src directory structure and which files get
  generated where.
- Added comments describing reasons for ignoring particular file(s).
- Patterns normalized according to Git ignore blob patterns. Absolute
  paths are different than relative paths and similar fixes.
- Folders patterns have appended ending slash for readability to
  distinguish them from files.

Removed ignore patterns:
- Removed `sapi/phpdbg/build` pattern since it doesn't seem to be
  relevant anymore in the php-src repository.
- The `acconfig.h` pattern removed in favor of the more recent Autoconf
  versions.
- Removed patterns for `.FBCIndex` `.FBCLockFolder` folders. These were
  generated on old Mac OS systems [1] using the Sherlock [2] software
  and can be today ignored using a global gitignore file if needed.
  Newer macOS systems don't generate these anymore.
- Removed `php_version.h` pattern since the `main/php_version.h` file is
  tracked by Git.
- Removed `*.mk` pattern since few *.mk files are tracked by Git and new
  ones aren't generated during build process.
- Removed `**/tests/**/*.txt` pattern. This has been refactored via
  595a395cb9 and current tests also clean
  the generated `*.txt` files as soon as they are executed. Since there
  are several `*.txt` files in the repository tracked by Git already and
  renaming them would be counter productive so the pattern is now removed.
  In case there will be a need to adjust it, we can rename the generated
  `*.txt` into something else instead (ideally into `*.tmp`) to not
  conflict with already tracked `*.txt` files in tests.
- Removed `ext/*/scan_makefile_in.awk` and `scan_makefile_in.awk` patterns
  since these are already included in the `/ext/*/build/` pattern.
- Removed the `/ext/*/libs.mk` pattern since these auxilary Makefiles
  have been used in previous build system and made obsolete via the commit
  9d9d39a0de.
- Removed pattern for configuration header `ext/pdo_sqlite/sqlite3.h` since
  it is not generated anymore in the current code.
- Removed `main/streams/build-defs.h` pattern since this file is not
  generated.
- Removed `test.php3` pattern. These don't seem to be present in the current
  PHP source code nor used since PHP 3.
- Removed `/ext/oci8/tests/*.vglog` pattern since the tests don't seem to
  produce these files.
- Removed pattern for Visual Studio's `*.ncb` files. Since the Visual
  Studio 2010 they are no longer used.
- Removed `ext/sqlite3/tests/phpsql*` pattern. It was part of the `ext/sqlite/tests`.
- Removed `shlibtool` pattern since the shlibtool file is not generated
  anymore. It was once part of the libtool usage and customized naming
  used in the previous build system in Makefiles. Such naming was later
  removed and only libtool was used.
- Removed `meta_ccld` pattern since it is no longer relevant via
  a5b55416f4
- Pattern `meta_cc` has been removed via e5176fe60a.
- Pattern `dynlib.m4` removed since the file is no longer generated via
  9d9d39a0de
- Pattern `debug.log` removed since the Autoconf Macro PHP_DEBUG_MACRO
  is not called anymore and this file not generated anymore.
- Pattern `results.txt` removed. It was once part of the logging results
  of test files by Netware and previous Windows builds.
- Removed `_libs` pattern in favor of only `.libs`. These directories
  were once generated by Automake and Libtool on systems that didn't
  support the dot folder `.libs` (MS-DOS).
- Removed `*.opt` pattern since it was used by Visual Studio 6. Later
  versions of Visual Studio don't use these anymore.
- Removed `*.plg` pattern. It was build log generated by Visual Studio 6.
- Removed `core` pattern since it was probably related to commit
  fd7153b0f3 and is today not used.
- Removed ˙*.˙, ˙diff`, and ˙*.tgz` patterns since they don't seem to be
  generated in the current code on the first glance. In case these will be
  one day required to ignore again, they can be simply added back again.
- Removed Emacs specific interlock files pattern `.#*`. The number of
  editors and IDEs specific files is very big. Emacs editors also produce
  some other files such as `#*#` for autosave feature, which were previously
  not ignored. To fully and properly support all additional patterns these
  could be added to .gitignore files. A much more sustainable and better
  practice is to use a global gitignore file on the local system or the
  `.git/info/exclude` per repository basis for these in particular.

Added patterns:
- Added new pattern for `*.obj` standard object files in the Windows
  section. These are generated by Visual Studio.
- Added `/ext/*/run-tests.php` patterns for extensions.
- Reversed patterns for particular tracked `/win32/build/Makefile`, `config.h`
  files and `.patch` files.
- Added patterns for generated dtrace files `/ext/oci8/oci8_dtrace_gen.h`

Other changes:
- All `conftest*` patterns merged into a single one.
- Pattern `*.mem` made more specific where the memory check files get
  generated by `run-tests.php -m`, i.e. `**/tests/**/*.mem`.
- Fixed `/Zend/zend_dtrace_gen.h.bak` `hbak` typo.

[1] http://www.westwind.com/reference/OS-X/invisibles.html
[2] https://en.wikipedia.org/wiki/Sherlock_(software)
2018-10-24 16:20:52 +02:00
Dmitry Stogov b6ef8998d5 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed reseting of interned strings buffer.
2018-10-24 15:46:22 +03:00
Dmitry Stogov a404383118 Fixed build in directory different from source 2018-10-24 12:45:04 +03:00
Dmitry Stogov d1e14e2cc0 Merge branch 'PHP-7.3'
* PHP-7.3:
  Make php_plain_files_wrapper to be writable (workaround for swoole)
2018-10-24 11:50:18 +03:00
Peter Kokot c0446d55a2 Remove phpdbg parser files generated by bison
The parser files for phpdbg are generated by bison from the *.y file.
Parser files in Zend already follows such approach of these files being
ignored from tracking in the Git repository and they are shipped via
the release packages. This way the end user still don't need to have
bison dependency installed to install PHP.

The genfiles script was refactored to generate the phpdbg parser and lexer
files.

Empty comment in phpdbg parser y template file has been changed to the
YACC compliant /* empty */ instead of custom one.
2018-10-23 19:04:13 +02:00
Nikita Popov 1362d8e103 Fix conflicts in phpdbg parser 2018-10-23 16:22:16 +02:00
Dmitry Stogov e3688c2180 Refetetch function name on exceptional path to allow better code on fast code path. 2018-10-23 17:12:49 +03:00
Nikita Popov f844a2b29d Merge branch 'PHP-7.3' 2018-10-23 14:57:21 +02:00
Nikita Popov ed7d98ce13 Merge branch 'PHP-7.3' 2018-10-23 14:25:22 +02:00
Remi Collet 9271f9482b Merge branch 'PHP-7.3'
* PHP-7.3:
  bump to 7.2.13-dev
2018-10-23 12:16:49 +02:00
Christoph M. Becker 46493044f1 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS wrt. php-7.3.0RC4 tagging
2018-10-23 12:11:15 +02:00
Dmitry Stogov 6f91090f6a Inlining in the most frequently used code paths 2018-10-23 12:46:44 +03:00
Dmitry Stogov fd080a06d8 Fixed test failurs introduced by 9c144e0d82 2018-10-23 12:46:12 +03:00
Dmitry Stogov 0459640fcd Use persistent strings only for persistent connections 2018-10-23 10:43:58 +03: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
Derick Rethans fd3d2755dc Updated to version 2018.6 (2018f) 2018-10-22 12:05:42 +01:00
Derick Rethans 2a0d7036c3 Empty merge 2018-10-22 12:05:42 +01:00
Jakub Zelenka 751dfc7514 Merge branch 'PHP-7.3' 2018-10-21 19:40:53 +01:00
Peter Kokot 8217cd20f1 Defragment two Zend related Makefile fragments together
The two are more logically connected together in the Zend directory.
2018-10-21 15:59:16 +02:00
Peter Kokot f8fb45facf [ci skip] Remove automake and aclocal in comments
The Automake and aclocal were part of the previous PHP build system
where Automake created Makefile from the Makefile.in templates and
aclocal was used to produce the aclocal.m4. They were removed as
dependencies via 9d9d39a0de and
e715fb00f8.
2018-10-21 13:06:58 +02:00
Christoph M. Becker d88b006ad6 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #75282: xmlrpc_encode_request() crashes
2018-10-21 12:11:57 +02:00
Anatol Belski 63353b95c6 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix tests for ICU 63.1
2018-10-20 23:05:38 +02:00
Peter Kokot 04be076a5d Fix .gitattributes
The `crlf` Git attribute has been long deprecated and made obsolete. A
replacement for using `-crlf` is `-text`. That way Git doesn't do
newlines normalization on any system.

Since the phpt files don't need specific line endings in any files
except for some special CR characters in some, this can be also removed
and line normalization can happen on all phpt files. The run-tests.php
file converts the CRLF to LF before running the test.

This patch also sets a `diff` attributes for all *.phpt files. It
helps showing diffs for some phpt files with special characters such
as ASCII control characters which makes Git recognize them as binary and
stops showing commit diffs otherwise

Some additional short info about used Git attributes has been also added
as comments for easier understanding.

Remove -text gitattribute
2018-10-20 22:58:27 +02:00
Khan M Rashedun-Naby 36ae074036 Simplify mb_gpc() code
Use a switch (consistent with other places in this file) and also
don't unnecessarily set free_buffer.
2018-10-20 22:30:21 +02:00
Anatol Belski 251bd9c253 Use C++ symbols with C++11, take 2 2018-10-20 10:56:02 +02:00
Peter Kokot d6c05c6cd1 Rename two *.php files in tests folders
Current run-tests.php script produces the `*.php` files from the
*.phpt. So all *.php files in tests folders are ignored by Git.

To avoid confusion and to for bettere consistency this patch renames
two remaining tests/*/*.php files to *.inc and *.phar as current
practice in *.phpt files.

- The `ext/curl/tests/resonder/get.php` to .inc extension
- The `ext/phar/tests/files/pear2coverage.phar.php` to .phar extension
2018-10-20 10:11:29 +02:00
Peter Kokot addcf2402d Remove mkdep.awk
The `mkdep.awk` file was part of the previous *nix build system and was
used to create a .deps file with a list of dependencies that could be
processed by Automake further on.

Newer build system was done via 9d9d39a0de
and outdated files removed via 22815419f8
so the current file in the PHP source code is not used anymore.

Additionally, the *.slo files were processed by this file. The *.slo
files also used to be generated by older libtool so today, these don't
get generated anymore.
2018-10-20 10:08:54 +02:00
Peter Kokot 82f59a9682 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  Fix #77041: buildconf should output error messages to stderr
2018-10-20 09:55:33 +02:00
Dmitry Stogov 3fe698b904 Mark "top-level" functions. 2018-10-19 13:22:29 +03:00
Dmitry Stogov 03384cae3c Don't initialize static_member_tables during start-up, when inherit internal classes. 2018-10-19 13:21:31 +03:00
Peter Kokot 1257664ca2 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  Fix #77035: The phpize and ./configure create redundant .deps file
2018-10-19 00:12:48 +02:00
Peter Kokot 00db0e7a04 Remove outdated PEAR artefacts
The `pear/scripts`, `pear/php-config`, `pear/phpize`, and
`pear/run-tests` used to be part of the PEAR installation. Now, the
pear installation PHAR file is directly downloaded from pear.php.net
instead.
2018-10-18 23:43:13 +02:00
Peter Kokot d61c7ae5ed Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix tests/output/bug74815.phpt generating errors.log
2018-10-18 23:40:00 +02:00
Anatol Belski f5bc049136 Revert "Use C++ symbols, when C++11 or upper is compiled"
This reverts commit 322b97a19a.

GCC 5 vs. 8 seems to be a big deal in this regard. The approach needs
further consideration.
2018-10-18 23:36:46 +02:00
Anatol Belski 322b97a19a Use C++ symbols, when C++11 or upper is compiled 2018-10-18 23:17:48 +02:00
Dmitry Stogov a4b33f775e Added new line 2018-10-18 16:40:24 +03:00
Peter Kokot 370882bb59 Remove stamp-h
The stamp-* files can be used as helpers for Makefiles to not redo
certain targets again. The stamp-h are mentioned in the Autoconf docs [1]
to help generate the config.h file.

Since the usage of stamp-h file was removed in 232afa4816
this patch cleans few obsolete occurrences.

This patch also removes two occurrences of `main/stamp-h1` and
`main/streams/stamp-h1` rules in the .gitignore file since they are not
generated with the current build systems anymore. The `stamp-h$am_indx` files
were once generated using aclocal and automake.

[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-10-18 08:35:43 +02:00
Peter Kokot 0e60b812c0 Move all testing docs to qa.php.net
The qa.php.net currently includes nice collection of information about
tests and how to run them. Instead of maintaining two locations of this
information, this patch removes the README.TESTING from the php-src
repo. Patch for qa.php.net has been sent separately to that repo.
2018-10-18 08:01:22 +02:00
Tyson Andre 78a8b0f0d7 Fix a typo in UPGRADING.INTERNALS 2018-10-17 21:14:46 -04:00
Anatol Belski 7e6ad00cc9 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix test when it's run on another drive
2018-10-18 00:45:43 +02:00
Christoph M. Becker 0187eeb6e2 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update UPGRADING wrt. tidyp support
2018-10-17 23:45:34 +02:00
Dmitry Stogov a0a1c8990e Fixed incorrect reallocation 2018-10-17 17:44:03 +03:00
Christoph M. Becker f307e5962f Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77027: tidy::getOptDoc() not available on Windows
2018-10-17 16:38:17 +02:00
Nikita Popov 59cec6e67d Run CI tests under opcache.protect_memory=1 2018-10-17 16:10:47 +02:00
Dmitry Stogov b6ac50f9e6 Fixed comment 2018-10-17 16:56:32 +03:00
Dmitry Stogov 3575a2b8f9 Micro optimizations 2018-10-17 16:55:52 +03:00
Dmitry Stogov 9226695c22 Mark "top-level" classes 2018-10-17 16:12:46 +03:00
Dmitry Stogov d57cd36e47 Immutable clases and op_arrays.
Squashed commit of the following:

commit cd0c36c3f943849e5b97a8dbe2dd029fbeab3df9
Merge: 4740dabb84 ad6738e886
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:43:38 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove the "auto" encoding
      Fixed bug #77025
      Add vtbls for EUC-TW encoding

commit 4740dabb843c6d4f7f866b4a2456073c9eaf4c77
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:12:28 2018 +0300

    Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes.

commit ad7a78b253be970db70c2251e66f9297d8e7f829
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:46:30 2018 +0300

    Added comment

commit 0276ea51875bab37be01a4dc5e5a047c5698c571
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:42:43 2018 +0300

    Added type cast

commit c63fc5d5f19c58498108d1698055b2b442227eb3
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:36:51 2018 +0300

    Moved static class members initialization into the proper place.

commit b945548e9306b1826c881918858b5e5aa3eb3002
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:21:03 2018 +0300

    Removed redundand assertion

commit d5a41088401814c829847db212488f8aae39bcd2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:19:13 2018 +0300

    Removed duplicate code

commit 8dadca8864e66de70a24bdf1181bcf7dd8fb27d7
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:05:43 2018 +0300

    Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros.

commit 9ef07c88bd76801e2d4fbfeab3ebfd6e6a67ac5f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:48:29 2018 +0300

    typo

commit a06f0f3d3aba53e766046221ee44fb9720389ecc
Merge: 94099586ec 3412345ffe
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:47:07 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove unused variable makefile_am_files
      Classify object handlers are required/optional
      Add support for getting SKIP_TAGSTART and SKIP_WHITE options
      Remove some obsolete config_vars.mk occurrences
      Remove bsd_converted from .gitignore
      Remove configuration parser and scanners ignores
      Remove obsolete buildconf.stamp from .gitignore
      [ci skip] Add magicdata.patch exception to .gitignore
      Remove outdated ext/spl/examples items from .gitignore
      Remove unused test.inc in ext/iconv/tests

commit 94099586ec599117581ca01c15b1f6c5f749e23a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 15 23:34:01 2018 +0300

    Immutable clases and op_arrays
2018-10-17 15:52:50 +03:00
Nikita Popov ad6738e886 Merge branch 'PHP-7.3' 2018-10-17 12:51:17 +02:00
Nikita Popov e4ccc1a29f Merge branch 'PHP-7.3' 2018-10-17 12:40:39 +02:00
Peter Kokot 3412345ffe Remove unused variable makefile_am_files
The `makefile_am_files` was part of the previous build system where
automake was used to build Makefiles. Since 9d9d39a0de
this is not used anymore and can be removed.
2018-10-16 22:33:04 +02:00
Nikita Popov 1cfbb21790 Classify object handlers are required/optional 2018-10-16 20:53:59 +02:00
Christoph M. Becker fc0aa264c1 Merge branch 'PHP-7.3'
* PHP-7.3:
  Add support for getting SKIP_TAGSTART and SKIP_WHITE options
2018-10-16 18:51:51 +02:00
Peter Kokot 066b5b7881 Remove some obsolete config_vars.mk occurrences
The `config_vars.mk` file was a part of previous *nix build system and
has been removed via 9d9d39a0de.
2018-10-16 18:05:06 +02:00
Peter Kokot 4ac9ef4a00 Remove bsd_converted from .gitignore
The `bsd_converted` file was once used as a temporary locking mechanism
on BSD systems builds and has been made obsolete via commit
9d9d39a0de
so it can be also removed from the main .gitignore file.
2018-10-16 17:30:13 +02:00
Peter Kokot 265ee53b80 Remove configuration parser and scanners ignores
The configuration-parser.c, configuration-parser.h,
configuration-parser.output and configuration-scanner.c were refactored
via 78194a47b7 and can be removed in the
.gitignore.
2018-10-16 17:20:18 +02:00
Peter Kokot 0df202e7ae Remove obsolete buildconf.stamp from .gitignore
The buildconf.stamp file was used to store particular build time
information in the past and then got removed via the
6c6c0a630c
and the migration usage of the build/build.mk file only.
2018-10-16 13:33:07 +02:00
Peter Kokot c54d382b2e [ci skip] Add magicdata.patch exception to .gitignore 2018-10-16 11:04:39 +02:00
Peter Kokot 1df1792b9c Remove outdated ext/spl/examples items from .gitignore 2018-10-16 10:38:19 +02:00
Peter Kokot 787dfd0909 Remove unused test.inc in ext/iconv/tests 2018-10-15 17:57:22 +02:00
Peter Kokot 4f1274c59b Remove value from --CGI-- section
The `--CGI--` section takes no value and is enabled as empty already.
2018-10-15 07:13:53 +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 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 e84662c35c Merge branch 'PHP-7.3'
* PHP-7.3:
  Sync leading and final newlines in *.phpt sections
  Sync leading and final newlines in *.phpt sections
  Sync leading and final newlines in *.phpt sections
2018-10-15 04:32:49 +02:00
Anatol Belski a04cd4b948 Remove assignment irrelevant for release build 2018-10-14 21:35:57 +02:00
Peter Kokot d7a3edd45d Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +02:00
Peter Kokot b0708fa2e7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Trim trailing whitespace in *.phpt
  Trim trailing whitespace in *.phpt
  Trim trailing whitespace in *.phpt
2018-10-14 19:45:40 +02:00
Gabriel Caruso 9c144e0d82 Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
Peter Kokot b419732ddb Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix failing ext/session/tests due to final newlines
2018-10-14 13:41:32 +02: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 f87f7bb8c7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Sync leading and final newlines in source code files
  Sync leading and final newlines in source code files
  Sync leading and final newlines in source code files
2018-10-14 12:55:47 +02:00
Frank Denis d159d219e4 Merge branch 'PHP-7.3'
* PHP-7.3:
  ext/sodium: sodium_pad(): do not copy any bytes if the string is empty
  ext/sodium: Fix sodium_pad() with blocksize >= 256
  ext/sodium: Use a correct max output size for base64 decoding
  ext/sodium: Avoid shifts wider than 32 bits on size_t values
2018-10-14 11:03:37 +02:00
Peter Kokot 398e4cba7b Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix failing tests/lang due to whitespace
2018-10-13 15:23:56 +02:00
Peter Kokot a2e099c78d Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix failing ext/zlib/tests due to whitespace
2018-10-13 15:16:29 +02:00
Peter Kokot 37c329d715 Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
Peter Kokot 6c2c7dabee Merge branch 'PHP-7.3'
* PHP-7.3:
  Trim trailing whitespace in source code files
  Trim trailing whitespace in source code files
  Trim trailing whitespace in source code files
2018-10-13 14:16:48 +02:00
Christoph M. Becker 87392eff1a Require SQLite ≥ 3.5.0 for ext/sqlite3 and ext/pdo_sqlite
It is possible to pass flags when opening an SQLite database.  For
Sqlite < 3.5.0 these are ignored, since `sqlite3_open` doesn't support
flags.  Neither a warning or notice is raised in this case, nor is this
behavior documented in the PHP manual.  Instead of fixing it either
way, we lift the requirement to SQLite 3.5.0 (released on 2007-09-04)
instead of the former SQLite 3.3.9 (released on 2007-01-04).
2018-10-13 12:15:58 +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
Peter Kokot 272c629c0a Merge branch 'PHP-7.3'
* PHP-7.3:
  Convert CRLF line endings to LF
  Convert CRLF line endings to LF
  Convert CRLF line endings to LF
2018-10-13 11:23:32 +02:00
Derick Rethans a7c942efee Merge branch 'PHP-7.3' 2018-10-12 11:55:48 +01:00
Derick Rethans 3a93c201f6 Merge branch 'PHP-7.3' 2018-10-12 11:41:33 +01:00
Derick Rethans 83e24098a8 Merge branch 'PHP-7.3' 2018-10-11 17:00:49 +01: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
Sara Golemon da48671959 Update release process information to include the improved bumpRelease script 2018-10-11 10:00:21 -04:00
Nikita Popov 0697d83383 More straightforward count() on ArrayObject with object
Just writing this out as an explicit loop is both simpler and faster
than going through the entire positioning machinery.
2018-10-11 15:23:05 +02:00
Nikita Popov 5659035ab6 Remove unnecessary get_hash_table return value checks
An ArrayObject always has a valid backing hashtable, this function
can never return NULL.
2018-10-11 15:06:11 +02:00
Nikita Popov a27f772a46 Remove redundant HASH_OF in mail.c
And use ZEND_HASH_FOREACH_STR_KEY_VAL where the integer key is not
needed.
2018-10-11 13:04:08 +02:00
Nikita Popov 4ca5b35771 Use ARRAY_OR_OBJECT arg in http_build_query
Instead of checking the type manually. Peculiarily the zpp
message does not use "array or object", but that's a general issue.
And I guess it's good that object support is not being advertised.
2018-10-11 13:04:08 +02:00
Nikita Popov 900ee5705f Remove unnecessary HASH_OF uses in mbstring 2018-10-11 13:04:08 +02:00
Nikita Popov 2c7be42853 Drop unnecessary HASH_OF uses in ext/oci8
These only operate on arrays.
2018-10-11 13:04:08 +02:00
Nikita Popov bfaba83102 Remove HASH_OF uses in ext/filter
It turns out that all of these places ultimately only accept arrays,
not objects, so we can use Z_ARRVAL_P everywhere.

Also add _deref in a few places where the hash lookup result is
directly type-checked.
2018-10-11 13:04:08 +02:00
Peter Kokot 9bbf9967bd Modernize the AC_PRESERVE_HELP_ORDER macro call
The Autoconf AC_PRESERVE_HELP_ORDER macro has been available since
Autoconf 2.59c [1] and in PHP it has been called conditionally on two places
to support older Autoconf versions. With recent updates and the macro
can be called unconditionally.

[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
2018-10-11 12:58:41 +02:00
Nikita Popov a710ceee62 Remove leftover code dealing with curl wrappers 2018-10-11 12:12:31 +02:00
Nikita Popov 32d7e08286 Remove some redundant uses of HASH_OF
GET etc are always arrays, they cannot be objects. We just need to
check that they are initialized.
2018-10-11 12:01:18 +02:00
Nikita Popov a8bc3889fd Remember redundant check in filter.c
We already check existence through zend_hash_str_find, no need
to check it twice.
2018-10-11 11:55:16 +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
Nikita Popov 76c8d79df6 Merge branch 'PHP-7.3' 2018-10-10 15:00:56 +02:00
Nikita Popov 4f4d0eccaf Specify timezone in test 2018-10-10 13:28:06 +02:00
Nikita Popov 5a679341b8 Add UPGRADING notes
[ci skip]
2018-10-10 12:00:57 +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 1270e5008a Migrate ext/date to get_properties_for where appropriate
This resolves the long-standing issue where var_dump
a DateTime (etc) object makes a number of additional properties
accessible, which may also change other behaviors as a side-effect.
2018-10-10 10:39:10 +02:00
Nikita Popov 7ec8087f80 Introduce get_properties_for() handler
This handler allows getting the object properties for a particular
purpose, such as array casting, serialization, etc.
2018-10-10 10:39:10 +02:00
Peter Kokot 77c85b3119 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update UPGRADING about Autoconf version
  Bump minimum Autoconf requirement to 2.68
2018-10-09 21:17:19 +02:00
Christoph M. Becker f2856da6e8 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #30875: xml_parse_into_struct() does not resolve entities
2018-10-09 16:09:46 +02:00
Christoph M. Becker 6b015e51ad Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
2018-10-09 13:31:38 +02:00
Derick Rethans d21aa93dd4 Merge branch 'PHP-7.3' 2018-10-09 11:38:01 +01:00
Derick Rethans 0ef3b125cd Merge branch 'PHP-7.3' 2018-10-09 11:08:48 +01:00
Derick Rethans d16e23d8c9 Merge branch 'PHP-7.3' 2018-10-09 11:07:15 +01:00
Derick Rethans bb2eaa6d61 Added test case for bug #75577 2018-10-09 11:06:58 +01:00
Derick Rethans 43f7a5735c Fixed bug #75577: DateTime::createFromFormat does not accept 'v' format specifier, by updating timelib to 2018.01alpha2 2018-10-09 11:06:42 +01:00
Christoph M. Becker 5527c74c53 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS wrt. php-7.3.0RC3 tagging
2018-10-09 11:59:09 +02:00
Pierrick Charron 9b4594515a Merge branch 'PHP-7.3' 2018-10-09 01:27:39 -04:00
Dmitry Stogov ca7ccd01e4 During size calculation, pointer should be kept unchanged 2018-10-08 23:52:24 +03:00
Anatol Belski 8a5ababea2 Add missing packaging entries 2018-10-08 18:42:09 +02:00
Pierrick Charron c4983b179d Merge branch 'PHP-7.3' 2018-10-08 10:21:03 -04:00
Nikita Popov 01cc547f44 Merge branch 'PHP-7.3' 2018-10-08 13:16:54 +02:00
Christoph M. Becker b0e1b43c6c Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Note the required configure changes for bundled libzip
2018-10-08 12:48:46 +02:00
Christoph M. Becker c266a19094 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76954: apache_response_headers removes last character from header name
2018-10-08 12:33:32 +02:00
Christoph M. Becker a80456e7dd Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #75851: Year component overflow with date formats "c", "o", "r" and "y"
2018-10-08 11:53:24 +02:00
Peter Kokot c2cbf37235 Update and refactor shmop extension's README
The shmop functions are documented with more information in the PHP
manual.
2018-10-08 06:27:17 +02:00
Anatol Belski 4acc8500ac Enforce C++11 in ext/intl
ICU 59 already requires C++11 by default. The minimum version required
by the core is 50, which is compiled with at least C++11 in many distros
as package defs tell. Headers for ICU versions between ICU 50 and 58 look
fine when included for C++11 compilation, the linking is thereof not affected.

The macro PHP_CXX_COMPILE_STDCXX is based on
https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
The patch consists on allowing to read the corresponding switch in a user
defined variable instead of enforcing CXXFLAGS globally. That way, every
ext or SAPI can decide, which C++ standard is to be used. The
documentation is provided in the m4 file.

C++11 is already somewhat older standard, C++14 were better. However
issues with GCC < 5.0 and some other compilers are possibly to hit back.
Still there's some time to check for C++14 for ext/intl, too. Having said
that, C++11 in ext/intl and a mechanism to determine features is a good step
towards better C++ support.
2018-10-07 20:00:03 +02:00
Bob Weinand dcdf1ccf68 Initialize ce->parent_name to NULL 2018-10-07 11:21:48 +02:00
bugreportuser cdedc1cb89 mysqli_fork: Fix undefined variable 2018-10-06 14:38:10 -03:00
Pedro Magalhães d87fdd9a96 Merge branch 'PHP-7.3'
* PHP-7.3:
  Remove unstable dns tests
2018-10-06 15:59:05 +01:00
Pedro Magalhães 418e2264dc Merge branch 'PHP-8.3'
* PHP-7.3:
  Fix #76888 - Remove unstable test
2018-10-06 15:46:30 +01:00
Pedro Magalhães 7862d9c942 Use the locally defined constants for dns record types 2018-10-06 14:58:11 +01:00
Christoph M. Becker 849a896a5e [ci skip] Update NEWS and UPGRADING wrt. unbundling libsqlite 2018-10-06 12:45:06 +02:00
Christoph M. Becker 6083a387a8 Unbundle libsqlite3
Since there is no need to patch libsqlite3 for our purposes, and since
libsqlite3 ≥ 3.3.9 (which is our current requirement) is widely
available on distros, there is no reason anymore to bundle the library.

Besides removing the bundled libsqlite, and adapting the configuration
respectively, we also fix the use of the SQLITE_ENABLE_COLUMN_METADATA
compile time constant to detect whether sqlite3_column_table_name() is
available by a working feature detection (otherwise bug_42589.phpt
would fail).  We also skip bug73068.phpt for libsqlite 3.11.0 to
3.14.1 which have a bug (<https://sqlite.org/src/info/ef360601>).

We also completely drop support for the obscure pdo_sqlite_external
extension (which could have been enabled on Windows only by passing
`--pdo-sqlite-external` to configure), since it is not needed anymore.

Furthermore, we remove references to the bundled libsqlite from
Makefile.gcov, CONTRIBUTING.md and README.REDIST.BINS.
2018-10-06 12:36:55 +02:00
Christoph M. Becker 61330b0faf Fix PHPT ENV sections
run-tests.php assumes the contents of an ENV section are a simple list
of key-value-pairs, instead of evaluating the section contents as PHP
script which server-tests.php did.  Since server-tests.php is gone, we
remove the superfluous and confusing scripting.
2018-10-06 12:29:04 +02:00
Nikita Popov e25b23ed0c Merge branch 'PHP-7.3' 2018-10-06 11:22:24 +02:00
Christoph M. Becker 788d217e09 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76975: preg_match difference between 7.3 and < 7.3 - II
2018-10-06 11:06:59 +02:00
Anatol Belski 5ea78adc56 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  Add test for bug #76942
2018-10-05 23:01:20 +02:00
Anatol Belski a0e7152f9b Merge branch 'PHP-7.3'
* PHP-7.3:
  Add test for bug #76942
  Fixed Bug #76942 U_ARGUMENT_TYPE_MISMATCH
2018-10-05 22:54:03 +02:00
Nikita Popov cb0505d1c5 Merge branch 'PHP-7.3' 2018-10-05 21:34:04 +02:00
Nikita Popov 3169e25a3c Merge branch 'PHP-7.3' 2018-10-05 18:42:45 +02:00
Pedro Magalhães 7b10e71b9d Use the locally defined constants for dns record types 2018-10-05 16:38:06 +01:00
Pedro Magalhães c2c202193a Use HT_MIN_SIZE when duplicating an empty array 2018-10-05 12:14:42 +02:00
Nikita Popov a515f60790 Remove unused backpatch_count field 2018-10-05 12:14:42 +02:00
Anatol Belski 40979277c0 Ensure target is \0 terminated 2018-10-04 19:17:58 +02:00
Nikita Popov f48ee1ff58 Clarify that the get_properties handler is required
Some places were checking for non-null get_properties, some weren't.
Make it clear that the handler is required and such checks are not
necessary.
2018-10-04 12:46:50 +02:00
Nikita Popov 74d138e4a3 Fix incorrect printf modifier after size_t changes 2018-10-04 12:13:46 +02:00
Remi Collet 1ac97c77cb Merge branch 'PHP-7.3'
* PHP-7.3:
  Allow to disable pcre.jit when system library is used as it is for now broken on some arch (s390x...)
2018-10-04 11:46:37 +02:00
Pierrick Charron 69d31f167c Merge branch 'PHP-7.3' 2018-10-03 21:19:05 -04:00
Pierrick Charron e450679dcd Merge branch 'PHP-7.3' 2018-10-03 19:44:46 -04:00
Christoph M. Becker 0489b865bf Fix PRIMARY MAINTAINER and MAINTENANCE fields
We have to distinguish between `PRIMARY_MAINTAINER` and `MAINTENANCE`.
Furthermore, all extensions should have both fields.
2018-10-04 00:47:52 +02:00
Christoph M. Becker 60f284c8c6 Merge branch 'PHP-7.3'
* PHP-7.3:
  libzip has been unbundled in master only
2018-10-04 00:30:40 +02:00
Anatol Belski 248c857a31 Reuse delivered length
Fix length calculation
2018-10-03 23:12:49 +02:00
Anatol Belski 14628f1c5d Add compatibility bit
readlink in PHP doesn't error on regular files.
2018-10-03 21:17:52 +02:00
Dmitry Stogov 2ebac3263b Removed wrong reference counting 2018-10-03 20:15:30 +03:00
Anatol Belski 969fdb717a Update UPGRADING [ci skip] 2018-10-03 19:11:31 +02:00
Anatol Belski 91c905e83c Refactor php_sys_readlink
Also move the implementation into win32 where it belongs
2018-10-03 18:56:55 +02:00
Anatol Belski 97481fccb9 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS [ci skip]
2018-10-03 18:54:47 +02:00
Anatol Belski cd441e2131 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS [ci skip]
  Update NEWS [ci skip]
  Update NEWS [ci skip]
2018-10-03 18:52:21 +02:00
Dmitry Stogov 60591328f8 More careful handling of function prototypes 2018-10-03 18:32:25 +03:00
Dmitry Stogov ba3d0a845a Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Avoid code duplication and don't miss env restore
2018-10-03 17:43:08 +03:00
Anatol Belski 1c11fc7f13 Merge branch 'PHP-7.3'
* PHP-7.3:
  Avoid code duplication and don't miss env restore
2018-10-03 14:36:09 +02:00
Dmitry Stogov ed5fb80c31 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Hopefully last round of size_t fixes, this makes the remaining php_hash_ops use size_t over an int
2018-10-03 15:01:53 +03:00
Kalle Sommer Nielsen d604f65de5 Merge branch 'master' of git.php.net:/php-src 2018-10-03 13:36:30 +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
Dmitry Stogov b9e485a7fd typo 2018-10-03 14:35:36 +03:00
Remi Collet 4778578b56 Merge branch 'PHP-7.3'
* PHP-7.3:
  bump zip extension version
2018-10-03 12:59:46 +02:00
Anatol Belski 3ad2ab6e7d Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76948 Failed shutdown/reboot or end session in Windows
2018-10-03 12:15:54 +02:00
Kalle Sommer Nielsen b1f6390f16 Merge branch 'master' of git.php.net:/php-src 2018-10-03 11:36:30 +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
Dmitry Stogov afcc785399 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  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
  Write to correct smart_str
  Revert "Fix compiler warnings in ext/hash"
2018-10-03 12:33:36 +03:00
Kalle Sommer Nielsen 0d7d2a2011 Merge branch 'master' of git.php.net:/php-src 2018-10-03 11:33:15 +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
Dmitry Stogov c88b53318f Avoid method compatibility check with itself 2018-10-03 12:32:33 +03:00
Dmitry Stogov 9418144054 Added assertions 2018-10-03 12:31:47 +03:00
Nikita Popov 1e14b7a369 Write to correct smart_str
Mixed this up during the migration to ZEND_HASH_FOREACH.
2018-10-03 11:03:55 +02:00
Nikita Popov a659d16adf Merge branch 'PHP-7.3' 2018-10-03 10:50:38 +02:00
Nikita Popov ac96a57818 Remove uses of apply_with_arguments API in reflection
Instead of ZEND_HASH_FOREACH. As a side-effect, this fixes a latent
bug in _addmethod, where a zval was interpreted as a zval*.

Also apply some optimizations to getProperties() while at it: For
declared properties, use the HT key instead of unmangling the
property name. For dynamic properties check INDIRECT instead of
looking up prop info to determine if the property is dynamic.
2018-10-03 10:37:42 +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
Anatol Belski 3e2549d74f Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76947 file_put_contents() blocks the directory of the file (__DIR__)
2018-10-03 00:22:34 +02:00
Nikita Popov 10b1ab9275 Some reflection cleanups
Use zend_string and zend_string_tolower in more places, clean up
__invoke handling slightly.
2018-10-02 23:14:13 +02:00
Nikita Popov 784579d99a Merge branch 'PHP-7.3' 2018-10-02 18:20:30 +02:00
Nikita Popov c8188fdd3b Merge branch 'PHP-7.3' 2018-10-02 17:49:08 +02:00
Nikita Popov aec6421409 Merge branch 'PHP-7.3' 2018-10-02 16:14:36 +02:00
Dmitry Stogov 9bfb972413 typo 2018-10-02 15:38:55 +03:00
Dmitry Stogov f521586814 Make ZEND_ACC_IMMUTABLE and ZEND_ACC_HAS_TYPE_HINTS to be common (for functions and classes) 2018-10-02 09:51:06 +03:00
Dmitry Stogov 2606566269 Rename ZEND_ACC_NO_RT_ARENA into ZEND_ACC_HEAP_RT_CACHE and use it for pseudo-main op_arrays. 2018-10-02 09:10:04 +03:00
Dmitry Stogov a2e8334613 Allocate only necessary space for static properties of internal classes in ZTS mode. 2018-10-01 19:05:31 +03:00
Dmitry Stogov 250b577258 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Bump phpdbg version to PHP_VERSION
2018-10-01 14:11:31 +03:00
Dmitry Stogov 34a491d1ed Turn accel_activate into module callback. 2018-10-01 14:10:54 +03:00
Peter Kokot a3760badbe Bump phpdbg version to PHP_VERSION
The phpdbg sapi module is distributed with the release cycle of PHP.
This patch simplifes phpdbg versioning and bumps it to the PHP_VERSION.
2018-10-01 13:01:58 +02:00
Dmitry Stogov c25e7439ae Get rid of accel_deactivate() calback 2018-10-01 13:53:15 +03:00
Dmitry Stogov 2d87b51ae9 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src: (29 commits)
  Fix the deplister rule to not ignore the .c file (Anatol)
  Update .gitignore to include the Windows deplister program (win32/build/deplister.c)
  Bug > Feature Request
  NEWS and UPGRADING
  Fixed bug #75479
  Fix test
  Fix some tests and improve coverage for Windows in SPL
  Use already set variable
  Fix reflection arguments for sodium_memzero function
  Deprecate unbinding of $this of non-static methods
  Generalize compile_typename
  Fixed bug #76737
  Fixed bug #72635
  Remove and refactor ext/spl/examples
  Remove outdated soap examples
  Remove unused ext/bz2/php_bz2.def
  Remove redundant ce from reflection property_reference
  Only store zend_type inside reflection type_reference
  Fixed bug #76946
  Bump versions for 7.1.24-dev
  ...
2018-10-01 11:19:36 +03:00
Kalle Sommer Nielsen 4fc5833b3e Fix the deplister rule to not ignore the .c file (Anatol) 2018-10-01 08:31:49 +02:00
Kalle Sommer Nielsen a698dcd24a Update .gitignore to include the Windows deplister program (win32/build/deplister.c) 2018-10-01 07:54:52 +02:00
Kalle Sommer Nielsen e23a9d6a5c Bug > Feature Request 2018-10-01 07:52:22 +02:00
Remi Collet 3d5fe90e7e NEWS and UPGRADING 2018-10-01 07:24:04 +02:00
Remi Collet 959e640e6d Fixed bug #76908 PDO_OCI getColumnMeta() not implemented
* Letargie-feature-getcolumnmeta:
  Removing last unused
  Last few changes : 	. force the nls_date_format 	. add the scale to the return of the function 	. add tests on some function return 	. removing unused variables
  cs
  Changes : . Add the distinction between NUMBER and FLOAT types . Changing BFLOAT text to be BINARY_FLOAT . Changing BDOUBLE text to be BINARY_DOUBLE . Add the data types names for NCHAR, NVARCHAR and NCLOB . Few changes in the tests
  fixing comments
  Update oci_statement.c
  Add the PDOStatement::getColumnMeta() function to the pdo_oci driver
2018-10-01 07:18:20 +02:00
Remi Collet 0ae5f82135 Fixed bug #76908 PDO_OCI getColumnMeta() not implemented
Merge branch 'feature-getcolumnmeta' of https://github.com/Letargie/php-src into Letargie-feature-getcolumnmeta

* 'feature-getcolumnmeta' of https://github.com/Letargie/php-src:
  Removing last unused
  Last few changes : 	. force the nls_date_format 	. add the scale to the return of the function 	. add tests on some function return 	. removing unused variables
  cs
  Changes : . Add the distinction between NUMBER and FLOAT types . Changing BFLOAT text to be BINARY_FLOAT . Changing BDOUBLE text to be BINARY_DOUBLE . Add the data types names for NCHAR, NVARCHAR and NCLOB . Few changes in the tests
  fixing comments
  Update oci_statement.c
  Add the PDOStatement::getColumnMeta() function to the pdo_oci driver
2018-10-01 07:16:48 +02:00
Nikita Popov eab939e1e3 Merge branch 'PHP-7.3' 2018-09-30 20:08: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
Gabriel Caruso 257bec33f8 Use already set variable 2018-09-30 02:01:10 -03:00
Nikita Popov 03ba053af0 Merge branch 'PHP-7.3' 2018-09-29 21:20:08 +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 c4cb3250ca Generalize compile_typename
Return zend_type instead of assigning to arg_info. Also move
nullable handling into the function.
2018-09-29 18:53:48 +02:00
Nikita Popov 96da1fe8a9 Fixed bug #76737
Explicitly prohibit serialization and unserialization of reflection
objects.
2018-09-29 14:47:57 +02:00
Nikita Popov 2ae2e820be Merge branch 'PHP-7.3' 2018-09-29 14:23:13 +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 ab60b79912 Remove outdated soap examples
This patch removes PHP soap extension examples in favor of the PHP
manual.
2018-09-29 09:26:29 +02:00
Peter Kokot 61536b9d64 Remove unused ext/bz2/php_bz2.def
Exporting symbols has been added via
a7ba08a0bd and then removed via
d5c6825241
2018-09-29 09:23:31 +02:00
Nikita Popov 36a4f58ab9 Remove redundant ce from reflection property_reference
The ce is already stored in the main reflection object, no need to
store it twice.
2018-09-28 23:16:10 +02:00
Nikita Popov 570f9f6281 Only store zend_type inside reflection type_reference
We don't need the full arg_info and the baggage associated with it.
Storing the type should be safe, as it's part of structures which
are never released during a request (arg_info and in the future
prop_info).
2018-09-28 22:27:14 +02:00
Nikita Popov 7ef42ec359 Merge branch 'PHP-7.3' 2018-09-28 19:18:01 +02:00
Sara Golemon 8371159790 Merge branch 'PHP-7.3'
* PHP-7.3:
  Bump versions for 7.1.24-dev
2018-09-28 11:33:12 -04:00
Nikita Popov 65abbdad70 Merge branch 'PHP-7.3' 2018-09-28 13:41:36 +02:00
Nikita Popov 136aa37681 Merge branch 'PHP-7.3' 2018-09-28 12:59:17 +02:00
Dmitry Stogov 9d47cb4593 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fix missing access errors for guarded properties
2018-09-27 23:50:04 +03: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
Dmitry Stogov c1706980c0 Remove dead code (only IS_ARRAY may relive zendi_convert_scalar_to_number()), and micro-optimization. 2018-09-27 13:11:48 +03:00
Peter Kokot 390b74ee34 Rename ext/snmp/tests/bigtest.sh to bigtest
This can avoid some confusions with .gitignored autogenerated `.sh`
files in test directories and to distinguish the autogenerated shell
files from the tracked in Git ones more easily.
2018-09-27 02:41:54 +02:00
Peter Kokot 6b324bf845 [ci skip] Sync licenses
- ext/zip/lib has been unbundled
- ext/phar/zip.c added instead
- renumbered and ordered a bit
2018-09-26 23:40:43 +02:00
Peter Kokot a4102e1bc3 Remove unused and untouched ext/libmbfl/tests files
Test files of the forked and bundled libmbfl library aren't utilized
in php-src. Instead, the current approach is to use the phpt tests.
2018-09-26 23:08:04 +02:00
Dmitry Stogov 3a3840a847 Avoid useless store and checks in xlat_table. 2018-09-26 17:05:49 +03:00
Letargie ac842c7ecd Removing last unused 2018-09-26 13:40:41 +02:00
Letargie 478f3d57e6 Last few changes :
. force the nls_date_format
	. add the scale to the return of the function
	. add tests on some function return
	. removing unused variables
2018-09-26 13:19:29 +02:00
Peter Kokot 41ac1d492c [ci skip] Mention php_pdo_mysql_sqlstate.h in the contributing info 2018-09-26 13:07:36 +02:00
Peter Kokot 8c28985cae Remove outdated ext/ctype/ctpye.xml reference document
The ctype.xml file has been added with the early ctype extension
implementation and hasn't been updated with the recent changes. Also
file is not used anymore.
2018-09-26 12:57:54 +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 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
Letargie f185ab7daf Merge branch 'master' of https://github.com/php/php-src into feature-getcolumnmeta 2018-09-26 11:41:50 +02:00
Peter Kokot ab1ce6058a Make ext/session/mod_files.sh executable
Making shell script executable makes it possible to run like
`ext/session/mod_files.sh` and avoids error permission denied.
2018-09-26 06:11:13 +02:00
Peter Kokot e3293ad35d Remove unused ext/exif/tests/test6.jpg
Added via 569c69ba36 and then removed via
fb5da94c1b
2018-09-25 22:50:17 +02:00
Sara Golemon 70f3504ae0 Merge branch 'PHP-7.3'
* PHP-7.3:
  Bump version
2018-09-25 16:44:16 -04:00
Peter Kokot 981e5e17fa Remove unused ext/enchant/tests files
- ext/enchant/tests/hindi_correct.txt
- ext/enchant/tests/hindi_incorrect.txt

Added via 5956f9a398 but never used.
2018-09-25 22:30:22 +02:00
Nikita Popov 74ade095db Remove unused "dummy" member in reflection_object 2018-09-25 21:47:16 +02:00
Nikita Popov 45bb95c036 Reformat macros in php_reflection.c 2018-09-25 21:47:14 +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
Dmitry Stogov 5edaa6f947 Removed unused function 2018-09-25 15:44:56 +03:00
Christoph M. Becker 368ca8e090 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS wrt. php-7.3.0RC2 tagging
2018-09-25 11:29:50 +02:00
Christopher Jones 029a8c9882 Merge branch 'PHP-7.3' 2018-09-24 20:53:42 +10:00
Christopher Jones 54b8dab8fe Merge branch 'PHP-7.3' 2018-09-24 20:14:16 +10:00
Christopher Jones 45f9849207 Merge branch 'PHP-7.3' 2018-09-24 17:07:12 +10:00
Christopher Jones eb77030e1f Merge branch 'PHP-7.3' 2018-09-24 17:03:09 +10:00
Christopher Jones db1d7a9871 Merge branch 'PHP-7.3' 2018-09-24 16:52:40 +10:00
Christopher Jones c86e19a31d Merge branch 'PHP-7.3' 2018-09-24 16:41:48 +10:00
Christopher Jones 6af467e08e Merge branch 'PHP-7.3' 2018-09-24 16:02:31 +10:00
Christopher Jones cdb9dd1938 Merge branch 'PHP-7.3' 2018-09-24 13:34:28 +10:00
Christopher Jones 3bbb0c3887 Merge branch 'PHP-7.3' 2018-09-24 09:57:37 +10:00
Peter Kokot 50b4b63cc6 Remove outdated zlib readme file for windows build 2018-09-23 22:52:23 +02:00
Peter Kokot f116484cf1 Rename *.php files in ext/dom 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:22:55 +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
Peter Kokot 9e5853b699 Sync ext/spl/README with current set of example files 2018-09-23 16:46:58 +02:00
Nikita Popov 74235ca5f3 Bump minimum libxml version to 2.7.6
Released Oct 2009, part of RHEL 6.
2018-09-23 15:51:09 +02:00
Nikita Popov c5f108c66c Handle binary_op failure in overloaded assigns 2018-09-23 15:29:25 +02:00
bugreportuser 59d99a2c47 Remove unnecessary base64_encode() return value check
php_base64_encode() never returns NULL, so base64_encode() will never return
false.
2018-09-23 14:49:10 +02:00
Anatol Belski e8538b9f27 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
2018-09-23 11:42:41 +02:00
Nikita Popov 152dc924c5 Drop WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF
And perform some code cleanups this allows.
2018-09-22 18:53:32 +02:00
Nikita Popov e188d2fe0e Remove duplicate test file
This is already tested in Zend/tests/bug63463.phpt.
2018-09-22 17:46:54 +02:00
Nikita Popov 9faff4f783 Drop ext/spl/spl.php
Leftover from ext/spl/internal, which was removed previously.
2018-09-22 17:46:54 +02:00
Christoph M. Becker 7022f3a34f Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #66828: iconv_mime_encode Q-encoding longer than it should be
2018-09-22 15:57:28 +02:00
Anatol Belski 5e1c3d62f9 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix test and add skip section
2018-09-22 02:11:06 +02:00
Anatol Belski a2c843780e [ci skip] Update UPGRADING.INTERNALS 2018-09-22 02:05:28 +02:00
Peter Kokot 5da3ed69a6 Rename *.p5c files to *.inc
When including files in PHP tests a good practice so far has been to use
the *.inc extension. This patch renames few *.p5c files that are
included in phpt files.
2018-09-21 23:21:14 +02:00
Peter Kokot 949becb166 Add directory structure to the contributing docs
This patch adds a php-src directory structure introduction to the
contributing guidelines. Thanks to the discussion at [1] and PHP
manual.

[1] https://github.com/php/php-src/pull/3520
2018-09-21 17:42:21 +02:00
Anatol Belski 4ec7463df6 Merge branch 'PHP-7.3'
* PHP-7.3:
  Add test for bug #76909
  Fixed bug #76909 preg_match difference between 7.3 and < 7.3
  Upgrade PCRE2 to 10.32
2018-09-21 15:58:50 +02:00
Christoph M. Becker 7b9b398daa Update NEWS and UPGRADING wrt. PR 2760 2018-09-21 15:15:40 +02:00
Christoph M. Becker 759e066938 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix
  Fix
2018-09-21 15:06:35 +02:00
Peter Kokot bfa2c7158f Fix permissions
Certain files don't need to be executables.
2018-09-21 14:12:25 +02:00
Peter Kokot a1b5698d4e Remove HAVE_TIME_H
The `<time.h>` header file is part of the standard C89 headers [1] and
on current systems can be included unconditionally.

Since PHP requires at least C89 or greater, the `HAVE_TIME_H` symbol
defined by Autoconf in ext/pdo_sqlite/config.m4 [2] can be ommitted and
simplifed.

Additionally, since PHP didn't define `HAVE_TIME_H` prior in the
configure.ac the occurrence of this symbol in cli can be removed.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2018-09-21 14:10:30 +02:00
Letargie 19e64db933 cs 2018-09-21 13:35:45 +02:00
Letargie 957ed3c622 Merge branch 'feature-getcolumnmeta' of https://github.com/Letargie/php-src into feature-getcolumnmeta 2018-09-21 13:27:11 +02:00
Letargie 5dedf15d2d Changes :
. Add the distinction between NUMBER and FLOAT types
. Changing BFLOAT text to be BINARY_FLOAT
. Changing BDOUBLE text to be BINARY_DOUBLE
. Add the data types names for NCHAR, NVARCHAR and NCLOB
. Few changes in the tests

Also, my commit is correcting a bug in  the function oci_stmt_describe. PDO override the values given for the precision using the content of the pdo_column_data property 'precision'.
That value was set in oci_stmt_describe but with the value of OCI_ATTR_SCALE, causing a bug for the precision value returned by getColumnMeta() (values between 12800 and 14000 probably due to the conversion of a sb1 to a zend_ulong)
2018-09-21 13:16:54 +02:00
Valentin Collet b9944452b7 fixing comments 2018-09-20 15:13:36 +02:00
Valentin Collet 61ae69e062 Update oci_statement.c 2018-09-20 12:17:06 +02:00
Letargie d25d9276ff Add the PDOStatement::getColumnMeta() function to the pdo_oci driver 2018-09-20 12:03:57 +02:00
Dmitry Stogov c1b649d448 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76711 (OPcache enabled triggers false-positive "Illegal string offset")
2018-09-20 12:34:31 +03:00
Christoph M. Becker fe3ec212dc Update to SQLite 3.25.1 2018-09-19 20:01:04 +02:00
Dmitry Stogov a5208c393d Use macro 2018-09-19 18:09:32 +03:00
Dmitry Stogov f5e1868601 Improved hash copying 2018-09-19 17:53:10 +03:00
Dmitry Stogov 27b9fac19c Drop unused variable 2018-09-19 14:43:17 +03:00
Dmitry Stogov 27b0fecd2e Turn zend_hash_exists() into inline function 2018-09-19 13:55:53 +03:00
Dmitry Stogov 6beaa9fa5b Use zend_hash_find() instead of zend_hash_exists() 2018-09-19 13:55:27 +03:00
Dmitry Stogov 2a54867f7e Micro-optimization 2018-09-19 13:54:37 +03:00
Dmitry Stogov 0df57480b6 Remove zend_hash_exists() 2018-09-19 13:54:02 +03:00
Nikita Popov e6a09f39b8 Merge branch 'PHP-7.3' 2018-09-19 12:32:03 +02:00
Dmitry Stogov ef00e7e547 Remove zend_hash_exists() 2018-09-19 12:22:58 +03:00
Dmitry Stogov b137441f0e Improve ZEND_VM_SMART_BRANCH() 2018-09-19 11:47:02 +03:00
Nikita Popov 10a1cfd17e Merge branch 'PHP-7.3' 2018-09-19 09:40:12 +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
Nikita Popov cdde07d059 Merge branch 'PHP-7.3' 2018-09-18 20:51:50 +02:00
Dmitry Stogov b634ded197 Class constants and default property values can't be IS_REFERENCE anymore. 2018-09-18 18:46:10 +03:00
Dmitry Stogov 2df91cb519 Fixed crashes in ZTS build introduced by 689c6fb188 2018-09-18 16:49:58 +03:00
Anatol Belski d918e0776b Upgrade PCRE2 to 10.32 2018-09-18 14:16:52 +02:00
Nikita Popov 4f36acb9e6 Remove server-tests.php
As far as I know server-tests.php is unmaintained and no longer
used for anything nowadays. Some of the new sections are supported
by run-tests.php itself nowadays and some server-based tests
(using the CLI server or php-fpm) are performed through different
means.

Dropping server-tests.php has been discussed in a bunch of PR
discussions already, so let's go ahead with it...
2018-09-18 13:10:44 +02:00
Nikita Popov e947bcaf39 Simplify buffer management in php_intl_idn_to_46()
Instead of manually tracking how/whether the buffer is used, make
use of the string refcount.
2018-09-18 12:46:30 +02:00
Nikita Popov 208f5b0941 Merge branch 'PHP-7.3' 2018-09-18 12:39:13 +02:00
Nikita Popov 1a55c3607d Drop --without-libzip option from Travis
We need to build against the system libzip now.

Also add an UPGRADING note.
2018-09-18 12:16:55 +02:00
Nikita Popov 4e23dffe04 Remove bundled libzip 2018-09-18 12:13:43 +02:00
Remi Collet c099be4b5a drop support for bundled libzip (linux) 2018-09-18 12:13:43 +02:00
Nikita Popov a7b8131606 Drop unused variable 2018-09-18 12:12:36 +02:00
Nikita Popov c625150b02 Remove legacy add_*_unset() macros
These have been superseded by add_*_null().
2018-09-18 12:12:36 +02:00
Nikita Popov 5cf2045b0a Remove add_method() macro
Which uses add_assoc_function(), which doesn't exist anymore...
2018-09-18 12:12:36 +02:00
Anatol Belski e794bde35d Merge branch 'PHp-7.3'
* PHp-7.3:
  Add spectre switch for suitable vc14 versions
2018-09-18 10:47:34 +02:00
Dmitry Stogov 689c6fb188 Replace ZEND_ACC_ANON_BOUND, ZEND_ACC_UNRESOLVED_PARENT and ZEND_ACC_UNRESOLVED_INTERFACES with single ZEND_ACC_LINKED. 2018-09-18 11:41:40 +03:00
Peter Kokot b189c2432a Remove HAVE_STDARG_H
The C89 standard and later defines the `<stdarg.h>` header as part of
the standard headers [1]. On current systems it is always present and
can be included unconditionally.

Checking for presence and functionality of the `<stdarg.h>` header and
variadic function is not relevant anymore on current systems since this
is always available.

Also Autoconf suggests relying on at least C89 or above [2] and [3].

The following files were regenerated with re2c 1.0.3:
- Zend/zend_language_scanner.c
- Zend/zend_language_scanner_defs.h

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-18 05:44:56 +02:00
Peter Kokot d3ca28f569 Remove HAVE_STRING_H
The C89 standard and later defines the `<string.h>` header as part of
the standard headers [1] and on current systems it is always present.

Code included also `<strings.h>` header as an alterinative in some
files. This kind of check was relevant on some older systems where the
`<strings.h>` file included definitions for the C89 compliant
`<string.h>`. Today such alternative check is not required anymore. The
`<strings.h>` file is part of the POSIX definition these days.

Also Autoconf suggests doing this and relying on C89 or above [2] and [3].

This patch also cleans few unused `<strings.h>` inclusions in the libmbfl.

[1]: https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2]: http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3]: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-18 05:32:08 +02:00
Peter Kokot cfe46a5d79 Fix config.guess and config.sub files in .gitignore
Files `config.guess` and `config.sub` are committed in the php-src
repository so these don't need to be ignored for the root directory.
For the extensions these can be ignored in case of building extension
inside the php-src with phpize.
2018-09-18 05:21:19 +02:00
Pierrick Charron 8ea6ee7fb2 Merge branch 'PHP-7.3' 2018-09-17 20:31:36 -04: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
Nikita Popov 02664aee5c Remove ZEND_EARLY_BINDING_* constants
It seems like these were never actually used.
2018-09-17 20:59:16 +02:00
Nikita Popov a79e5f705c Remove ZEND_OBJECTS_STORE_HANDLERS macro
Object store handlers are no longer a thing since PHP 7.
2018-09-17 20:59:16 +02:00
Nikita Popov 3c8e5432b0 Remove unused ZEND_CT and ZEND_RT constants 2018-09-17 20:59:16 +02:00
Nikita Popov 415cb20dc1 Remove unused HAVE_BROKEN_GLIBC_FOPEN_APPEND
This has not been used since PHP 5.0.
2018-09-17 20:59:16 +02:00
Dmitry Stogov 62338a2385 Use different loop terminating conditions 2018-09-17 20:39:28 +03:00
Dmitry Stogov 1154f6f70a Merge branch 'PHP-7.3'
* PHP-7.3:
  Allow switching back to Zend MM heap.
2018-09-17 20:21:05 +03:00
Nikita Popov ac03b15e3c Remove __USE_GNU defines
This is an internal glibc macro, it should not be necessary to use
it if we already define _GNU_SOURCE (we do through
AC_USE_SYSTEM_EXTENSIONS). Needing to use __USE_GNU generally
indicates an inclusion order problem (libc header included before
config.h).
2018-09-17 17:51:00 +02:00
Nikita Popov 819ae353a7 Don't export anything in php_sysvmsg.h
These are all only relevant for the implementation.
2018-09-17 17:49:09 +02:00
Anatol Belski 44fa6be16e Set correct error code and adapt test 2018-09-17 17:19:39 +02:00
Nikita Popov 70d47b3c4a Switch Travis build to Xenial
Also explicitly start the mysql and pgsql services, as these are
no longer running by default.
2018-09-17 17:10:49 +02:00
Nikita Popov d2dc0a3291 Fix getColumnMeta() test
Newer MySQL versions are stricter about invalid values. Three issues
are fixed:

* Don't use negative values with ZEROFILL. ZEROFILL implies UNSIGNED.
* Use a legal TIMESTAMP value. TIMESTAMP does not accept a Unix timestamp.
* Specify BIGINT values as strings, to avoid overflows.
2018-09-17 17:10:49 +02:00
Nikita Popov cc6871152b Don't install libt1-dev on travis
Support for libt1 has been removed from ext/gd in PHP 7.0 by
7dcfdbbee4, so we no longer need
to install this package. It is also no longer available on newer
Ubuntu versions.
2018-09-17 13:48:39 +02:00
Nikita Popov 5776b4453d Remove unused MREMAP_MAYMOVE compatibility define 2018-09-17 13:48:39 +02:00
Anatol Belski decdca664e Fix error setting, both errors are needed 2018-09-17 13:34:52 +02:00
Nikita Popov b3f8a6341d Remove unused HAVE_MEM_MMAP_ANON and HAVE_MEM_MMAP_ZERO checks
These haven't been used since the MM rewrite in PHP 7.0. Nowadays
we assume that either MAP_ANON or MAP_ANONYMOUS is available.
2018-09-17 12:08:11 +02:00
Nikita Popov f57be4bdbe Remove __GNUC__ guard around stddef.h include
HAVE_STDDEF_H guards have been removed by
6c1ff61a36, because the header is
always available in C89. This removes a __GNUC__ guard for the
same header.
2018-09-17 12:08:11 +02:00
Anatol Belski 321c0cc349 Fix localized error messages and memory leaks
The FormatMessage API needs to LocalFree the delivered error messages.
In cases where messages are delivered in non ASCII compatible encoding,
the messages might be unreadable. This aligns the error message encoding
with the encoding settings in PHP, the focus is UTF-8 as default.

Initialize error buffer

Avoid code duplication
2018-09-17 10:56:50 +02:00
Nikita Popov 3b475910d6 Don't use xml resource in openssl test
Instead use a file resource, removing the dependency on ext/xml.
2018-09-17 10:20:26 +02:00
Nikita Popov 3e4b977df6 Remove PHP_XML_INTERNAL defines
This macro is no longer used.
2018-09-17 10:13:55 +02:00
Nikita Popov 178dcd4749 Perform final GC before the object store is freed
free_object_storage intentionally does not free the object allocations
to make sure that they show up as leaks. However, if the object is in
the GC root buffer, the later GC run may end up freeing the allocation,
hiding the leak.

Avoid this by moving the final GC run before free_object_storage, the
way it was done before fast_shutdown was integrated into core.
2018-09-17 10:13:55 +02:00
Peter Kokot ba3bd4ae06 Remove HAVE_STDIO_H
The `<stdio.h>` header file is part of the standard C89 headers [1]
and on current systems can be included unconditionally.

Since PHP requires at least C89 or greater, the `HAVE_STDIO_H` symbol
defined by Autoconf [2] can be ommitted and simplifed.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2018-09-17 02:00:51 +02:00
Peter Kokot 03bbdf275a Make PHP development tools files executable
This patch makes few remaining PHP development tools files
executable and adds a shebang to them.

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`. Shebang is not visible in
the output of the generated file.
2018-09-17 00:02:36 +02:00
Gabriel Caruso c9884354d2 Explain why the test was skipped 2018-09-16 17:31:06 -03:00
Peter Kokot 7dd62811ce Remove HAVE_STDLIB_H
The C89 and later standard defines the `<stdlib.h>` header as part of
the standard headers [1] and on current systems it is always present
and the `HAVE_STDLIB_H` symbol can be removed.

Also Autoconf suggests doing this and relying on C89 or above [2] and [3].

[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-16 20:53:53 +02:00
Peter Kokot dcc529aff4 Remove HAVE_SYS_VARARGS_H
Outdated systems used to provide the `<varargs.h>` and in case of PHP
`<sys/varargs.h>`. [1]

Current systems have `<stdarg.h>` which is also a C89 standard header
and systems have it always present. [2]

[1] https://en.wikipedia.org/wiki/Stdarg.h#varargs.h
[2] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
2018-09-16 20:50:20 +02:00
Gabriel Caruso f72b6c5e19 Use EXPECT instead of EXPECTF when possible 2018-09-16 15:39:18 -03:00
Nikita Popov d51b9a690e Remove unnecessary destroy wrappers
There used to be needed due to ZEND_FILE_LINE in debug builds.
As the argument is no longer passed, we don't need the wrappers
either.
2018-09-16 17:16:26 +02:00
Nikita Popov dfa166e7ed Remove unused ZEND_FILE_LINE in i_zval_ptr_dtor 2018-09-16 17:16:26 +02:00
Christoph M. Becker 25685942fa Don't hard-code object number in expectation 2018-09-16 15:52:18 +02:00
Nikita Popov 2d81db5643 Remove checks for libxml < 2.6.11
These are below our minimum version requirement.
2018-09-16 11:32:18 +02:00
Nikita Popov 1d0252a1c0 Remove IS_EXT_MODULE defines
I'm not sure what this was used for, but it doesn't look to be
relevant anymore.
2018-09-16 11:09:51 +02:00
Nikita Popov ca6caa0cb2 Make ext/xml API private
Also remove dead functions
2018-09-16 11:07:40 +02:00
Christoph M. Becker ba300b69d2 Update to SQLite 3.25.0 2018-09-15 23:12:25 +02:00
Richard Fussenegger a25171b96d Silence ar warning 2018-09-15 20:42:25 +02:00
Christoph M. Becker 6da3a1e3ce Revert "Implement #67331: Have parse_ini_file add empty entries"
This reverts commit 3f3e914df3.

The commit broke some tests on Windows, and generally needs more
though.
2018-09-15 17:08:58 +02:00
Christoph M. Becker 3f3e914df3 Implement #67331: Have parse_ini_file add empty entries
Some INI processors allow to specify empty values by just giving the
key without the equals sign, for instance MySQL and Python.  It appears
to be sensible to add this possibility to our INI parser, so that it
can be used for such INI files as well.  We choose NULL as the value of
empty values.

This syntactical enhancement is a (minor) BC break, though, as can be
seen by the necessary change to bug49692.ini.  The “comment” formerly
has been simply ignored, but now it would be parsed as key with an
empty value.

This PR is based on Adam's former patch.
2018-09-15 15:37:01 +02:00
Christoph M. Becker 01912f93c3 Change default of $variant param of idn_to_ascii() and idn_to_utf8()
According to the “Deprecate and remove INTL_IDNA_VARIANT_2003” RFC[1],
we change the default of the $variant parameter of `idn_to_ascii()` and
`idn_to_utf8()` from `INTL_IDNA_VARIANT_2003` to
`INTL_IDNA_VARIANT_UTS46`.

[1] <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>
2018-09-15 14:41:30 +02:00
Christoph M. Becker 8a4c2f1621 Require ICU ≥ 50.1
Given that ICU is a set of lively developed libraries, that ICU 50.1
has been released on 2012-11-05, and PHP 7.4 is scheduled to be
released seven years after it, we consider it appropriate to ditch
these legacy versions.

Particularly, that would be a reasonable groundwork to implement part
two of the “Deprecate and remove INTL_IDNA_VARIANT_2003” RFC[1], namely
to default idn_to_ascii()'s and idn_to_utf8()'s $variant parameter to
INTL_IDNA_VARIANT_UTS46, which is not defined in ICU < 4.6.

See also the related discussion on internals@[2].

[1] <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>
[2] <http://news.php.net/php.internals/101626>ff
2018-09-15 13:59:54 +02:00
Christoph M. Becker b820a7b2ff Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76886: Can't build xmlrpc with expat
2018-09-15 13:25:49 +02: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
Anatol Belski c571005bd9 Merge branch 'PHP-7.3'
* PHP-7.3:
  Sync version for vc++ 15.9
2018-09-13 19:28:02 +02:00
Dmitry Stogov 49b92446d7 Remove zend_check_private() 2018-09-13 13:47:06 +03:00
Dmitry Stogov 50b515f1a2 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fix a typo in a class catch in Phar
2018-09-13 13:38:27 +03:00
Dmitry Stogov bc288c4723 Simplify __clone() visibility check (magic methods still don't respect ZEND_ACC_CHANGED). 2018-09-13 13:36:09 +03:00
Tyson Andre 26f952b175 Fix a typo in a class catch in Phar 2018-09-13 11:48:42 +02:00
Dmitry Stogov 72bf2def6b Make visibilty check in is_callable() to be consistent with zend_std_get_method() 2018-09-13 12:24:59 +03:00
Anatol Belski 67a75a79ae Merge branch 'PHP-7.3'
* PHP-7.3:
  Backport changes for OpenSSL 1.1.1 CI integration
2018-09-13 11:07:09 +02:00
Anatol Belski 24517d82cf Fix typo 2018-09-13 10:06:49 +02:00
Anatol Belski 6220d21c34 Remove colliding file from CI image 2018-09-13 10:05:27 +02:00
Dmitry Stogov a12cd1c5e0 Split error code into "cold" functions and cleanup. 2018-09-13 10:31:49 +03:00
Dmitry Stogov e1ef054be5 Micro-optimization (condition reordering) 2018-09-13 09:31:38 +03:00
Dmitry Stogov eb4148e02d typo 2018-09-13 08:49:21 +03:00
Anatol Belski 3008ad1a49 More possibly colliding libs to remove from the test image 2018-09-13 00:49:54 +02:00
Dmitry Stogov f79270d876 Micro-optimization 2018-09-13 01:41:19 +03:00
Dmitry Stogov cdeebfd4af Avoid unnecesury iterations over parent classes, in case of no overriden private properties. 2018-09-12 23:47:52 +03:00
Anatol Belski 7015965254 Show all unmatched errors when test failed 2018-09-12 22:27:30 +02:00
Anatol Belski a45169a6ba Add debug message for failing test parts 2018-09-12 19:59:20 +02:00
Dmitry Stogov 5293dd9d8b Optimize method/property visibility checks 2018-09-12 18:59:12 +03:00
Anatol Belski 8a8edac8a5 Merge branch 'PHP-7.3'
* PHP-7.3:
  Improve error code matching
2018-09-12 16:26:26 +02:00
Anatol Belski 385ffea3ab Merge branch 'PHP-7.3'
* PHP-7.3:
  Update binary SDK version for AppVeyor
2018-09-12 12:12:38 +02:00
Dmitry Stogov 3444c260a2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76869 (Incorrect bypassing protected method accessibilty check).
2018-09-12 12:27:48 +03:00
Dmitry Stogov beb3594eb8 Better ZEND_ACC_CHANGED handling 2018-09-12 11:43:15 +03:00
Dmitry Stogov aee4b145ef Optimisation: Check for private property in parent class makes sense only if we already found a property info. Check for property started with "\\0" makes sense only if we didn't find property info. 2018-09-12 09:57:36 +03:00
Dmitry Stogov 73efd1b651 Simplify method visibility checks 2018-09-12 08:31:01 +03:00
Ferenc Kovacs 34f4ecee25 Merge branch 'PHP-7.3' 2018-09-12 00:08:34 +02:00
Dmitry Stogov 83fe1f1cc8 Use Zend API helper functions 2018-09-11 23:50:43 +03:00
Dmitry Stogov 1cc0d78c9b This increment is not necessary anymore. 2018-09-11 22:56:31 +03:00
Dmitry Stogov 06f056a760 Additional fix for bug #76860. 2018-09-11 18:29:27 +03:00
Christoph M. Becker 3f41ce75bb Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS wrt. php-7.3.RC1 tagging
2018-09-11 16:30:52 +02:00
Dmitry Stogov 0fbd2e6a16 Renumber ZEND_ACC_... flags 2018-09-11 17:21:17 +03:00
Dmitry Stogov 1570fe180f Removed weird test, trait can't be "static" or "final". 2018-09-11 17:07:06 +03:00
Nikita Popov e1123e3e4e Drop unused variable 2018-09-11 15:16:11 +02:00
Dmitry Stogov 37290ad8d2 Use mnemonic names 2018-09-11 14:54:11 +03:00
Christoph M. Becker aaae9c66db Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76510: file_exists() stopped working for phar://
2018-09-11 12:23:50 +02:00
Dmitry Stogov 034b7ff091 Get rid of ZEND_ACC_IMPLICIT_PUBLIC 2018-09-11 12:26:26 +03:00
Dmitry Stogov 5c39b2c328 Added test for bug #76860 (Missed "Accessing static property as non static" warning).
It's already fixed by previous commit.
2018-09-11 12:10:14 +03:00
Dmitry Stogov 3a249e769b Squashed commit of the following:
commit 2d3cac9e005d6bef9aa73ab57cc674aa53125954
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 11:54:47 2018 +0300

    Fixed static property access

commit 31786ee27282f319f3ef2a07635b1f325cbd67c6
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 11:05:29 2018 +0300

    Avoid duplicate checks

commit 5ae502b979ea33d058d01a9421eec5afd0084e8d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 10:39:17 2018 +0300

    Optimization

commit 82c17f0e8af02c9cf7d1bbdae4e3158330148203
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 09:26:50 2018 +0300

    Removed unused zend_duplicate_property_info()

commit ba53d1d0dd91d5530328a11cac93ff9e75c462b5
Merge: eacc11b8fd c4b14370cf
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Sep 11 09:24:13 2018 +0300

    Merge branch 'master' into shadow

    * master:
      7.0.33 next
      Sync NEWS [ci skip]
      add NEWS for 76582
      Enforce ordering of property compare in object comparisons
      Fixed wrong assertion
      Skip test on unsuitable env

commit eacc11b8fdeb002ee6a149defd8b5a8c3412896a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Sep 10 13:12:39 2018 +0300

    Fixed failure of ext/spl/tests/array_017.phpt

commit 62d1871430a1b81c84b790460afff0682648689a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Sep 10 11:55:07 2018 +0300

    Fixed issues

commit 1d37e3a40e4d07c4b933ed6f9d2e649dd01180f0
Merge: d6c3f098b6 1e550e6f7e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Sep 10 10:21:20 2018 +0300

    Merge branch 'master' into shadow

    * master:
      Update NEWS
      Fix for bug #76582
      Fix ssl stream reneg limit test to print only after first renegotiation
      Make a copy unconditionally
      Fix memory leak in pcre cache
      Remove not needed checking for <errno.h>
      Remove HAVE_ASSERT_H
      Add test for bug #76850
      Fixed bug #76850 Exit code mangled by set locale/preg_match
      Remove empty PHP tags from test
      Fix #75273: php_zlib_inflate_filter() may not update bytes_consumed
      Fix PCRE2 exclusion and remove dead libs in Makefile.gcov
      Report mem leaks to stderr if no Win debugger is present
      Use combined assignment contanation operator
      Fixed bug #76796
      Support fixed address mmap without replacement

commit d6c3f098b6015e76d042691de0af2e1426c66829
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Sep 7 13:56:30 2018 +0300

    Get rid of ZEND_ACC_SHADOW
2018-09-11 11:56:45 +03:00
Anatol Belski c4b14370cf Merge branch 'PHP-7.3'
* PHP-7.3:
  7.0.33 next
2018-09-11 07:02:03 +02:00
Anatol Belski 484389e7dd Merge branch 'PHP-7.3'
* PHP-7.3:
  Sync NEWS [ci skip]
2018-09-10 16:58:42 +02:00
Remi Collet b0d923ec3e Merge branch 'PHP-7.3'
* PHP-7.3:
  add NEWS for 76582
2018-09-10 15:31:22 +02:00
Sara Golemon 7f56150ef2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Enforce ordering of property compare in object comparisons
2018-09-10 08:56:19 -04:00
Dmitry Stogov 5d2894c8e7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed wrong assertion
2018-09-10 15:27:48 +03:00
Anatol Belski c126061e4c Merge branch 'PHP-7.3'
* PHP-7.3:
  Skip test on unsuitable env
2018-09-10 09:51:58 +02:00
Stanislav Malyshev 1e550e6f7e Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS
  Fix for bug #76582
2018-09-09 12:29:41 -07:00
Jakub Zelenka f4cf60c757 Merge branch 'PHP-7.3' 2018-09-09 19:00:37 +01:00
Anatol Belski d51af6462c Merge branch 'PHP-7.3'
* PHP-7.3:
  Make a copy unconditionally
2018-09-09 10:43:34 +02:00
Anatol Belski 73ecad2f00 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix memory leak in pcre cache
2018-09-09 10:39:15 +02:00
Peter Kokot 50b9ef8d94 Remove not needed checking for <errno.h>
Header `<errno.h>` is part of the standard C89 headers [1] and on
current systems checking is not need anymore since PHP requires at
least C89. This is noted also by Autoconf itself in the docs and
code [2].

The Autoconf check defined the `HAVE_ERRNO_H` symbol when building PHP
with sockets extension or fpm sapi. This symbol is not utilized across
the PHP source code except in the current version of bundled GD library
which has worked ok so far also with sockets extension or fpm sapi
disabled anyway.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2018-09-09 10:19:04 +02:00
Peter Kokot 77118fc925 Remove HAVE_ASSERT_H
The `<assert.h>` header file is part of the standard C89 headers [1] and
on older systems there needed to be also a manual check if header is
present.

Since PHP requires at least C89 manual check and the `HAVE_ASSERT_H`
symbol defined by Autoconf in configure.ac can be both removed [2].

This patch also removes unused <assert.h> includes where c files don't
use the `assert()` macro.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2018-09-09 09:43:03 +02:00
Anatol Belski c92425dbab Merge branch 'PHP-7.3'
* PHP-7.3:
  Add test for bug #76850
2018-09-08 21:40:14 +02:00
Anatol Belski 3de0ba7cbf Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76850 Exit code mangled by set locale/preg_match
2018-09-08 21:38:05 +02:00
Gabriel Caruso a303089ffe Remove empty PHP tags from test 2018-09-08 16:28:48 -03:00
Christoph M. Becker 5177db127d Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #75273: php_zlib_inflate_filter() may not update bytes_consumed
2018-09-08 19:14:22 +02:00
Gabriel Caruso 5df49555a9 Fix PCRE2 exclusion and remove dead libs in Makefile.gcov 2018-09-08 10:04:10 -03:00
Christoph M. Becker 3145d6c6b9 Report mem leaks to stderr if no Win debugger is present
Formerly, we sent output regarding memory leaks always to the debugger
on Windows, but this appears to be not useful especially for the PHPTs,
which usually are not run under a debugger, and so important info will
not be available there.
2018-09-08 13:57:01 +02:00
Gabriel Caruso 98b01a14e3 Use combined assignment contanation operator 2018-09-07 23:33:17 -03:00
Nikita Popov 1038c4b4ce Merge branch 'PHP-7.3' 2018-09-07 14:03:04 +02:00
Nikita Popov 100733f86b Merge branch 'PHP-7.3' 2018-09-07 12:10:15 +02:00
Peter Kokot b1f65fb25b Remove netware header
Netware system is discontinued and support has been removed from PHP
source code.
2018-09-06 05:20:37 +02:00
Anatol Belski aa82afe6a1 Merge branch 'PHP-7.3'
* PHP-7.3:
  Sync with recent changes to default libcurl build
2018-09-05 21:30:52 +02:00
Dmitry Stogov 25d43cab8c Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed support for commutative "user opcodes"
2018-09-05 22:11:36 +03:00
Anatol Belski a1ba3007a4 Sync with recent changes to default libcurl build 2018-09-05 17:40:25 +02:00
Fabien Villepinte ec110f1ecc Fix typos in UPGRADING.INTERNALS 2018-09-05 17:21:31 +02:00
Christoph M. Becker f94518dca1 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #74454: Wrong exception being thrown when using ReflectionMethod
2018-09-05 15:11:09 +02: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 6c1ff61a36 Remove HAVE_STDDEF_H
The `<stddef.h>` header file is part of the standard C89 headers [1] and
on current systems there is no need for a manual check if header is
present.

Since PHP requires at least C89 the `HAVE_STDDEF_H` symbol isn't defined
by Autoconf anywhere else anymore [2] and accross the PHP source code
the header is included unconditionally already.

This patch syncs this also for the bundled libmbfl which is maintaned as
a fork in php-src.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2018-09-05 11:51:19 +02:00
Joe Watkins 3b1b0c589d Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix typos in UPGRADING.INTERNALS
2018-09-05 11:50:38 +02:00
Anatol Belski 836b8583c0 Merge branch 'PHP-7.3'
* PHP-7.3:
  Restore NEWS entry [skip ci]
2018-09-04 13:03:47 +02:00
Peter Kokot 472e7cded0 Remove unused buildsystem files in TSRM
Buildsystem files in the TSRM folder used to provide standalone build of
the TSRM. Today these files are oudated and not used.
2018-09-04 12:04:11 +02:00
Peter Kokot 29dc0470c8 Remove AC_FUNC_UTIME_NULL
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems, including the AC_FUNC_UTIME_NULL.

This macro checks if `utime(file, NULL)` sets file's timestamp to the
current time and defines the `HAVE_UTIME_NULL` symbol. This check was
relevant on very old systems (for example, 4.3BSD released in 1986) and
today can be omitted for systems with utime since it should be well
supported by now. [2]

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-04 12:03:34 +02:00
Peter Kokot 6db3c105f2 Remove AC_FUNC_MEMCMP
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_FUNC_MEMCMP`.

On some old systems such as SunOS 4.1.3 (EOL in 2003) and NeXT x86
OpenStep (discontinued) the `memcmp` function wasn't present or it
didn't work properly. [2]

On current systems including at least Solaris 10+ this check is not
relevant anymore.

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-04 12:02:47 +02:00
Joe Watkins 4318a58023 Merge branch 'master' of git://github.com/php/php-src 2018-09-04 12:01:53 +02:00
Peter Kokot eff22dc511 Remove AC_HEADER_DIRENT
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_HEADER_DIRENT`.

This macro checks which header defines the `DIR` type. If `<dirent.h>`
is available it defines the `HAVE_DIRENT_H` symbol. Since the `<dirent.h>`
header is already checked in the `configure.ac`, this check is not needed
anymore. This macro also additionally checks for SCO Xenix (discontinued,
latest release 1989) dir and x libraries. [2]

Commit 6ed790685f introduced also
`<sys/dir.h>`. This header exists from times of UNIX System V and
provided definition of DIR type on these systems such as 4.3BSD.
Today `<sys/dir.h>` is kept for backwards compatibility and includes
the `<dirent.h>` on current systems. With `dirent.h>` present this
include is no longer required.

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html

Remove unused dirent.h includes
2018-09-04 12:01:24 +02:00
Xinchen Hui dd3fb58e7c Merge branch 'master' of git.php.net:/php-src
* 'master' of git.php.net:/php-src:
  Fix bug #74764 and add a test case
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-09-04 17:27:30 +08:00
Xinchen Hui 6078491720 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76825 (Undefined symbols ___cpuid_count)
2018-09-04 17:26:56 +08:00
Joe Watkins efbc05a5a8 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix bug #74764 and add a test case
2018-09-04 11:14:57 +02:00
Anatol Belski 59be8d52d4 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-09-04 11:03:56 +02:00
Anatol Belski e1d12b337d Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76833, backport change to stream_socket_enable_crypto-win32.phpt from 7.3
2018-09-04 10:57:47 +02:00
Nikita Popov ee33c943e7 Merge branch 'PHP-7.3' 2018-09-04 08:09:22 +02:00
Nikita Popov d9aec118df Merge branch 'PHP-7.3' 2018-09-04 05:57:43 +02:00
Nikita Popov 6cb725e0a7 Merge branch 'PHP-7.3' 2018-09-04 05:33:00 +02:00
Nikita Popov 213091b37e Merge branch 'PHP-7.3' 2018-09-04 05:08:47 +02:00
Nikita Popov e48e9c0002 Merge branch 'PHP-7.3' 2018-09-04 04:58:44 +02:00
Dmitry Stogov 437e91e194 Keep collision list ordered from higher to lower buckets. 2018-09-04 01:19:07 +03:00
Tiffany 318b34da05 Update grammar and clarify wording in couple places
On line 512, I clarified the sentence which uses effect, previously the sentence was awkward.
On line 656, the wrong word is used, I changed affect to effect.
2018-09-03 22:04:37 +02:00
Anatol Belski e0b91051ae Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76832 ZendOPcache.MemoryBase periodically deleted by the OS
2018-09-03 15:11:45 +02:00
Dmitry Stogov 887e126240 Fixed condition 2018-09-03 14:50:35 +03:00
Christoph M. Becker f543476e89 Fix off-by-one errors in skip reasons 2018-09-03 12:46:34 +02:00
Christoph M. Becker d36cb3d30e Merge branch 'PHP-7.3'
* PHP-7.3:
  Update to Oniguruma 6.9.0
2018-09-03 12:26:42 +02:00
Dmitry Stogov a57ec0aeb5 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed reference-countingin ZTS build.
2018-09-03 10:21:55 +03:00
Jakub Zelenka ef999f0735 Merge branch 'PHP-7.3' 2018-09-02 20:03:03 +01:00
Peter Kokot f86d3de87f Remove AC_HEADER_TIME
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_HEADER_TIME`.

This macro checks if both `<sys/time.h>` and `<time.h>` can be included
at the same time and defines the `TIME_WITH_SYS_TIME` and
`HAVE_SYS_TIME_H` symbols. On current system such check is not relevant
anymore because in case both headers are present both can be also
included at the same time.

This patch simplifies this checking.

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-02 19:24:55 +02:00
Peter Kokot 8e230d364d Remove AC_C_CONST
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems, including the `AC_C_CONST`.

The `const` keyword is used in C since C89. On old systems some compilers
lacked the `const` and this macro defined it to be empty. This check was
relevant on systems with compilers before C89 and on current systems it
can be omitted. [2]

PHP also requires at least C89 so `const` is always available.

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-02 18:55:03 +02:00
Christoph M. Becker 217159d57a Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #75696: posix_getgrnam fails to print details of group
2018-09-01 14:30:38 +02:00
Anatol Belski 8b9b16d3be Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
2018-09-01 11:34:08 +02:00
Anatol Belski 3d28a1b2d6 Merge branch 'PHP-7.3'
* PHP-7.3:
  Improve fix for bug #76829
2018-09-01 01:12:45 +02:00
Anatol Belski 96f30a9160 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76829 Incorrect validation of domain on idn_to_utf8() function
2018-09-01 00:21:02 +02:00
Gabriel Caruso 6dd9fad0c0 Revert changes in test file
This reverts changes made in 2f700384 and 4fcaebba. This test is
supposed to run
only on Windows indeed, as in a Unix environment with a mail server
configured,
an email will be send. On Windows, only emptying the SMTP ini directives
is enough.
2018-08-31 08:48:48 -03:00
Gabriel Caruso 4fcaebbab8 Fix tests in some builds
Looks like the EXPECTREGEX was eating the =DONE= section
2018-08-31 08:09:14 -03:00
Anatol Belski ecb698b21d Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix stack underflow in phar
2018-08-30 19:34:42 +02:00
Christoph M. Becker df9e75cad7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76820: Z_COPYABLE invalid definition
2018-08-30 18:01:29 +02:00
Anatol Belski 423d6add5b Merge branch 'PHP-7.3'
* PHP-7.3:
  Switch to staging series on AppVeyor
2018-08-30 17:39:59 +02:00
Remi Collet 2d98ad8bde Merge branch 'PHP-7.3'
* PHP-7.3:
  NEWS for #76818
2018-08-30 14:50:39 +02:00
Remi Collet 2e4489fdf4 Merge branch 'PHP-7.3'
* PHP-7.3:
  fix double cast to int on 32-bit
2018-08-30 09:05:01 +02:00
Dmitry Stogov 19376453e8 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed incorrect ZEND_ACC_ARENA_ALLOCATED usage (it must be used only for internal functions).
2018-08-29 23:41:46 +03:00
Peter Kokot ef12e96215 Remove AC_FUNC_VPRINTF
Autoconf 2.59d (released in 2006) 1 started promoting several macros
as not relevant for newer systems anymore, including the AC_FUNC_VPRINTF.

This macro checks for presence of the vprint function otherwise checks
for presence of the _doprnt function. This check was relevant on very
old systems and today can be omitted since it should be well supported
by now. [2]

Also PHP doesn't use the HAVE_VPRINTF or HAVE_DOPRNT symbols.

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-08-29 21:31:55 +02:00
Peter Kokot cbc785dc8c Remove AC_STRUCT_TM macro
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_STRUCT_TM`.

This macro checks if `struct tm` is defined in either `<sys/time.h>` or
`<time.h>` and defines the `TM_IN_SYS_TIME` symbol accordingly. This
check was relevant in times before the C89 for some embedded systems,
microcontrollers or very old systems. For newer systems it can be
avoided and the `<time.h>` should be included instead since current
systems should be well supported by now. [2]

Since PHP requires at least C89, this patch removes the obsolescent call
and time.h checks.

Refs:

- [1]: http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
- [2]: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Particular-Structures.html
2018-08-29 21:22:47 +02: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
Sara Golemon c1f7aae19c Merge branch 'PHP-7.3'
* PHP-7.3:
  Prep for 7.1.23
2018-08-29 12:42:22 -04:00
Anatol Belski a2f8ccd15c Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS
2018-08-29 16:12:39 +02:00
Remi Collet 404a97dd57 Merge branch 'PHP-7.3'
* PHP-7.3:
  Revert "Support fixed address mmap without replacement"
  Revert "Don't report mmap failure if it is expected"
2018-08-29 14:41:27 +02:00
Gabriel Caruso 2f7003847d Make more tests run on Linux 2018-08-28 21:20:00 -03:00
Peter Kokot 3748d8070f Implement #64517: Add AC_ARG_PROGRAM macro
The AC_ARG_PROGRAM Autoconf macro provides program name transformations
when installing. This patch implements #64517 and prepares the
implementation for the request #60518.

In ./configure --help it additionally outputs --program-prefix=PREFIX,
--program-suffix=SUFFIX and the upcoming --program-transform-name=PROGRAM
option.

Macro AC_ARG_PROGRAM is available since Autoconf 2.0 and needs to be
called after the AC_CANONICAL_TARGET macro.

Refs:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Transforming-Names.html
2018-08-29 02:04:48 +02:00
Dmitry Stogov 03fc3d85d8 Allow opcache_compile_file() to perform compilation even if opcache is disabled. 2018-08-29 00:42:38 +03:00
Dmitry Stogov cd9f0a22fc Perform run-time binding reusing HashTable bucket (without new bucket insertion). 2018-08-29 00:35:07 +03:00
Peter Kokot 409b5133cc Change some permissions from 755 to 644
This patch syncs file permissions accross the PHP source code files
since these don't need to be executable.
2018-08-28 23:26:49 +02:00
Dmitry Stogov 002aa30786 Added check for "user" method 2018-08-28 23:56:12 +03:00
Dmitry Stogov 684354be72 Removed incorrect efree() (run_time_cache(s) are usually allocated in CG(arena)). 2018-08-28 17:46:26 +03:00
Anatol Belski 8b4b41696e Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76803 ftruncate changes file pointer
2018-08-28 15:43:34 +02:00
Christoph M. Becker 95178b19b2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix SKIPIF conditions
2018-08-28 14:02:44 +02:00
Christoph M. Becker c5eee032f4 Merge branch 'PHP-7.3' 2018-08-28 12:25:00 +02:00
Dmitry Stogov 4151a3fa64 Revert "Removed redundand code"
This reverts commit 57e2b7d53b.
2018-08-28 11:51:08 +03:00
Remi Collet dff0d81ce6 Merge branch 'PHP-7.3'
* PHP-7.3:
  bump to 7.2.11-dev
2018-08-28 10:19:24 +02:00
Dmitry Stogov 57e2b7d53b Removed redundand code 2018-08-28 11:03:17 +03:00
Jakub Zelenka 39edd38851 Merge branch 'PHP-7.3' 2018-08-27 15:53:13 +01:00
Dmitry Stogov 2fbfdde1b6 Cleanup class linking 2018-08-27 16:40:25 +03:00
Dmitry Stogov ea9628936f Move zend_verify_abstract_class() into zend_inheritance.c 2018-08-27 12:56:17 +03:00
Dmitry Stogov 02eded868c Avoid function copying 2018-08-27 12:47:32 +03:00
Anatol Belski e42e8b1051 Refactor stat implementation
- move relevant parts into win32
- general cleanup
- use Windows API and fallback to POSIX
- improve filetime to timestamp conversion
- improve stat/fsat
- handle ino by using file index
- handle st_dev by using volume serial number

The inode implementation is based on file indexes from NTFS. On 32-bit,
fake inodes are shown, that may lead to unexpeted results. 64-bit
implementation is most reliable.
2018-08-26 22:30:06 +02:00
Christoph M. Becker 2dbd21c12f Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #68180: iconv_mime_decode can return extra characters in a header
2018-08-26 13:24:36 +02:00
Christoph M. Becker 0163fd00ba Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #60494: iconv_mime_decode does ignore special characters
2018-08-25 17:52:44 +02:00
Christoph M. Becker 1d0f6b22a8 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #63839: iconv_mime_decode_headers function is skipping headers
2018-08-25 14:54:52 +02:00
Christoph M. Becker ac4da17f79 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #55146: iconv_mime_decode_headers() skips some headers
2018-08-25 14:43:35 +02:00
Christoph M. Becker c520b4a99e Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #53891: iconv_mime_encode() fails to Q-encode UTF-8 string
2018-08-25 14:30:24 +02:00
Christoph M. Becker 70842b8be0 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76712: Assignment of empty string creates extraneous text node
2018-08-25 14:24:43 +02:00
Christoph M. Becker 23aa355bf2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Remove some old parts of the php
2018-08-25 11:58:50 +02:00
Peter Kokot 7b39e8a338 Remove Doxygen configuration
Documentation for the SPL was once rendered at
http://www.php.net/~helly/php/ext/spl/

With upgrades of the PHP manual, the SPL documentation moved there
instead and PHP files for the SPL docs in the PHP source code directory
were outdated and removed via 9003d8a4cf
2018-08-25 11:42:45 +02:00
Peter Kokot 3ceecaa9a0 Replace HAVE_ST_BLOCKS with HAVE_STRUCT_STAT_ST_BLOCKS
Since Autoconf 2.50+ macro AC_STRUCT_ST_BLOCKS defines the new
HAVE_STRUCT_STAT_ST_BLOCKS symbol and has deprecated the previous
HAVE_ST_BLOCKS.

PHP 5.3 required Autoconf 2.13 (released in 1999) or newer, since PHP
5.4 the autoconf 2.59 (released in 2003) or newer was required, and
since PHP 7.2, autoconf 2.64 (released in 2008) or newer is required.
2018-08-24 18:33:23 +02:00
Dmitry Stogov 6136a20544 ZEND_DECLARE_CLASS, ZEND_DECLARE_INHERITED_CLASS and ZEND_DECLARE_INHERITED_CLASS_DELAYED don't need return value anymore. 2018-08-24 15:40:53 +03:00
Dmitry Stogov b36dbdd1dd Perform "early-binding" directly during compilation 2018-08-24 15:18:38 +03:00
Dmitry Stogov 8050f4a334 Keep information about unresolved parent class in zend_class_entry->parent_name 2018-08-24 00:20:57 +03:00
Anatol Belski 644bdaf9cd Merge branch 'PHP-7.3'
* PHP-7.3:
  mkdist.php: recursively check dll dependencies
2018-08-23 21:28:08 +02:00
Dmitry Stogov d140df58e6 Keep information about unresolved interfaces in zend_class_entry->interface_names.
Move interface implementation code into ZEND_DECLARE_*CLASS opcodes.
Remove ZEND_ADD_INTERFACE and ZEND_VERIFY_ABSTRACT_CLASS opcodes.
2018-08-23 17:16:28 +03:00
Christoph M. Becker 4bf1d0b3a4 Merge branch 'PHP-7.3'
* PHP-7.3:
  Simplify regression test
2018-08-23 12:52:31 +02:00
Dmitry Stogov 67397970b2 Replace zend_class_entry->traits by persistent zend_class_entry->trait_names.
Move trait binding code into ZEND_DECLARE_*CLASS opcodes.
Remove ZEND_ADD_TRIAIT and ZEND_BIND_TRAITS opcodes.
2018-08-23 02:02:26 +03:00
Dmitry Stogov 92fdf9d629 Change zend_lookup_class_ex() and zend_fetch_class_by_name() prototypes to accept optional lower-case class name as zend_string*, instead of zval*. 2018-08-22 17:07:31 +03:00
Christoph M. Becker 20c4923d5c Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #68825: Exception in DirectoryIterator::getLinkTarget()
2018-08-22 15:40:26 +02:00
Christoph M. Becker 4b5d26596a Merge branch 'PHP-7.3'
* PHP-7.3:
  Increase memory_limit to prevent test failures
2018-08-22 14:32:04 +02:00
Christoph M. Becker 1f698e0f94 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76773 - Methods with a concrete scope need to be added again
2018-08-22 14:08:46 +02:00
Christoph M. Becker d1ff6c3a4e Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76767: ‘asm’ operand has impossible constraints in zend_operators.h
2018-08-22 13:57:44 +02:00
Christoph M. Becker 5aac8fdbfc Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76778: array_reduce leaks memory if callback throws exception
2018-08-22 13:51:55 +02:00
Nikita Popov 1ff3b5dd75 Merge branch 'PHP-7.3' 2018-08-22 13:43:52 +02:00
Dmitry Stogov 93f9ee7217 Use zend_class_entry/zend_function type names instead of _zend_class_entry/_zend_function tags. 2018-08-22 14:01:14 +03:00
Christoph M. Becker 6c4528e444 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76777 and added test
2018-08-22 12:55:17 +02:00
Dmitry Stogov fc8d6b6797 Introduced ZEND_COMPILE_IGNORE_OTHER_FILES compiler option, to allow "separate" file compilation (unaffected but previously compiled files), without CG(function_table)/CG(class_table) manipulation. 2018-08-22 13:45:56 +03:00
Nikita Popov 850b53df0e Unify unpack checking in compile_special_func()
Instead of handling this separately for each specialized function,
do one check directly in zend_compile_special_func().
2018-08-22 11:38:28 +02:00
Nikita Popov 406b57ed01 Merge branch 'PHP-7.3' 2018-08-22 11:22:23 +02:00
Dmitry Stogov 1321aa5080 Merge branch 'PHP-7.3'
* PHP-7.3:
  Stop using zend_function->reserved[] space.
2018-08-22 10:44:34 +03:00
Dmitry Stogov e3bbfbe6a2 Removed op_array->static_variables duplication code. They can't be "shared" during comilation. 2018-08-22 08:24:28 +03:00
Nikita Popov 045b74c12c Drop dead code
var_ast is always a ZEND_AST_ZVAL.
2018-08-21 13:43:29 +02:00
Dmitry Stogov 168376e98e Cleanup 2018-08-21 13:21:56 +03:00
Dmitry Stogov 6d88e1ccd6 Don't use second operand of BIND_STATIC instruction. 2018-08-21 12:22:04 +03:00
Nikita Popov 09b4b83753 Merge branch 'PHP-7.3' 2018-08-21 08:34:15 +02:00
Dmitry Stogov 7a52864ad0 Merge branch 'PHP-7.3'
* PHP-7.3:
  Removed dead code
2018-08-21 09:02:22 +03:00
Nikita Popov 5e74a1f411 Merge branch 'PHP-7.3' 2018-08-21 06:27:27 +02:00
Dmitry Stogov 64f8b0185f Merge branch 'PHP-7.3'
* PHP-7.3:
  Avoid hash lookups in BIND_STATIC and BIND_LEXICAL opcode handlers. Encode static variable offset into opline->extended_value.
2018-08-20 16:11:40 +03:00
Christoph M. Becker a13e60a954 Merge branch 'PHP-7.3' 2018-08-20 12:57:45 +02:00
Gabriel Caruso c86ce117c2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Make array parsing parameters error messages consistency with ZPP failure
2018-08-19 21:33:41 -03:00
Jakub Zelenka 1dd4c62c99 Merge branch 'PHP-7.3' 2018-08-19 20:20:46 +01:00
Christoph M. Becker ef1b26f080 Map ERROR_PRIVILEGE_NOT_HELD to EACCES
Attempting to create a symlink on Windows via the CLI SAPI without
administrative rights is likely to fail with ERROR_PRIVILEGE_NOT_HELD.
Therefore we map this Windows error to EACCES to get better diagnostics
and to avoid the assert() failure in debug mode.
2018-08-19 13:56:34 +02:00
Anatol Belski ac68a423e1 Merge branch 'PHP-7.3'
* PHP-7.3:
  Use stable deps on AppVeyor for now
2018-08-18 20:06:14 +02:00
Christoph M. Becker a6df0bf108 Merge branch 'PHP-7.3'
* PHP-7.3:
  Add regression test for bug #68175
  Fix #68175: RegexIterator pregFlags are NULL instead of 0
2018-08-18 14:39:35 +02:00
Anatol Belski 3cb4db913d Merge branch 'PHP-7.3'
* PHP-7.3:
  Add test for bug #76738
2018-08-17 18:38:07 +02:00
Anatol Belski 084837f274 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix memory leak
2018-08-17 16:23:27 +02:00
Anatol Belski 03368a0840 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update binary SDK version for AppVeyor
2018-08-17 15:47:03 +02:00
Christoph M. Becker cb4fb6b07c Merge branch 'PHP-7.3' 2018-08-17 13:07:41 +02:00
Xinchen Hui e81b0b29d3 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed same bug #76755 in setrawcookie
2018-08-17 16:20:37 +08:00
Xinchen Hui 3ca89ba007 Merge branch 'PHP-7.3'
* PHP-7.3:
  Cheaper checking
2018-08-17 15:22:50 +08:00
Xinchen Hui 13658428a2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Micro optimization & fixed invalid key handling
2018-08-17 14:56:43 +08:00
Xinchen Hui ed0c581808 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76755 (setcookie does not accept "double" type for expire time)
2018-08-17 13:46:08 +08:00
Xinchen Hui 59bcf22237 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS
  Update NEWS
  Fixed bug #76754 (parent private constant in extends class memory leak)
2018-08-17 13:36:34 +08:00
Xinchen Hui 4ab25235e5 Added a note 2018-08-17 12:22:46 +08:00
Xinchen Hui dc79094217 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76752 (Crash in ZEND_COALESCE_SPEC_TMP_HANDLER - assertion in _get_zval_ptr_tmp failed).
2018-08-17 12:19:42 +08:00
Xinchen Hui fb0389b101 Merge branch 'master' of git.php.net:/php-src
* 'master' of git.php.net:/php-src:
  fix man page installation
2018-08-16 13:59:39 +08:00
Xinchen Hui a8394a9f12 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS
  Update NEWS
  Fixed bug #76747 (Opcache treats path containing "test.pharma.tld" as a phar file)
2018-08-16 13:58:00 +08:00
Remi Collet 70695cfd60 Merge branch 'PHP-7.3'
* PHP-7.3:
  fix man page installation
2018-08-16 06:55:30 +02:00
Xinchen Hui d7520f366a Merge branch 'PHP-7.3'
* PHP-7.3:
  Added NEWs
2018-08-15 11:03:30 +08:00
Anatol Belski 8b3174f256 Cleanup 2018-08-14 14:33:19 +02:00
Anatol Belski 083285f22a Followup fix for ef9ed19e, see also bug #76738 2018-08-14 14:16:13 +02:00
Christoph M. Becker e2326c5816 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS wrt. php-7.3.0beta2 tagging
2018-08-14 13:37:03 +02:00
Christoph M. Becker 6e3fb489e8 Merge branch 'PHP-7.3' 2018-08-14 12:15:47 +02:00
Xinchen Hui 242ebcc10b Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed zend_read_static_property
2018-08-14 13:02:14 +08:00
Christoph M. Becker 7956722cfd [ci skip] Fix EXTENSIONS
Commit 54f920d661 inadvertently changed
one the maintainer of xmlwriter from pajoye to chregu; we fix that.
2018-08-13 16:24:29 +02:00
Christoph M. Becker 9a6e7bfa1f Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix arginfo for tidy::__construct()
2018-08-13 16:10:02 +02:00
Christoph M. Becker 0fd5fd8d58 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix arginfo for bzcompress
2018-08-13 16:02:35 +02:00
Anatol Belski 2dfb74682f Merge branch 'PHP-7.3'
* PHP-7.3:
  Sync with e0fe6674
2018-08-13 09:22:07 +02:00
Anatol Belski b27d867713 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update NEWS [ci skip]
  Update NEWS [ci skip]
  Update NEWS [ci skip]
2018-08-13 09:14:48 +02:00
Gabriel Caruso 9003d8a4cf Drop spl/internal documentation
These docs were outdated by now and the one at
https://php.net/spl should be used instead
2018-08-12 16:15:55 +02:00
Gabriel Caruso 84b195d9fc Fix some misspellings 2018-08-12 16:15:45 +02:00
Christoph M. Becker 9ea7d259ef Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76688: Disallow excessive parameters after options array
2018-08-12 15:49:46 +02:00
Peter Kokot 92b04da505 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
2018-08-12 11:29:19 +02:00
Peter Kokot f689223b4e Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix bug #76030 RE2C_FLAGS rarely honoured
2018-08-12 11:16:06 +02:00
Levi Morrison 29b56a878a Quell GCC warning on mixing || and && 2018-08-11 16:54:21 -06:00
Anatol Belski b151e17bdf Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #74484 MessageFormatter::formatMessage memory corruption
2018-08-09 22:09:52 +02:00
Christoph M. Becker 8e7abb7b65 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS regarding SameSite cookie support
2018-08-09 00:54:12 +02:00
Gabriel Caruso 953e28a92c Remove more unecessaries percent signs
Follwing dae65a89
2018-08-08 08:24:00 -03:00
Gabriel Caruso f47cdd1ee0 Remove invalid SKIPIF sections and make more tests run 2018-08-07 21:23:21 -03:00
Xinchen Hui 55c884f351 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76700 - Methods with altered visibility need to be added again
2018-08-07 14:23:44 +08:00
Xinchen Hui fadbfbf8e1 Merge branch 'bug-76700' of https://github.com/pmmaga/php-src
* 'bug-76700' of https://github.com/pmmaga/php-src:
  Fix #76700 - Methods with altered visibility need to be added again
2018-08-07 14:21:02 +08:00
Xinchen Hui 333cc376c4 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76713 (Segmentation fault caused by property corruption)
2018-08-07 12:36:48 +08:00
Anatol Belski 8d9541b6c8 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix stack underflow in phar
2018-08-06 22:44:32 +02:00
Anatol Belski 85e95c9a06 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update libmagic.patch [ci skip]
2018-08-06 14:29:06 +02:00
Christoph M. Becker 8c76dc3658 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Extended class naming rule
2018-08-06 13:31:37 +02:00
Peter Kokot f47bd676cb Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-08-06 09:43:14 +02:00
Peter Kokot 0d8b8ad0ce Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix bug #76709: Minimal required zlib library is 1.2.0.4
2018-08-06 09:40:06 +02:00
Peter Kokot f2efcf868a Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-08-06 06:20:22 +02:00
Peter Kokot 163600ac2a Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix bug #65988: Zlib version check fails
2018-08-06 06:16:25 +02:00
Peter Kokot 0a99ecba42 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-08-06 01:45:01 +02:00
Peter Kokot ee3d32d44b Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix bug #72443: Generate enabled extension
2018-08-06 01:39:07 +02:00
Gabriel Caruso dae65a89aa Remove unecessaries percent signs 2018-08-05 20:18:02 -03:00
Gabriel Caruso d570b7382d Fix SKIPIF conditions for online tests
Add when necessary, as well remove when not
2018-08-05 18:28:28 -03:00
Christoph M. Becker d22dfa6e5f Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Fix UPGRADING
2018-08-05 23:12:58 +02:00
Jakub Zelenka 68c49e76d3 Merge branch 'PHP-7.3' 2018-08-05 20:37:46 +01:00
Peter Kokot f98a08f9c1 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  [ci skip] Update NEWS
2018-08-05 20:38:08 +02:00
Peter Kokot 938791398d Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed incorrect restoring of LDFLAGS
2018-08-05 20:32:27 +02:00
Jakub Zelenka e942663a09 Use php_openlog instead of openlog in FPM
Fix incorrect port in the previous commit
2018-08-05 18:21:52 +01:00
Jakub Zelenka 2a67d62395 Fix FPM logging when log pipe is closed 2018-08-05 18:19:00 +01:00
Gabriel Caruso 37245e63ca Make test run on non debug builds 2018-08-05 05:05:11 -03:00
Christoph M. Becker 61e1798c8e Merge branch 'PHP-7.3'
* PHP-7.3:
  Add missing skip conditions
2018-08-05 00:13:40 +02:00
Christoph M. Becker 2fec8b1bed Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76706: mbstring.http_output_conv_mimetypes is ignored
2018-08-04 23:24:20 +02:00
Peter Kokot a0970bbbab Merge branch 'PHP-7.3'
* PHP-7.3:
  Remove outdated comment with PEAR xmlrpc dependency
2018-08-04 18:23:25 +02:00
Anatol Belski a66c1c41ad Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix possible stack buffer overflow
2018-08-04 16:56:49 +02:00
Peter Kokot 50352b356b Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
2018-08-04 16:21:04 +02:00
Peter Kokot 7518866519 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
2018-08-04 16:18:42 +02:00
Christoph M. Becker e529587a65 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #76704: mb_detect_order return value varies based on argument type
2018-08-04 14:04:55 +02:00
Christoph M. Becker 88c57c7ee2 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Fix NEWS
2018-08-04 13:46:50 +02:00
Peter Kokot fa4bf48fba Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
2018-08-04 06:41:44 +02:00
Peter Kokot cbd0daa7cd Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
2018-08-04 06:40:54 +02:00
Peter Kokot fc9d49ec4f Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Update NEWS
2018-08-04 06:39:58 +02:00
Peter Kokot af96a372af Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix bug 76595: Update phpdbg man page
2018-08-04 06:37:42 +02:00
Pedro Magalhães 97b2558b76 Fix #76700 - Methods with altered visibility need to be added again 2018-08-03 17:30:03 +01:00
Anatol Belski 9652fc624a Merge branch 'PHP-7.3'
* PHP-7.3:
  Remove asan incompatible options
2018-08-03 14:11:18 +02:00
Anatol Belski df5e09c5a8 Use inliner cache also for non ext/sapi sources 2018-08-03 12:36:19 +02:00
Christoph M. Becker 57ccfab1d4 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update UPGRADING.INTERNALS wrt. Same Site Cookies
2018-08-03 10:53:07 +02:00
Anatol Belski 9d89cf95d3 Missing piece for the inliner cache 2018-08-03 10:20:03 +02:00
Anatol Belski c389fc6117 Merge branch 'PHP-7.3'
* PHP-7.3:
  Update maintainer info [skip ci]
2018-08-03 07:50:00 +02:00
Anatol Belski cf21a505a6 Merge branch 'PHP-7.3'
* PHP-7.3:
  Improve cleanup
2018-08-03 07:12:13 +02:00
Gabriel Caruso 0e0019f694 Remove superfluous checks of always available functions 2018-08-03 00:13:01 -03:00
Anatol Belski 7b184d320c Merge branch 'PHP-7.3'
* PHP-7.3:
2018-08-02 21:41:07 +02:00
Anatol Belski e018a1c98a Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix callbacks
  bump version
2018-08-02 21:25:29 +02:00
Anatol Belski 580103cb13 Merge branch 'PHP-7.3'
* PHP-7.3:
  Cleanup unused items
2018-08-02 18:29:33 +02:00
Sara Golemon f895525160 Merge branch 'PHP-7.3'
* PHP-7.3:
  Roll NEWS for 7.2.10
2018-08-02 11:24:29 -04:00
Anatol Belski 309ae35773 Enable inline reader cache 2018-08-02 16:29:59 +02:00
Christoph M. Becker 9ad039a180 Merge branch 'PHP-7.3'
* PHP-7.3:
  [ci skip] Fix wrong dash character in UPGRADING
2018-08-02 14:13:40 +02:00
Christoph M. Becker c9861bd7a9 Create and expose php_sys_symlink() and php_sys_link()
These macros are supposed to behave like POSIX's symlink() and link(),
respectively, on POSIX compliant systems and on Windows.

Future scope: merge link.c and link_win32.c
2018-08-02 14:08:30 +02:00
Gabriel Caruso 1fe59810fe Make test run on non zts builds 2018-08-01 23:14:56 -03:00
Gabriel Caruso 7f9e10f539 Remove invalid SKIPIF sections 2018-08-01 22:39:00 -03:00
Gabriel Caruso dc4e47710b Give a reason why the test was skipped
A follow up for c93aba04
2018-08-01 22:18:57 -03:00
BohwaZ 6f9ebe677b Add \PDO::SQLITE_ATTR_READONLY_STATEMENT
This attribute is a boolean value. It is taken from the return value of
sqlite3_stmt_readonly(), indicating if and only if the prepared statement makes
no direct changes to the content of the database.
2018-08-01 17:45:20 -04:00
Anatol Belski 1a303f1a2b Merge branch 'PHP-7.3'
* PHP-7.3:
  Suppress more irrelevant clang warnings
2018-08-01 18:19:50 +02:00
Christoph M. Becker 3d4fbdade4 Remove needless version checks
As of PHP 5.5.3, we're requiring ICU ≥ 4.0[1] anyway, so there's no
need to check for ICU 3.x.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=8831b00>
2018-08-01 17:53:38 +02:00
Anatol Belski 3d7b0b6f92 Merge branch 'PHP-7.3'
* PHP-7.3:
  Unused var
2018-08-01 16:45:39 +02:00
Anatol Belski 2d71a28954 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix clang compilation
2018-08-01 16:24:07 +02:00
Xinchen Hui 85145e509e Unused var 2018-08-01 14:49:06 +08:00
Stanislav Malyshev 3ea095ab00 [ci skip] Typo 2018-07-31 22:41:11 -07:00
Stanislav Malyshev 65167f1c7d [ci skip] Ugh, whitespace 2018-07-31 12:44:51 -07:00
Stanislav Malyshev 201022c347 [ci skip] Clarify difference between security & regular bugfixes 2018-07-31 12:43:22 -07:00
Anatol Belski f8357f9e80 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix length to copy
2018-07-31 17:32:49 +02:00
Christoph M. Becker 7866f28173 UPDATE README.GIT-RULES wrt. PHP-7.3
We also add a respective note to README.RELEASE_PROCESS, so this won't
get overlooked again.
2018-07-31 17:06:44 +02:00
Christoph M. Becker bccf0dfba1 Prepare UPGRADING(.INTERNALS) for PHP 7.4
We also add this as task to README.RELEASE_PROCESS, so that it's not
overlooked next time.
2018-07-31 15:54:03 +02:00
Christoph M. Becker d5bd1b5f6b Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix ZEND_EXTENSION_API_NO
2018-07-31 14:11:59 +02:00
Christoph M. Becker 4ed1678540 Fix README.RELEASE_PROCESS
The version has to be updated in configure.ac; by running `./configure`
afterwards, main/php_versions.h will be updated automatically.
2018-07-31 14:09:31 +02:00
Christoph M. Becker a63c99ba62 Prepare for PHP 7.4 2018-07-31 13:56:24 +02:00
Philip Prindeville 80eb9c89b8 Don't need interactive progress on git clones in Travis
Travis logs are usually inspected after the build completes, by which time
progress info is useless.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2018-07-25 13:05:27 -06:00
Dusta 1deda9326e Update Coding style 2018-06-27 18:14:03 +02:00
8122 changed files with 270715 additions and 766270 deletions

No files matched your search

+9
View File
@@ -9,6 +9,13 @@ branches:
clone_depth: 64
skip_commits:
files:
- docs/*
- NEWS
- UPGRADING
- UPGRADING.INTERNALS
cache:
- c:\build-cache
@@ -30,8 +37,10 @@ environment:
matrix:
- THREAD_SAFE: 0
OPCACHE: 0
PARALLEL: -j2
- THREAD_SAFE: 1
OPCACHE: 1
PARALLEL: -j2
INTRINSICS: AVX
services:
+1 -1
View File
@@ -9,7 +9,7 @@ end_of_line = lf
charset = utf-8
tab_width = 4
[{*.{awk,bat,c,cpp,d,h,l,mk,re,skl,w32,y},Makefile*}]
[{*.{awk,bat,c,cpp,d,h,l,re,skl,w32,y},Makefile*}]
indent_size = 4
indent_style = tab
+27 -16
View File
@@ -165,7 +165,7 @@ define ____printzv_contents
set $type = $zvalue->u1.v.type
# 15 == IS_INDIRECT
if $type > 5 && $type != 15
if $type > 5 && $type < 12
printf "(refcount=%d) ", $zvalue->value.counted->gc.refcount
end
@@ -215,12 +215,8 @@ define ____printzv_contents
if ! $arg1
if $handlers->get_properties == &zend_std_get_properties
if $zobj->properties
printf "\nProperties "
set $ht = $zobj->properties
else
set $ht = &$zobj->ce->properties_info
end
printf "\nProperties "
if $ht
set $ind = $ind + 1
____print_ht $ht 1
set $ind = $ind - 1
@@ -230,7 +226,19 @@ define ____printzv_contents
set $i = $i - 1
end
else
echo "not found"
printf " {\n"
set $ht = &$zobj->ce->properties_info
set $k = 0
set $num = $ht->nNumUsed
while $k < $num
set $p = (Bucket*)($ht->arData + $k)
set $name = $p->key
set $prop = (zend_property_info*)$p->val.value.ptr
set $val = (zval*)((char*)$zobj + $prop->offset)
printf "%s => ", $name->val
printzv $val
set $k = $k + 1
end
end
end
end
@@ -250,18 +258,21 @@ define ____printzv_contents
printf "CONSTANT_AST"
end
if $type == 13
printf "_BOOL"
end
if $type == 14
printf "CALLABLE"
end
if $type == 15
printf "indirect: "
____printzv $zvalue->value.zv $arg1
end
if $type == 17
if $type == 14
printf "pointer: %p", $zvalue->value.ptr
end
if $type == 15
printf "_ERROR"
end
if $type == 16
printf "_BOOL"
end
if $type == 17
printf "CALLABLE"
end
if $type == 18
printf "ITERABLE"
end
@@ -269,9 +280,9 @@ define ____printzv_contents
printf "VOID"
end
if $type == 20
printf "_ERROR"
printf "_NUMBER"
end
if $type == 16 || $type > 20
if $type > 20
printf "unknown type %d", $type
end
printf "\n"
+19 -159
View File
@@ -1,159 +1,19 @@
ext/mysqlnd/mysqlnd.h ident
ext/ext_skel.php ident
ext/phar/phar/pharcommand.inc ident
ext/dba/libinifile/inifile.c ident
ext/dba/libflatfile/flatfile.c ident
ext/dba/libcdb/cdb_make.c ident
ext/dba/libcdb/cdb.c ident
run-tests.php ident
NEWS merge=NEWS
UPGRADING merge=NEWS
UPGRADING.INTERNALS merge=NEWS
/ext/bz2/tests/with_strings.phpt -crlf
/ext/dom/tests/bug40836.phpt -crlf
/ext/dom/tests/domelement.phpt -crlf
/ext/iconv/tests/iconv004.phpt -crlf
/ext/iconv/tests/iconv_basic.phpt -crlf
/ext/iconv/tests/iconv_strpos.phpt -crlf
/ext/iconv/tests/iconv_strpos_variation2.phpt -crlf
/ext/mbstring/tests/mb_strtoupper_error2.phpt -crlf
/ext/phar/tests/delete_in_phar_confirm.phpt -crlf
/ext/phar/tests/frontcontroller12.phpt -crlf
/ext/phar/tests/security.phpt -crlf
/ext/phar/tests/test_signaturealgos.phpt -crlf
/ext/reflection/tests/ReflectionMethod_invokeArgs_basic.phpt -crlf
/ext/reflection/tests/ReflectionProperty_getModifiers_basic.phpt -crlf
/ext/spl/tests/dllist_007.phpt -crlf
/ext/spl/tests/iterator_012.phpt -crlf
/ext/spl/tests/SplArray_fromArray.phpt -crlf
/ext/standard/tests/dir/scandir_variation3.phpt -crlf
/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt -crlf
/ext/standard/tests/strings/bug26817.phpt -crlf
/ext/standard/tests/strings/bug26973.phpt -crlf
/ext/standard/tests/strings/bug27457.phpt -crlf
/ext/standard/tests/strings/bug28386.phpt -crlf
/ext/standard/tests/strings/bug37262.phpt -crlf
/ext/standard/tests/strings/bug40637.phpt -crlf
/ext/standard/tests/strings/bug40915.phpt -crlf
/ext/standard/tests/strings/bug61374.phpt -crlf
/ext/standard/tests/strings/chop_error.phpt -crlf
/ext/standard/tests/strings/chop_variation2.phpt -crlf
/ext/standard/tests/strings/chunk_split_variation10.phpt -crlf
/ext/standard/tests/strings/chunk_split_variation8.phpt -crlf
/ext/standard/tests/strings/count_chars_variation2.phpt -crlf
/ext/standard/tests/strings/dirname_error.phpt -crlf
/ext/standard/tests/strings/fprintf_variation_007_64bit.phpt -crlf
/ext/standard/tests/strings/highlight_file.phpt -crlf
/ext/standard/tests/strings/htmlentities03.phpt -crlf
/ext/standard/tests/strings/htmlentities04.phpt -crlf
/ext/standard/tests/strings/htmlentities08.phpt -crlf
/ext/standard/tests/strings/htmlentities15.phpt -crlf
/ext/standard/tests/strings/http_build_query.phpt -crlf
/ext/standard/tests/strings/metaphone.phpt -crlf
/ext/standard/tests/strings/ord_error.phpt -crlf
/ext/standard/tests/strings/printf_basic2.phpt -crlf
/ext/standard/tests/strings/printf_variation2.phpt -crlf
/ext/standard/tests/strings/quoted_printable_decode_basic.phpt -crlf
/ext/standard/tests/strings/rtrim.phpt -crlf
/ext/standard/tests/strings/setlocale_variation1.phpt -crlf
/ext/standard/tests/strings/sha1_basic.phpt -crlf
/ext/standard/tests/strings/similar_text_basic.phpt -crlf
/ext/standard/tests/strings/soundex.phpt -crlf
/ext/standard/tests/strings/sprintf_basic1.phpt -crlf
/ext/standard/tests/strings/sprintf_basic4.phpt -crlf
/ext/standard/tests/strings/sprintf_basic7.phpt -crlf
/ext/standard/tests/strings/sprintf_variation12.phpt -crlf
/ext/standard/tests/strings/sprintf_variation28.phpt -crlf
/ext/standard/tests/strings/sprintf_variation29.phpt -crlf
/ext/standard/tests/strings/sprintf_variation30.phpt -crlf
/ext/standard/tests/strings/sprintf_variation31.phpt -crlf
/ext/standard/tests/strings/sprintf_variation38.phpt -crlf
/ext/standard/tests/strings/sprintf_variation42.phpt -crlf
/ext/standard/tests/strings/sprintf_variation6.phpt -crlf
/ext/standard/tests/strings/sscanf_basic2.phpt -crlf
/ext/standard/tests/strings/sscanf_basic3.phpt -crlf
/ext/standard/tests/strings/str_getcsv_001.phpt -crlf
/ext/standard/tests/strings/stripcslashes_basic.phpt -crlf
/ext/standard/tests/strings/stripos_variation11.phpt -crlf
/ext/standard/tests/strings/stripos_variation13.phpt -crlf
/ext/standard/tests/strings/stripslashes_variation1.phpt -crlf
/ext/standard/tests/strings/stripslashes_variation2.phpt -crlf
/ext/standard/tests/strings/stristr_error.phpt -crlf
/ext/standard/tests/strings/strnatcasecmp_basic.phpt -crlf
/ext/standard/tests/strings/strncasecmp_variation6.phpt -crlf
/ext/standard/tests/strings/strncasecmp_variation7.phpt -crlf
/ext/standard/tests/strings/strncasecmp_variation8.phpt -crlf
/ext/standard/tests/strings/strrchr_error.phpt -crlf
/ext/standard/tests/strings/strrchr.phpt -crlf
/ext/standard/tests/strings/strrchr_variation11.phpt -crlf
/ext/standard/tests/strings/strrpos_error.phpt -crlf
/ext/standard/tests/strings/strrpos_variation4.phpt -crlf
/ext/standard/tests/strings/strrpos_variation8.phpt -crlf
/ext/standard/tests/strings/strstr2.phpt -crlf
/ext/standard/tests/strings/strtok_error.phpt -crlf
/ext/standard/tests/strings/strtok_variation2.phpt -crlf
/ext/standard/tests/strings/strtolower-win32.phpt -crlf
/ext/standard/tests/strings/substr_compare.phpt -crlf
/ext/standard/tests/strings/ucwords_variation1.phpt -crlf
/ext/standard/tests/strings/unpack.phpt -crlf
/ext/standard/tests/strings/vfprintf_basic7_64bit.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation11_64bit.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation12_64bit.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation12.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation13_64bit.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation7.phpt -crlf
/ext/standard/tests/strings/vprintf_basic2.phpt -crlf
/ext/standard/tests/strings/vprintf_basic7_64bit.phpt -crlf
/ext/standard/tests/strings/vprintf_variation10.phpt -crlf
/ext/standard/tests/strings/vprintf_variation14_64bit.phpt -crlf
/ext/standard/tests/strings/vprintf_variation17.phpt -crlf
/ext/standard/tests/strings/vprintf_variation4.phpt -crlf
/ext/standard/tests/strings/vsprintf_basic4.phpt -crlf
/ext/standard/tests/strings/vsprintf_basic8.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation12_64bit.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation13_64bit.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation15_64bit.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation17.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation4_64bit.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation7.phpt -crlf
/ext/standard/tests/strings/wordwrap.phpt -crlf
/ext/standard/tests/strings/wordwrap_variation5.phpt -crlf
/ext/standard/tests/url/rawurldecode_variation_001.phpt -crlf
/ext/tidy/tests/009.phpt -crlf
/ext/tidy/tests/013.phpt -crlf
/ext/tidy/tests/021.phpt -crlf
/ext/tidy/tests/tidy_error.phpt -crlf
/ext/tokenizer/tests/002.phpt -crlf
/ext/tokenizer/tests/bug26463.phpt -crlf
/ext/tokenizer/tests/token_get_all_error.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation11.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation12.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation13.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation14.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation15.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation18.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation19.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation1.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation2.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation3.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation5.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation8.phpt -crlf
/ext/xml/tests/bug32001b.phpt -crlf
/ext/xmlwriter/tests/OO_003.phpt -crlf
/ext/xmlwriter/tests/xmlwriter_write_attribute_ns_error_001.phpt -crlf
/ext/zlib/tests/008.phpt -crlf
/ext/zlib/tests/gzopen_variation4.phpt -crlf
/ext/zlib/tests/gzrewind_error.phpt -crlf
/ext/zlib/tests/readgzfile_variation7.phpt -crlf
/ext/zlib/tests/readgzfile_variation8.phpt -crlf
/ext/zlib/tests/zlib_scheme_stat_basic.phpt -crlf
/sapi/cli/tests/006.phpt -crlf
/tests/run-test/test009.phpt -crlf
/Zend/tests/012.phpt -crlf
/Zend/tests/bug28072.phpt -crlf
/Zend/tests/bug38624.phpt -crlf
/Zend/tests/bug40784.phpt -crlf
/Zend/tests/bug43053.phpt -crlf
/Zend/tests/bug51176.phpt -crlf
/Zend/tests/each_003.phpt -crlf
/Zend/tests/errmsg_006.phpt -crlf
# Replace $Id$ strings with 40-character hexadecimal blob object name.
/ext/ext_skel.php ident
/ext/phar/phar/pharcommand.inc ident
/ext/dba/libinifile/inifile.c ident
/ext/dba/libflatfile/flatfile.c ident
/ext/dba/libcdb/cdb_make.c ident
/ext/dba/libcdb/cdb.c ident
/run-tests.php ident
# A custom merge driver to avoid automatic merges. These are manually merged.
# See https://wiki.php.net/vcs/gitfaq
/NEWS merge=NEWS
/UPGRADING merge=NEWS
/UPGRADING.INTERNALS merge=NEWS
# Enable commit diffs for binary PHP test files. Some PHP test files include
# special characters, such as ASCII control characters. Git recognizes these as
# binary and wouldn't generate diffs.
*.phpt diff
+252 -179
View File
@@ -1,197 +1,224 @@
# General ignores
# These files are generated during building or development and are intentionally
# untracked to ignore by Git. For other development environment specific files,
# such as editor configuration, a good practice is to exclude them using the
# .git/info/exclude in the cloned repository or a global .gitignore file.
# ------------------------------------------------------------------------------
# Common files ignored across the repository
# ------------------------------------------------------------------------------
# Backup copies created by various editors or development tools
*~
.#*
*.
*.slo
*.mk
*.mem
*.gcda
*.gcno
*.la
*.lo
*.loT
*.o
*.a
*.ncb
*.opt
*.plg
*swp
# Patches downloaded to patch files or to apply open source contributions
*.patch
*.tgz
*.tar.gz
*.tar.bz2
*.tar.xz
*.tar.gz.asc
*.tar.bz2.asc
*.tar.xz.asc
.FBCIndex
.FBCLockFolder
.libs
phpt.*
core
dynlib.m4
# Swap files created by editors and tools to indicate a locked file
*.swp
# Various temporary generated files
*.tmp
# ------------------------------------------------------------------------------
# Generated by the PHP build system
# ------------------------------------------------------------------------------
# Archive library containing .o files, generated during build process
*.a
# Libtool library files generated during build process
*.la
# Directories created by Libtool for storing generated library files
.libs/
# Library object files generated during build process
*.lo
# Temporary library object files generated by compiler and libtool due to failure
*.loT
# Standard object files generated during build process
*.o
# Cache directories created by Autoconf tools
autom4te.cache/
# Cache file(s) generated by Autoconf's configure when run as `configure -C`
config.cache
# A log file(s) generated by Autoconf during *nix build system
config.log
# Helper(s) generated by *nix build system to save the last configure command
config.nice
# Generated by Autoconf's configure script for instantiating templates
config.status
# Main *nix build system configuration script(s) generated by Autoconf
configure
# Generated by `./configure` when test programs create temporary files
confdefs.h
conftest*
# Generated by configure scripts on all systems
/main/internal_functions.c
/main/internal_functions_cli.c
# The Libtool script(s) generated by the *nix build system
libtool
# Makefile(s) generated from Makefile fragment templates by `./configure`
Makefile
Makefile.fragments
Makefile.objects
_libs
acconfig.h
aclocal.m4
autom4te.cache
bsd_converted
buildconf.stamp
buildmk.stamp
confdefs.h
# Directories for shared object files and headers generated by `./configure`
include/
libs/
modules/
# ------------------------------------------------------------------------------
# Configuration headers generated by the PHP build system
# ------------------------------------------------------------------------------
config.h
config.guess
config.cache
config.h.in
config.log
config.nice
config.status
config.sub
config_vars.mk
configuration-parser.c
configuration-parser.h
configuration-parser.output
configuration-scanner.c
configure
conftest
conftest.c
debug.log
diff
generated_lists
include
install-sh
internal_functions.c
lcov_data
lcov_html
libs
libtool
meta_cc
meta_ccld
missing
mkinstalldirs
modules
/ext/date/lib/timelib_config.h
/ext/iconv/php_have_bsd_iconv.h
/ext/iconv/php_have_glibc_iconv.h
/ext/iconv/php_have_ibm_iconv.h
/ext/iconv/php_have_iconv.h
/ext/iconv/php_have_libiconv.h
/ext/iconv/php_iconv_aliased_libiconv.h
/ext/iconv/php_iconv_broken_ignore.h
/ext/iconv/php_iconv_supports_errno.h
/ext/iconv/php_php_iconv_h_path.h
/ext/iconv/php_php_iconv_impl.h
/main/build-defs.h
/main/php_config.h.in
/main/php_config.h
/Zend/zend_config.h
# ------------------------------------------------------------------------------
# Manual (man 1 and 8) pages generated from templates for *nix alike systems
# ------------------------------------------------------------------------------
/ext/phar/phar.1
/ext/phar/phar.phar.1
/sapi/cgi/php-cgi.1
/sapi/cli/php.1
/sapi/fpm/php-fpm.1
/sapi/fpm/php-fpm.8
/sapi/phpdbg/phpdbg.1
/scripts/man1/*.1
# ------------------------------------------------------------------------------
# SAPIs specific ignores
# ------------------------------------------------------------------------------
/sapi/apache2handler/libphp7.module
/sapi/fpm/fpm/php-cgi
/sapi/fpm/init.d.php-fpm
/sapi/fpm/php-fpm.conf
/sapi/fpm/php-fpm.service
/sapi/fpm/status.html
/sapi/fpm/www.conf
# ------------------------------------------------------------------------------
# Executable binaries and scripts generated during the build process
# ------------------------------------------------------------------------------
/ext/phar/phar.phar
/ext/phar/phar.php
/pear/install-pear-nozlib.phar
/sapi/cgi/php-cgi
/sapi/fpm/php-fpm
/sapi/phpdbg/phpdbg
/scripts/php-config
/scripts/phpize
php
php7.spec
php_lcov.info
php_test_results_*.txt
php_version.h
results.txt
shlibtool
stamp-h
test.php3
tmp-php.ini
stamp-h.in
scan_makefile_in.awk
main/php_config.h
main/php_config.h.in
main/build-defs.h
main/internal_functions_cli.c
main/config.w32.h
main/stamp-h1
main/streams/build-defs.h
main/streams/stamp-h1
pear/install-pear-nozlib.phar
pear/phpize
pear/run-tests
pear/php-config
pear/scripts
sapi/apache2handler/libphp7.module
sapi/cgi/php-cgi
sapi/cgi/php-cgi.1
sapi/cli/php.1
sapi/fpm/php-fpm
sapi/fpm/php-fpm.1
sapi/fpm/init.d.php-fpm
sapi/fpm/php-fpm.conf
sapi/fpm/fpm/php-cgi
sapi/fpm/php-fpm.8
sapi/fpm/php-fpm.service
sapi/fpm/status.html
sapi/fpm/www.conf
sapi/phpdbg/phpdbg_parser.c
sapi/phpdbg/phpdbg_parser.h
sapi/phpdbg/phpdbg
sapi/phpdbg/phpdbg.1
sapi/phpdbg/build
sapi/phpdbg/*.output
scripts/php-config
scripts/phpize
scripts/man1/*.1
TSRM/tsrm_config.h
win32/*.suo
win32/*.aps
win32/*.positions
win32/ext
win32/phpts.def
win32/wsyslog.h
Zend/zend_config.h
Zend/zend_dtrace_gen.h
Zend/zend_dtrace_gen.hbak
Zend/zend_ini_parser.c
Zend/zend_ini_parser.h
Zend/zend_ini_parser.output
Zend/zend_language_parser.c
Zend/zend_language_parser.h
Zend/zend_language_parser.output
# Extension specific ignores
ext/*/configure.ac
ext/*/ltmain.sh
ext/*/libs.mk
ext/*/build
ext/*/scan_makefile_in.awk
ext/*/Makefile.global
ext/*/acinclude.m4
ext/*/config.sub
ext/date/lib/timelib_config.h
ext/iconv/php_have_bsd_iconv.h
ext/iconv/php_have_ibm_iconv.h
ext/iconv/php_have_libiconv.h
ext/iconv/php_php_iconv_h_path.h
ext/iconv/php_have_glibc_iconv.h
ext/iconv/php_php_iconv_impl.h
ext/iconv/php_have_iconv.h
ext/iconv/php_iconv_supports_errno.h
ext/iconv/php_iconv_broken_ignore.h
ext/iconv/php_iconv_aliased_libiconv.h
ext/mbstring/oniguruma/oniguruma.h
ext/oci8/tests/*.vglog
ext/pdo/conftest*
ext/pdo_firebird/conftest*
ext/pdo_mysql/conftest*
ext/pdo_oci/conftest*
ext/pdo_odbc/tests/*.mdb
ext/pdo_pgsql/conftest*
ext/pdo_sqlite/conftest*
ext/pdo_sqlite/sqlite3.h
ext/phar/phar.phar
ext/phar/phar.1
ext/phar/phar.phar.1
ext/phar/phar.php
ext/reflection/xml
ext/reflection/html
ext/reflection/spl.chm
ext/spl/examples/.htaccess
ext/spl/examples/*.phps
ext/sqlite3/tests/phpsql*
# ------------------------------------------------------------------------------
# Lexer files generated by re2c
# ------------------------------------------------------------------------------
/ext/json/json_scanner.c
/ext/json/php_json_scanner_defs.h
/ext/pdo/pdo_sql_parser.c
/ext/phar/phar_path_check.c
/ext/standard/url_scanner_ex.c
/ext/standard/var_unserializer.c
/sapi/phpdbg/phpdbg_lexer.c
/Zend/zend_ini_scanner.c
/Zend/zend_ini_scanner_defs.h
/Zend/zend_language_scanner.c
/Zend/zend_language_scanner_defs.h
# ------------------------------------------------------------------------------
# PHP parser files generated by bison during the build process
# ------------------------------------------------------------------------------
/ext/json/json_parser.tab.h
/ext/json/json_parser.tab.c
/sapi/phpdbg/phpdbg_parser.c
/sapi/phpdbg/phpdbg_parser.h
/sapi/phpdbg/phpdbg_parser.output
/Zend/zend_ini_parser.c
/Zend/zend_ini_parser.h
/Zend/zend_ini_parser.output
/Zend/zend_language_parser.c
/Zend/zend_language_parser.h
/Zend/zend_language_parser.output
# ------------------------------------------------------------------------------
# Extensions files additionally generated by `cd ext/name && phpize && ./configure`
# ------------------------------------------------------------------------------
/ext/*/build/
/ext/*/configure.ac
/ext/*/run-tests.php
# ------------------------------------------------------------------------------
# Generated by Windows build system
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------ Windows
# Generated by `/buildconf.bat`
/configure.bat
/configure.js
# Generated by `/configure.(bat|js)` (architecture dependend)
/config.nice.bat
# NTS debug build x86
/Debug/
# ZTS debug build x86
/Debug_TS/
# NTS build x86
/Release/
# ZTS build x86
/Release_TS/
# Generated by x64 compiler, includes Debug, Debug_TS, Release, Release_TS
/x64/
# ------------------------------------------------------------------------------ Tests
# Generated by `/run-tests.php` upon failure
# Miscellaneous files generated by Windows build sytem
/main/config.w32.h
/win32/build/deplister.exe
/win32/build/deplister.obj
/win32/*.aps
/win32/*.positions
/win32/*.suo
/win32/ext
/win32/syslog.reg
/win32/wsyslog.h
# Standard object files generated by Visual Studio
*.obj
# ------------------------------------------------------------------------------
# Tests
# ------------------------------------------------------------------------------
# Generated by `./run-tests.php` upon failure
**/tests/**/*.diff
**/tests/**/*.out*
**/tests/**/*.php
@@ -199,12 +226,58 @@ ext/sqlite3/tests/phpsql*
**/tests/**/*.log
**/tests/**/*.sh
# Used by some test cases.
# Generated by some test cases
**/tests/**/*.db
**/tests/**/*.txt
**/tests/**/*.tmp
# Special cases to invert previous ignore rules
!ext/fileinfo/libmagic.patch
!ext/mbstring/oniguruma.patch
!ext/pcre/pcre2lib/config.h
# Microsoft Access database created for passing to tests
/ext/pdo_odbc/tests/*.mdb
# Files generated by `./run-tests.php -m` when checking for memory leaks
**/tests/**/*.mem
# Test results generated by `./run-tests.php`
php_test_results_*.txt
# Temporary POST data placeholder files generated by `./run-tests.php`
phpt.*
# Temporary PHP INI configuration file(s) for tests, generated by `make test`
tmp-php.ini
# ------------------------------------------------------------------------------
# Generated by GCC's gcov and LCOV via build/Makefile.gcov and gcov.php.net
# ------------------------------------------------------------------------------
*.gcda
*.gcno
/gcovr.xml
/gcovr_html/
/lcov_html/
/php_lcov.info
# ------------------------------------------------------------------------------
# Archives generated during the PHP release process
# ------------------------------------------------------------------------------
/*.tar.gz
/*.tar.bz2
/*.tar.xz
/*.tar.gz.asc
/*.tar.bz2.asc
/*.tar.xz.asc
# ------------------------------------------------------------------------------
# Generated by `./configure --enable-dtrace` for using DTrace framework
# ------------------------------------------------------------------------------
/ext/oci8/oci8_dtrace_gen.h
/ext/oci8/oci8_dtrace_gen.h.bak
/Zend/zend_dtrace_gen.h
/Zend/zend_dtrace_gen.h.bak
# ------------------------------------------------------------------------------
# Special cases to invert previous ignore patterns
# ------------------------------------------------------------------------------
!/ext/bcmath/libbcmath/src/config.h
!/ext/fileinfo/libmagic/config.h
!/ext/fileinfo/libmagic.patch
!/ext/fileinfo/magicdata.patch
!/ext/pcre/pcre2lib/config.h
!/win32/build/Makefile
+37 -16
View File
@@ -1,7 +1,7 @@
git:
quiet: true
dist: trusty
dist: xenial
language: c
sudo: required
addons:
@@ -10,18 +10,35 @@ addons:
- locales
- language-pack-de
- re2c
- ccache
- mysql-server
- libaspell-dev
- libbz2-dev
- libcurl4-gnutls-dev
- libenchant-dev
- libfreetype6-dev
- libgmp-dev
- libicu-dev
- libtidy-dev
- libenchant-dev
- libaspell-dev
- libjpeg-dev
- libkrb5-dev
- libonig-dev
- libpng-dev
- libpq-dev
- libpspell-dev
- librecode-dev
- libsasl2-dev
- libsqlite3-dev
- libtidy-dev
- libwebp-dev
- libxml2-dev
- libxpm-dev
- libt1-dev
- libxslt1-dev
- libzip-dev
services:
- mysql
- postgresql
notifications:
email:
on_failure: change
@@ -45,10 +62,17 @@ env:
- PDO_MYSQL_TEST_USER=travis
- PDO_MYSQL_TEST_PASS=
- PDO_MYSQL_TEST_HOST=127.0.0.1
- PDO_PGSQL_TEST_DSN="pgsql:host=localhost port=5432 dbname=test user=postgres password="
- REPORT_EXIT_STATUS=1
matrix:
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
jobs:
include:
- env: ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
arch: amd64
- env: ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
arch: amd64
- env: ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 ARM64=1
arch: arm64
before_script:
- ccache --version
@@ -57,17 +81,14 @@ before_script:
# Enable IPv6
- sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
# Compile PHP
- ./travis/compile.sh
- travis_wait ./travis/compile.sh
# Setup Extensions
- . ./travis/ext/mysql/setup.sh
- . ./travis/ext/mysqli/setup.sh
- . ./travis/ext/pdo_mysql/setup.sh
- . ./travis/ext/pgsql/setup.sh
- . ./travis/ext/pdo_pgsql/setup.sh
- ./travis/setup-mysql.sh
- ./travis/setup-pgsql.sh
# Run PHPs run-tests.php
script:
- ./sapi/cli/php run-tests.php -P -d extension=`pwd`/modules/zend_test.so $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120
- ./sapi/cli/php run-tests.php -P -d extension=`pwd`/modules/zend_test.so $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d opcache.protect_memory=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120 -j$(nproc)
- sapi/cli/php -d extension_dir=`pwd`/modules -r 'dl("zend_test");'
after_success:
-322
View File
@@ -1,322 +0,0 @@
========================
PHP Coding Standards
========================
This file lists several standards that any programmer adding or changing
code in PHP should follow. Since this file was added at a very late
stage of the development of PHP v3.0, the code base does not fully
follow it, but new features are going in that general direction. Many
sections have been recoded to use these rules.
Code Implementation
-------------------
0. Document your code in source files and the manual. [tm]
1. Functions that are given pointers to resources should not free them
For instance, ``function int mail(char *to, char *from)`` should NOT free
to and/or from.
Exceptions:
- The function's designated behavior is freeing that resource. E.g. efree()
- The function is given a boolean argument, that controls whether or not
the function may free its arguments (if true - the function must free its
arguments, if false - it must not)
- Low-level parser routines, that are tightly integrated with the token
cache and the bison code for minimum memory copying overhead.
2. Functions that are tightly integrated with other functions within the
same module, and rely on each other non-trivial behavior, should be
documented as such and declared 'static'. They should be avoided if
possible.
3. Use definitions and macros whenever possible, so that constants have
meaningful names and can be easily manipulated. The only exceptions
to this rule are 0 and 1, when used as false and true (respectively).
Any other use of a numeric constant to specify different behavior
or actions should be done through a #define.
4. When writing functions that deal with strings, be sure to remember
that PHP holds the length property of each string, and that it
shouldn't be calculated with strlen(). Write your functions in such
a way so that they'll take advantage of the length property, both
for efficiency and in order for them to be binary-safe.
Functions that change strings and obtain their new lengths while
doing so, should return that new length, so it doesn't have to be
recalculated with strlen() (e.g. php_addslashes())
5. NEVER USE strncat(). If you're absolutely sure you know what you're doing,
check its man page again, and only then, consider using it, and even then,
try avoiding it.
6. Use ``PHP_*`` macros in the PHP source, and ``ZEND_*`` macros in the Zend
part of the source. Although the ``PHP_*`` macro's are mostly aliased to the
``ZEND_*`` macros it gives a better understanding on what kind of macro
you're calling.
7. When commenting out code using a #if statement, do NOT use 0 only. Instead
use "<git username here>_0". For example, #if FOO_0, where FOO is your
git user foo. This allows easier tracking of why code was commented out,
especially in bundled libraries.
8. Do not define functions that are not available. For instance, if a
library is missing a function, do not define the PHP version of the
function, and do not raise a run-time error about the function not
existing. End users should use function_exists() to test for the
existence of a function
9. Prefer emalloc(), efree(), estrdup(), etc. to their standard C library
counterparts. These functions implement an internal "safety-net"
mechanism that ensures the deallocation of any unfreed memory at the
end of a request. They also provide useful allocation and overflow
information while running in debug mode.
In almost all cases, memory returned to the engine must be allocated
using emalloc().
The use of malloc() should be limited to cases where a third-party
library may need to control or free the memory, or when the memory in
question needs to survive between multiple requests.
User Functions/Methods Naming Conventions
------------------
1. Function names for user-level functions should be enclosed with in
the PHP_FUNCTION() macro. They should be in lowercase, with words
underscore delimited, with care taken to minimize the letter count.
Abbreviations should not be used when they greatly decrease the
readability of the function name itself::
Good:
'str_word_count'
'array_key_exists'
Ok:
'date_interval_create_from_date_string'
(could be 'date_intvl_create_from_date_str'?)
'get_html_translation_table'
(could be 'html_get_trans_table'?)
Bad:
'hw_GetObjectByQueryCollObj'
'pg_setclientencoding'
'jf_n_s_i'
2. If they are part of a "parent set" of functions, that parent should
be included in the user function name, and should be clearly related
to the parent program or function family. This should be in the form
of ``parent_*``::
A family of 'foo' functions, for example:
Good:
'foo_select_bar'
'foo_insert_baz'
'foo_delete_baz'
Bad:
'fooselect_bar'
'fooinsertbaz'
'delete_foo_baz'
3. Function names used by user functions should be prefixed
with ``_php_``, and followed by a word or an underscore-delimited list of
words, in lowercase letters, that describes the function. If applicable,
they should be declared 'static'.
4. Variable names must be meaningful. One letter variable names must be
avoided, except for places where the variable has no real meaning or
a trivial meaning (e.g. for (i=0; i<100; i++) ...).
5. Variable names should be in lowercase. Use underscores to separate
between words.
6. Method names follow the 'studlyCaps' (also referred to as 'bumpy case'
or 'camel caps') naming convention, with care taken to minimize the
letter count. The initial letter of the name is lowercase, and each
letter that starts a new 'word' is capitalized::
Good:
'connect()'
'getData()'
'buildSomeWidget()'
Bad:
'get_Data()'
'buildsomewidget'
'getI()'
7. Class names should be descriptive nouns in PascalCase and as short as
possible. Each word in the class name should start with a capital letter,
without underscore delimiters. The class name should be prefixed with the
name of the "parent set" (e.g. the name of the extension) if no namespaces
are used. Abbreviations and acronyms as well as initialisms should be
avoided wherever possible, unless they are much more widely used than the
long form (e.g. HTTP or URL). Abbreviations start with a capital letter
followed by lowercase letters, whereas acronyms and initialisms are written
according to their standard notation. Usage of acronyms and initialisms is
not allowed if they are not widely adopted and recognized as such.
Good:
'Curl'
'CurlResponse'
'HTTPStatusCode'
'URL'
'BTreeMap' (B-tree Map)
'Id' (Identifier)
'ID' (Identity Document)
'Char' (Character)
'Intl' (Internationalization)
'Radar' (Radio Detecting and Ranging)
Bad:
'curl'
'curl_response'
'HttpStatusCode'
'Url'
'BtreeMap'
'ID' (Identifier)
'CHAR'
'INTL'
'RADAR' (Radio Detecting and Ranging)
Internal Function Naming Conventions
----------------------
1. Functions that are part of the external API should be named
'php_modulename_function()' to avoid symbol collision. They should be in
lowercase, with words underscore delimited. Exposed API must be defined
in 'php_modulename.h'.
PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS);
Unexposed module function should be static and should not be defined in
'php_modulename.h'.
static int php_session_destroy()
2. Main module source file must be named 'modulename.c'.
3. Header file that is used by other sources must be named 'php_modulename.h'.
Syntax and indentation
----------------------
1. Never use C++ style comments (i.e. // comment). Always use C-style
comments instead. PHP is written in C, and is aimed at compiling
under any ANSI-C compliant compiler. Even though many compilers
accept C++-style comments in C code, you have to ensure that your
code would compile with other compilers as well.
The only exception to this rule is code that is Win32-specific,
because the Win32 port is MS-Visual C++ specific, and this compiler
is known to accept C++-style comments in C code.
2. Use K&R-style. Of course, we can't and don't want to
force anybody to use a style he or she is not used to, but,
at the very least, when you write code that goes into the core
of PHP or one of its standard modules, please maintain the K&R
style. This applies to just about everything, starting with
indentation and comment styles and up to function declaration
syntax. Also see Indentstyle.
Indentstyle: http://www.catb.org/~esr/jargon/html/I/indent-style.html
3. Be generous with whitespace and braces. Keep one empty line between the
variable declaration section and the statements in a block, as well as
between logical statement groups in a block. Maintain at least one empty
line between two functions, preferably two. Always prefer::
if (foo) {
bar;
}
to:
if(foo)bar;
4. When indenting, use the tab character. A tab is expected to represent
four spaces. It is important to maintain consistency in indenture so
that definitions, comments, and control structures line up correctly.
5. Preprocessor statements (#if and such) MUST start at column one. To
indent preprocessor directives you should put the # at the beginning
of a line, followed by any number of whitespace.
Testing
-------
1. Extensions should be well tested using *.phpt tests. Read about that
in README.TESTING.
Documentation and Folding Hooks
-------------------------------
In order to make sure that the online documentation stays in line with
the code, each user-level function should have its user-level function
prototype before it along with a brief one-line description of what the
function does. It would look like this::
/* {{{ proto int abs(int number)
Returns the absolute value of the number */
PHP_FUNCTION(abs)
{
...
}
/* }}} */
The {{{ symbols are the default folding symbols for the folding mode in
Emacs and vim (set fdm=marker). Folding is very useful when dealing with
large files because you can scroll through the file quickly and just unfold
the function you wish to work on. The }}} at the end of each function marks
the end of the fold, and should be on a separate line.
The "proto" keyword there is just a helper for the doc/genfuncsummary script
which generates a full function summary. Having this keyword in front of the
function prototypes allows us to put folds elsewhere in the code without
messing up the function summary.
Optional arguments are written like this::
/* {{{ proto object imap_header(int stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]])
Returns a header object with the defined parameters */
And yes, please keep the prototype on a single line, even if that line
is massive.
New and Experimental Functions
-----------------------------------
To reduce the problems normally associated with the first public
implementation of a new set of functions, it has been suggested
that the first implementation include a file labeled 'EXPERIMENTAL'
in the function directory, and that the functions follow the
standard prefixing conventions during their initial implementation.
The file labelled 'EXPERIMENTAL' should include the following
information::
Any authoring information (known bugs, future directions of the module).
Ongoing status notes which may not be appropriate for Git comments.
In general new features should go to PECL or experimental branches until
there are specific reasons for directly adding it to the core distribution.
Aliases & Legacy Documentation
-----------------------------------
You may also have some deprecated aliases with close to duplicate
names, for example, somedb_select_result and somedb_selectresult. For
documentation purposes, these will only be documented by the most
current name, with the aliases listed in the documentation for
the parent function. For ease of reference, user-functions with
completely different names, that alias to the same function (such as
highlight_file and show_source), will be separately documented. The
proto should still be included, describing which function is aliased.
Backwards compatible functions and names should be maintained as long
as the code can be reasonably be kept as part of the codebase. See the
README in the PHP documentation repository for more information on
documentation.
+342
View File
@@ -0,0 +1,342 @@
# PHP coding standards
This file lists several standards that any programmer adding or changing code in
PHP should follow. Since this file was added at a very late stage of the
development of PHP v3.0, the code base does not fully follow it, but new
features are going in that general direction. Many sections have been recoded to
use these rules.
## Code implementation
1. Document your code in source files and the manual. (tm)
2. Functions that are given pointers to resources should not free them.
For instance, `function int mail(char *to, char *from)` should NOT free to
and/or from.
Exceptions:
* The function's designated behavior is freeing that resource. E.g.
`efree()`
* The function is given a boolean argument, that controls whether or not the
function may free its arguments (if true - the function must free its
arguments, if false - it must not)
* Low-level parser routines, that are tightly integrated with the token
cache and the bison code for minimum memory copying overhead.
3. Functions that are tightly integrated with other functions within the same
module, and rely on each other non-trivial behavior, should be documented as
such and declared `static`. They should be avoided if possible.
4. Use definitions and macros whenever possible, so that constants have
meaningful names and can be easily manipulated. The only exceptions to this
rule are 0 and 1, when used as `false` and `true` (respectively). Any other
use of a numeric constant to specify different behavior or actions should be
done through a `#define`.
5. When writing functions that deal with strings, be sure to remember that PHP
holds the length property of each string, and that it shouldn't be
calculated with `strlen()`. Write your functions in such a way so that
they'll take advantage of the length property, both for efficiency and in
order for them to be binary-safe. Functions that change strings and obtain
their new lengths while doing so, should return that new length, so it
doesn't have to be recalculated with `strlen()` (e.g. `php_addslashes()`).
6. NEVER USE `strncat()`. If you're absolutely sure you know what you're doing,
check its man page again, and only then, consider using it, and even then,
try avoiding it.
7. Use `PHP_*` macros in the PHP source, and `ZEND_*` macros in the Zend part of
the source. Although the `PHP_*` macros are mostly aliased to the `ZEND_*`
macros it gives a better understanding on what kind of macro you're calling.
8. When commenting out code using a `#if` statement, do NOT use `0` only.
Instead use `"<git username here>_0"`. For example, `#if FOO_0`, where `FOO`
is your git user `foo`. This allows easier tracking of why code was
commented out, especially in bundled libraries.
9. Do not define functions that are not available. For instance, if a library is
missing a function, do not define the PHP version of the function, and do
not raise a run-time error about the function not existing. End users should
use `function_exists()` to test for the existence of a function.
10. Prefer `emalloc()`, `efree()`, `estrdup()`, etc. to their standard C library
counterparts. These functions implement an internal "safety-net" mechanism
that ensures the deallocation of any unfreed memory at the end of a request.
They also provide useful allocation and overflow information while running
in debug mode.
In almost all cases, memory returned to the engine must be allocated using
`emalloc()`.
The use of `malloc()` should be limited to cases where a third-party library
may need to control or free the memory, or when the memory in question needs
to survive between multiple requests.
## User functions/methods naming conventions
1. Function names for user-level functions should be enclosed with in the
`PHP_FUNCTION()` macro. They should be in lowercase, with words underscore
delimited, with care taken to minimize the letter count. Abbreviations
should not be used when they greatly decrease the readability of the
function name itself:
Good:
```php
str_word_count
array_key_exists
```
Ok:
```php
date_interval_create_from_date_string
// Could be 'date_intvl_create_from_date_str'?
get_html_translation_table()
// Could be 'html_get_trans_table'?
```
Bad:
```php
hw_GetObjectByQueryCollObj
pg_setclientencoding
jf_n_s_i
```
2. If they are part of a "parent set" of functions, that parent should be
included in the user function name, and should be clearly related to the
parent program or function family. This should be in the form of `parent_*`:
A family of `foo` functions, for example:
Good:
```php
foo_select_bar
foo_insert_baz
foo_delete_baz
```
Bad:
```php
fooselect_bar
fooinsertbaz
delete_foo_baz
```
3. Function names used by user functions should be prefixed with `_php_`, and
followed by a word or an underscore-delimited list of words, in lowercase
letters, that describes the function. If applicable, they should be declared
`static`.
4. Variable names must be meaningful. One letter variable names must be avoided,
except for places where the variable has no real meaning or a trivial
meaning (e.g. `for (i=0; i<100; i++) ...`).
5. Variable names should be in lowercase. Use underscores to separate between
words.
6. Method names follow the *studlyCaps* (also referred to as *bumpy case* or
*camel caps*) naming convention, with care taken to minimize the letter
count. The initial letter of the name is lowercase, and each letter that
starts a new `word` is capitalized:
Good:
```php
connect()
getData()
buildSomeWidget()
```
Bad:
```php
get_Data()
buildsomewidget()
getI()
```
7. Class names should be descriptive nouns in *PascalCase* and as short as
possible. Each word in the class name should start with a capital letter,
without underscore delimiters. The class name should be prefixed with the
name of the "parent set" (e.g. the name of the extension) if no namespaces
are used. Abbreviations and acronyms as well as initialisms should be
avoided wherever possible, unless they are much more widely used than the
long form (e.g. HTTP or URL). Abbreviations start with a capital letter
followed by lowercase letters, whereas acronyms and initialisms are written
according to their standard notation. Usage of acronyms and initialisms is
not allowed if they are not widely adopted and recognized as such.
Good:
```php
Curl
CurlResponse
HTTPStatusCode
URL
BTreeMap // B-tree Map
Id // Identifier
ID // Identity Document
Char // Character
Intl // Internationalization
Radar // Radio Detecting and Ranging
```
Bad:
```php
curl
curl_response
HttpStatusCode
Url
BtreeMap
ID // Identifier
CHAR
INTL
RADAR // Radio Detecting and Ranging
```
## Internal function naming conventions
1. Functions that are part of the external API should be named
`php_modulename_function()` to avoid symbol collision. They should be in
lowercase, with words underscore delimited. Exposed API must be defined in
`php_modulename.h`.
```c
PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS);
```
Unexposed module function should be static and should not be defined in
`php_modulename.h`.
```c
static int php_session_destroy()
```
2. Main module source file must be named `modulename.c`.
3. Header file that is used by other sources must be named `php_modulename.h`.
## Syntax and indentation
1. Never use C++ style comments (i.e. `//` comment). Always use C-style comments
instead. PHP is written in C, and is aimed at compiling under any ANSI-C
compliant compiler. Even though many compilers accept C++-style comments in
C code, you have to ensure that your code would compile with other compilers
as well. The only exception to this rule is code that is Win32-specific,
because the Win32 port is MS-Visual C++ specific, and this compiler is known
to accept C++-style comments in C code.
2. Use K&R-style. Of course, we can't and don't want to force anybody to use a
style he or she is not used to, but, at the very least, when you write code
that goes into the core of PHP or one of its standard modules, please
maintain the K&R style. This applies to just about everything, starting with
indentation and comment styles and up to function declaration syntax. Also
see [Indentstyle](http://www.catb.org/~esr/jargon/html/I/indent-style.html).
3. Be generous with whitespace and braces. Keep one empty line between the
variable declaration section and the statements in a block, as well as
between logical statement groups in a block. Maintain at least one empty
line between two functions, preferably two. Always prefer:
```c
if (foo) {
bar;
}
```
to:
```c
if(foo)bar;
```
4. When indenting, use the tab character. A tab is expected to represent four
spaces. It is important to maintain consistency in indenture so that
definitions, comments, and control structures line up correctly.
5. Preprocessor statements (`#if` and such) MUST start at column one. To indent
preprocessor directives you should put the `#` at the beginning of a line,
followed by any number of whitespace.
## Testing
1. Extensions should be well tested using `*.phpt` tests. Read about that at
[qa.php.net](https://qa.php.net/write-test.php) documentation.
## Documentation and folding hooks
In order to make sure that the online documentation stays in line with the code,
each user-level function should have its user-level function prototype before it
along with a brief one-line description of what the function does. It would look
like this:
```c
/* {{{ proto int abs(int number)
Returns the absolute value of the number */
PHP_FUNCTION(abs)
{
...
}
/* }}} */
```
The `{{{` symbols are the default folding symbols for the folding mode in Emacs
and vim (`set fdm=marker`). Folding is very useful when dealing with large files
because you can scroll through the file quickly and just unfold the function you
wish to work on. The `}}}` at the end of each function marks the end of the
fold, and should be on a separate line.
The `proto` keyword there is just a helper for the `doc/genfuncsummary` script
which generates a full function summary. Having this keyword in front of the
function prototypes allows us to put folds elsewhere in the code without
messing up the function summary.
Optional arguments are written like this:
```c
/* {{{ proto object imap_header(int stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]])
Returns a header object with the defined parameters */
```
And yes, please keep the prototype on a single line, even if that line is
massive.
## New and experimental functions
To reduce the problems normally associated with the first public implementation
of a new set of functions, it has been suggested that the first implementation
include a file labeled `EXPERIMENTAL` in the function directory, and that the
functions follow the standard prefixing conventions during their initial
implementation.
The file labelled `EXPERIMENTAL` should include the following information:
* Any authoring information (known bugs, future directions of the module).
* Ongoing status notes which may not be appropriate for Git comments.
In general new features should go to PECL or experimental branches until there
are specific reasons for directly adding it to the core distribution.
## Aliases & legacy documentation
You may also have some deprecated aliases with close to duplicate names, for
example, `somedb_select_result` and `somedb_selectresult`. For documentation
purposes, these will only be documented by the most current name, with the
aliases listed in the documentation for the parent function. For ease of
reference, user-functions with completely different names, that alias to the
same function (such as `highlight_file` and `show_source`), will be separately
documented. The proto should still be included, describing which function is
aliased.
Backwards compatible functions and names should be maintained as long as the
code can be reasonably be kept as part of the codebase. See the `README` in the
PHP documentation repository for more information on documentation.
+373 -21
View File
@@ -1,10 +1,30 @@
# Contributing to PHP
Anybody who programs in PHP can be a contributing member of the community that
develops and deploys it; the task of deploying PHP, documentation and
associated websites is a never ending one. With every release, or release
candidate comes a wave of work, which takes a lot of organization and
co-ordination.
develops and deploys it; the task of deploying PHP, documentation and associated
websites is a never ending one. With every release, or release candidate comes a
wave of work, which takes a lot of organization and co-ordination.
You don't need any special access to download, build, debug and begin submitting
PHP or PECL code, tests or documentation. Once you've followed this guide and
had several contributions accepted, commit privileges are often quickly granted.
## Index
* [Pull requests](#pull-requests)
* [Filing bugs](#filing-bugs)
* [Feature requests](#feature-requests)
* [Writing tests](#writing-tests)
* [Writing documentation](#writing-documentation)
* [Getting help](#getting-help)
* [PHP source code directory structure](#php-source-code-directory-structure)
* [PHP internals](#php-internals)
* [PECL extensions](#pecl-extensions)
* [Checklist for submitting contribution](#checklist-for-submitting-contribution)
* [What happens after submitting contribution?](#what-happens-after-submitting-contribution)
* [What happens when your contribution is applied?](#what-happens-when-your-contribution-is-applied)
* [Git commit rules](#git-commit-rules)
* [Copyright and license headers](#copyright-and-license-headers)
## Pull requests
@@ -13,18 +33,28 @@ implement RFCs. Please be sure to include tests as appropriate!
If you are fixing a bug, then please submit your PR against the lowest actively
supported branch of PHP that the bug affects (only green branches on
[the supported version page](http://php.net/supported-versions.php) are supported).
For example, at the time of writing in early-2018, the lowest supported version is
PHP 7.1, which corresponds to the `PHP-7.1` branch in Git. Please also make sure you
add a link to the PR in the bug on [the bug tracker](https://bugs.php.net/).
[the supported version page](https://www.php.net/supported-versions.php) are
supported). For example, at the time of writing, the lowest supported version is
PHP 7.2, which corresponds to the `PHP-7.2` branch in Git. Please also make sure
you add a link to the PR in the bug on [the bug tracker](https://bugs.php.net/).
Pull requests implementing RFCs should be submitted against `master`.
Pull requests should *never* be submitted against `PHP-x.y.z` branches, as
these are only used for release management.
Pull requests should *never* be submitted against `PHP-x.y.z` branches, as these
are only used for release management.
If your pull request exhibits conflicts with the base branch, please resolve them
by using `git rebase` instead of `git merge`.
If your pull request exhibits conflicts with the base branch, please resolve
them by using `git rebase` instead of `git merge`.
Fork the official PHP repository and send a pull request. A notification will be
sent to the pull request mailing list. Sending a note to PHP Internals list
(internals@lists.php.net) may help getting more feedback and quicker turnaround.
You can also add pull requests to [bug reports](https://bugs.php.net/).
Read [Git access page](https://www.php.net/git.php) for help on using Git to get
and build PHP source code. We recommend to look at our
[workflow](https://wiki.php.net/vcs/gitworkflow) and our
[FAQ](https://wiki.php.net/vcs/gitfaq).
## Filing bugs
@@ -37,12 +67,19 @@ Where possible, please include a self-contained reproduction case!
## Feature requests
Feature requests are generally submitted in the form of
[Requests for Comment](https://wiki.php.net/rfc/howto), ideally accompanied by
[pull requests](#pull-requests). You can find the extremely large list of RFCs
that have been previously considered on the
[Requests for Comments (RFC)](https://wiki.php.net/rfc/howto), ideally
accompanied by [pull requests](#pull-requests). You can find the extremely large
list of RFCs that have been previously considered on the
[PHP Wiki](https://wiki.php.net/rfc).
You may want to read
To create a RFC, discuss it with the extension maintainer, and discuss it on the
development mailing list internals@lists.php.net. RFC Wiki accounts can be
requested on https://wiki.php.net/start?do=register. PHP extension maintainers
can be found in the [EXTENSIONS](/EXTENSIONS) file in the PHP source code
repository. Mailing list subscription is explained on the
[mailing lists page](https://www.php.net/mailing-lists.php).
You may also want to read
[The Mysterious PHP RFC Process](https://blogs.oracle.com/opal/entry/the_mysterious_php_rfc_process)
for additional notes on the best way to approach submitting an RFC.
@@ -51,10 +88,19 @@ for additional notes on the best way to approach submitting an RFC.
We love getting new tests! PHP is a huge project and improving code coverage is
a huge win for every PHP user.
[Our QA site includes a page detailing how to write test cases.](http://qa.php.net/write-test.php)
Please note that the section on submitting pull requests is outdated: in
addition to the process listed there, you can also
[submit pull requests](#pull-requests).
[Our QA site includes a page detailing how to write test cases.](https://qa.php.net/write-test.php)
Submitting test scripts helps us to understand what functionality has changed.
It is important for the stability and maintainability of PHP that tests are
comprehensive.
Failure conditions of `zend_parse_parameters`, `ZEND_PARSE_PARAMETERS()` and
similar functions should not be tested. These parameter parsing APIs are already
extensively tested, and additional tests only complicate future modifications.
For newly created tests, a `--CREDITS--` section should no longer be included,
as test authorship is already accurately tracked by Git. If multiple authors
should be credited, the `Co-authored-by` tag in the commit message may be used.
## Writing documentation
@@ -75,4 +121,310 @@ issues.
Although not a formal channel, you can also find a number of core developers on
the #php.pecl channel on [EFnet](http://www.efnet.org/). Similarly, many
documentation writers can be found on #php.doc.
documentation writers can be found on #php.doc. Windows development IRC channel
is available at #winphp-dev on FreeNode.
## PHP source code directory structure
PHP source code also includes several files generated during development and
several parts where maintenance is happening upstream in their respective
locations.
```bash
<php-src>/
├─ .git/ # Git configuration and source directory
├─ TSRM/ # Thread Safe Resource Manager
└─ Zend/ # Zend Engine
├─ zend_vm_execute.h # Generated by `Zend/zend_vm_gen.php`
├─ zend_vm_opcodes.c # Generated by `Zend/zend_vm_gen.php`
├─ zend_vm_opcodes.h # Generated by `Zend/zend_vm_gen.php`
└─ ...
├─ appveyor/ # Appveyor CI service files
└─ build/ # *nix build system files
├─ ax_*.m4 # https://github.com/autoconf-archive/autoconf-archive
├─ config.guess # https://git.savannah.gnu.org/cgit/config.git
├─ config.sub # https://git.savannah.gnu.org/cgit/config.git
├─ libtool.m4 # https://git.savannah.gnu.org/cgit/libtool.git
├─ ltmain.sh # https://git.savannah.gnu.org/cgit/libtool.git
├─ shtool # https://www.gnu.org/software/shtool/
└─ ...
├─ docs/ # PHP internals and repository documentation
└─ ext/ # PHP core extensions
└─ bcmath/
├─ libbcmath/ # Forked and maintained in php-src
└─ ...
└─ curl/
├─ sync-constants.php # The curl symbols checker
└─ ...
└─ date/
└─ lib/ # Bundled datetime library https://github.com/derickr/timelib
├─ parse_date.c # Generated by re2c 0.15.3
├─ parse_iso_intervals.c # Generated by re2c 0.15.3
└─ ...
└─ ...
└─ ffi/
├─ ffi_parser.c # Generated by https://github.com/dstogov/llk
└─ ...
└─ fileinfo/
├─ libmagic/ # Modified libmagic https://github.com/file/file
├─ data_file.c # Generated by `ext/fileinfo/create_data_file.php`
├─ libmagic.patch # Modifications patch from upstream libmagic
├─ magicdata.patch # Modifications patch from upstream libmagic
└─ ...
└─ gd/
├─ libgd/ # Bundled and modified GD library https://github.com/libgd/libgd
└─ ...
└─ mbstring/
├─ libmbfl/ # Forked and maintained in php-src
├─ unicode_data.h # Generated by `ext/mbstring/ucgendat/ucgendat.php`
└─ ...
└─ pcre/
├─ pcre2lib/ # https://www.pcre.org/
└─ ...
└─ pdo_mysql/
├─ php_pdo_mysql_sqlstate.h # Generated by `ext/pdo_mysql/get_error_codes.php`
└─ ...
└─ skeleton/ # Skeleton for developing new extensions with `ext/ext_skel.php`
└─ ...
└─ standard/
└─ html_tables/
├─ mappings/ # https://www.unicode.org/Public/MAPPINGS/
└─ ...
├─ credits_ext.h # Generated by `scripts/dev/credits`
├─ credits_sapi.h # Generated by `scripts/dev/credits`
├─ html_tables.h # Generated by `ext/standard/html_tables/html_table_gen.php`
└─ ...
└─ tokenizer/
├─ tokenizer_data.c # Generated by `ext/tokenizer/tokenizer_data_gen.sh`
└─ ...
└─ xmlrpc/
├─ libxmlrpc/ # Forked and maintained in php-src
└─ ...
└─ zend_test # For testing internal APIs. Not needed for regular builds.
└─ ...
└─ zip/ # Bundled https://github.com/pierrejoye/php_zip
└─ ...
└─ ...
└─ main/ # Binding that ties extensions, SAPIs, and engine together
├─ streams/ # Streams layer subsystem
├─ php_version.h # Generated by release managers using `configure`
└─ ...
├─ pear/ # PEAR installation
└─ sapi/ # PHP SAPI modules
└─ cli/
├─ mime_type_map.h # Generated by `sapi/cli/generate_mime_type_map.php`
└─ ...
└─ ...
├─ scripts/ # php-config, phpize and internal development scripts
├─ tests/ # Core features tests
├─ travis/ # Travis CI service files
└─ win32/ # Windows build system files
├─ cp_enc_map.c # Generated by `win32/cp_enc_map_gen.exe`
└─ ...
└─ ...
```
## PHP internals
For information on PHP internal C functions see
[References about Maintaining and Extending PHP](https://wiki.php.net/internals/references).
Various external resources can be found on the web. A standard printed reference
is the book "Extending and Embedding PHP" by Sara Golemon.
## PECL extensions
If you are fixing broken functionality in a [PECL](https://pecl.php.net)
extension then create a bug or identify an existing bug at
[bugs.php.net](https://bugs.php.net). A bug can be used to track the change
progress and prevent your changes getting lost in the PHP mail archives. Some
PECL extensions have their own bug tracker locations and different contributing
procedures.
If your change is large then create a
[Request for Comments (RFC)](https://wiki.php.net/rfc), discuss it with the
extension maintainer, and discuss it on the development mailing list
pecl-dev@lists.php.net depending on the extension. PECL mailing list
subscription is explained on the
[PECL support page](https://pecl.php.net/support.php).
Update any open bugs and add a link to the source of your change. Send the patch
or pointer to the bug to pecl-dev@lists.php.net. Also CC the extension
maintainer. Explain what has been changed by your patch. Test scripts should be
included.
## Checklist for submitting contribution
- Read [Coding standards](/CODING_STANDARDS.md) before you start working.
- Update git source just before running your final `diff` and before testing.
- Add in-line comments and/or have external documentation ready. Use only
`/* */` style comments, not `//`.
- Create test scripts for use with `make test`.
- Run `make test` to check your change doesn't break other features.
- Rebuild PHP with `--enable-debug` which will show some kinds of memory errors
and check the PHP and web server error logs after running your PHP tests.
- Rebuild PHP with `--enable-maintainer-zts` to check your change compiles on
multi-threaded web servers.
- Review the change once more just before submitting it.
## What happens after submitting contribution?
If your change is easy to review and obviously has no side-effects, it might be
committed relatively quickly.
Because PHP is a volunteer-driven effort more complex changes will require
patience on your side. If you do not receive feedback in a few days, consider
bumping. Before doing this think about these questions:
- Did I send the patch to the right mailing list?
- Did I review the mailing list archives to see if these kind of changes had
been discussed before?
- Did I explain my change clearly?
- Is my change too hard to review? Because of what factors?
## What happens when your contribution is applied?
Your name will likely be included in the Git commit log. If your change affects
end users, a brief description and your name might be added to the [NEWS](/NEWS)
file.
## Git commit rules
This section refers to contributors that have Git push access and make commit
changes themselves. We'll assume you're basically familiar with Git, but feel
free to post your questions on the mailing list. Please have a look at the more
detailed [information on Git](https://git-scm.com/).
PHP is developed through the efforts of a large number of people. Collaboration
is a Good Thing(tm), and Git lets us do this. Thus, following some basic rules
with regards to Git usage will:
* Make everybody happier, especially those responsible for maintaining PHP
itself.
* Keep the changes consistently well documented and easily trackable.
* Prevent some of those 'Oops' moments.
* Increase the general level of good will on planet Earth.
Having said that, here are the organizational rules:
1. Respect other people working on the project.
2. Discuss any significant changes on the list before committing and get
confirmation from the release manager for the given branch.
3. Look at [EXTENSIONS](/EXTENSIONS) file to see who is the primary maintainer
of the code you want to contribute to.
4. If you "strongly disagree" about something another person did, don't start
fighting publicly - take it up in private email.
5. If you don't know how to do something, ask first!
6. Test your changes before committing them. We mean it. Really. To do so use
`make test`.
7. For development use the `--enable-debug` switch to avoid memory leaks and the
`--enable-maintainer-zts` switch to ensure your code handles TSRM correctly
and doesn't break for those who need that.
Currently we have the following branches in use:
| Branch | |
| --------- | --------- |
| master | Active development branch for PHP 8.0, which is open for backwards incompatible changes and major internal API changes. |
| PHP-7.4 | Active development branch for PHP 7.4, which is open for new features and minor internal API changes. |
| PHP-7.3 | Is used to release the PHP 7.3.x series. This is a current stable version and is open for bugfixes only. |
| PHP-7.2 | Is used to release the PHP 7.2.x series. This is a current stable version and is open for bugfixes only. |
| PHP-7.1 | Is used to release the PHP 7.1.x series. This is an old stable version and is open for security fixes only. |
| PHP-7.0 | This branch is closed. |
| PHP-5.6 | This branch is closed. |
| PHP-5.5 | This branch is closed. |
| PHP-5.4 | This branch is closed. |
| PHP-5.3 | This branch is closed. |
| PHP-5.2 | This branch is closed. |
| PHP-5.1 | This branch is closed. |
| PHP-4.4 | This branch is closed. |
| PHP-X.Y.Z | These branches are used for the release managers for tagging the releases, hence they are closed to the general public. |
The next few rules are more of a technical nature:
1. All non-security bugfix changes should first go to the lowest bugfix branch
(i.e. 7.2) and then get merged up to all other branches. All security fixes
should go to the lowest security fixes branch (i.e 7.1). If a change is not
needed for later branches (i.e. fixes for features which were dropped from
later branches) an empty merge should be done.
2. All news updates intended for public viewing, such as new features, bug
fixes, improvements, etc., should go into the NEWS file of *any stable
release* version with the given change. In other words, news about a bug fix
which went into PHP-5.4, PHP-5.5 and master should be noted in both
PHP-5.4/NEWS and PHP-5.5/NEWS but not master, which is not a public released
version yet.
3. Do not commit multiple files and dump all messages in one commit. If you
modified several unrelated files, commit each group separately and provide a
nice commit message for each one. See example below.
4. Do write your commit message in such a way that it makes sense even without
the corresponding diff. One should be able to look at it, and immediately
know what was modified. Definitely include the function name in the message
as shown below.
5. In your commit messages, keep each line shorter than 80 characters. And try
to align your lines vertically, if they wrap. It looks bad otherwise.
6. If you modified a function that is callable from PHP, prepend PHP to the
function name as shown below.
The format of the commit messages is pretty simple.
<max 79 characters short description>\n
\n
<long description, 79 chars per line>
\n
An Example from the git project (commit 2b34e486bc):
pack-objects: Fix compilation with NO_PTHREDS
It looks like commit 99fb6e04 (pack-objects: convert to use parse_options(),
2012-02-01) moved the #ifdef NO_PTHREDS around but hasn't noticed that the
'arg' variable no longer is available.
If you fix some bugs, you should note the bug ID numbers in your commit message.
Bug ID should be prefixed by `#`.
Example:
Fixed bug #14016 (pgsql notice handler double free crash bug.)
When you change the NEWS file for a bug fix, then please keep the bugs sorted in
decreasing order under the fixed version.
You can use [gitweb](https://git.php.net/) to look at PHP Git repository in
various ways.
## Copyright and license headers
New source code files should include the following header block:
```c
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| https://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: |
+----------------------------------------------------------------------+
*/
```
Thank you for contributing to PHP!
-3
View File
@@ -1,3 +0,0 @@
For the list of people who've put work into PHP, please see
https://www.php.net/credits.php
+27 -22
View File
@@ -36,7 +36,8 @@ MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: cli
MAINTENANCE: Marcus Börger <helly@php.net>, Edin Kadribasic <edink@php.net>
PRIMARY MAINTAINER: Marcus Börger <helly@php.net>, Edin Kadribasic <edink@php.net>
MAINTENANCE: Unknown
STATUS: Working
SINCE: 4.3.0
-------------------------------------------------------------------------------
@@ -58,7 +59,8 @@ STATUS: Working
SINCE: 5.3
-------------------------------------------------------------------------------
EXTENSION: phpdbg
MAINTENANCE: Joe Watkins <krakjoe@php.net>, Bob Weinand <bwoebi@php.net>
PRIMARY MAINTAINER: Joe Watkins <krakjoe@php.net>, Bob Weinand <bwoebi@php.net>
MAINTENANCE: Unkown
STATUS: 5.6
-------------------------------------------------------------------------------
@@ -74,11 +76,6 @@ MAINTENANCE: Maintained
STATUS: Working
COMMENT: DBM abstraction for db2, db3, db4, dbm, ndbm, gdbm, ini
-------------------------------------------------------------------------------
EXTENSION: interbase
PRIMARY MAINTAINER: Ard Biesheuvel <ard@ard.nu> (2003 - 2005)
MAINTENANCE: Odd fixes
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: mysqli
PRIMARY MAINTAINER: Georg Richter <georg@php.net> (2003 - 2006)
Andrey Hristov <andrey@php.net> (2003 - 2016)
@@ -169,6 +166,7 @@ COMMENT: Use PostgreSQL 7.0.x or later. PostgreSQL 6.5.3 or less hav
-------------------------------------------------------------------------------
EXTENSION: sqlite3
PRIMARY MAINTAINER: Scott MacVicar <scottmac@php.net> (2008 - 2011)
Christoph M. Becker <cmb@php.net> (2016 - 2018)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.3
@@ -198,11 +196,6 @@ PRIMARY MAINTAINER: Dmitry Stogov <dmitry@php.net> (2004 - 2018)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: wddx
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net> (1999 - 2003)
MAINTENANCE: Orphaned
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: xml
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net> (1999 - 2002)
Rob Richards <rrichards@php.net> (2003 - 2013)
@@ -216,7 +209,8 @@ MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: xmlreader
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net>, Christian Stocker <chregu@php.net>
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net> (2004 - 2010)
Christian Stocker <chregu@php.net> (2004 - 2004)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
@@ -227,7 +221,7 @@ STATUS: Experimental
-------------------------------------------------------------------------------
EXTENSION: xmlwriter
PRIMARY MAINTAINER: Rob Richards <rrichards@php.net> (2004 - 2010)
Christian Stocker <chregu@php.net> (2004 - 2004)
Pierre-Alain Joye <pajoye@php.net> (2005-2009)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
@@ -244,7 +238,8 @@ SINCE: 5.0
-------------------------------------------------------------------------------
EXTENSION: bcmath
MAINTENANCE: Andi Gutmans <andi@php.net> (2000 - 2004)
PRIMARY MAINTAINER: Andi Gutmans <andi@php.net> (2000 - 2004)
MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: bz2
@@ -294,9 +289,15 @@ MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.2
-------------------------------------------------------------------------------
EXTENSION: ffi
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@php.net> (2018 - 2019)
MAINTENANCE: Maintained
STATUS: Experimental
SINCE: 7.4.0
-------------------------------------------------------------------------------
EXTENSION: fileinfo
PRIMARY MAINTAINER: Derick Rethans <derick@php.net> (2004 - 2008)
Anatol Belski <ab@php.net> (2012 - 2018)
Anatol Belski <ab@php.net> (2012 - 2019)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.3
@@ -321,12 +322,14 @@ MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: gettext
PRIMARY MAINTAINER: Unknown
MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: gmp
PRIMARY MAINTAINER: Stanislav Malyshev <stas@php.net> (2000 - 2018)
Antony Dovgal <tony2001@php.net> (2005 - 2010)
Nikita Popov <nikic@php.net> (2013 - 2019)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.4
@@ -374,12 +377,14 @@ STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: mbstring
PRIMARY MAINTAINER: Rui Hirokawa <hirokawa@php.net> (2001 - 2013)
Nikita Popov <nikic@php.net> (2017 - 2019)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: opcache
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@php.net> (2013 - 2018)
Xinchen Hui <laruence@php.net> (2013 - 2018)
Nikita Popov <nikic@php.net> (2016 - 2019)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.5.0
@@ -423,14 +428,10 @@ STATUS: Working
SINCE: 4.0.2
-------------------------------------------------------------------------------
EXTENSION: readline
PRIMARY MAINTAINER: Unkown
MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: recode
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de> (2000 - 2000)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: reflection
PRIMARY MAINTAINER: Marcus Börger <helly@php.net> (2003 - 2009)
Johannes Schlüter <johannes@php.net> (2006 - 2014)
@@ -476,14 +477,17 @@ STATUS: Working
SINCE: 5.0.0
-------------------------------------------------------------------------------
EXTENSION: sysvmsg
PRIMARY MAINTAINER: Unkown
MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: sysvsem
PRIMARY MAINTAINER: Unkown
MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: sysvshm
PRIMARY MAINTAINER: Unkown
MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
@@ -496,7 +500,8 @@ STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: tokenizer
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net> (2002 - 2002)
MAINTENANCE: Unknown
Nikita Popov <nikic@php.net> (2013 - 2019)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: zip
-3
View File
@@ -1,3 +0,0 @@
For installation of PHP, please refer to the online documentation available at:
https://php.net/install
+1 -1
View File
@@ -1,6 +1,6 @@
--------------------------------------------------------------------
The PHP License, version 3.01
Copyright (c) 1999 - 2018 The PHP Group. All rights reserved.
Copyright (c) 1999 - 2019 The PHP Group. All rights reserved.
--------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
-22
View File
@@ -1,22 +0,0 @@
#
# Zend
#
$(builddir)/zend_language_scanner.lo: $(srcdir)/zend_language_parser.h
$(builddir)/zend_ini_scanner.lo: $(srcdir)/zend_ini_parser.h
$(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l)
$(srcdir)/zend_language_parser.h: $(srcdir)/zend_language_parser.c
$(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
@$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@
$(srcdir)/zend_ini_parser.h: $(srcdir)/zend_ini_parser.c
$(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
@$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@
$(srcdir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l)
$(builddir)/zend_highlight.lo $(builddir)/zend_compile.lo: $(srcdir)/zend_language_parser.h
-78
View File
@@ -1,78 +0,0 @@
#
# LCOV
#
LCOV_INCLUDE="."
lcov: lcov-html
lcov-test: lcov-clean-data test
php_lcov.info: lcov-test
@echo "Generating data for $@"
@rm -rf lcov_data/
@$(mkinstalldirs) lcov_data/
@echo
-@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.c -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | sed -e 's/.libs/zzzz/g' | sort | sed -e 's/zzzz/.libs/g' | uniq` ;\
for x in $$files; do \
echo -n . ;\
y=`echo $$x | sed -e 's!\.libs/!!'`; \
dir=lcov_data/`dirname $$x`; \
test -d "$$dir" || $(mkinstalldirs) "$$dir"; \
if test -f "$(top_srcdir)/$$y.c"; then \
ln -f -s $(top_srcdir)/$$y.c lcov_data/$$y.c; \
fi; \
if test -f "$(top_srcdir)/$$y.h"; then \
ln -f -s $(top_srcdir)/$$y.h lcov_data/$$y.h; \
fi; \
if test -f "$(top_srcdir)/$$y.re"; then \
ln -f -s $(top_srcdir)/$$y.re lcov_data/$$y.re; \
fi; \
if test -f "$(top_srcdir)/$$y.y"; then \
ln -f -s $(top_srcdir)/$$y.y lcov_data/$$y.y; \
fi; \
if test -f "$(top_srcdir)/$$y.l"; then \
ln -f -s $(top_srcdir)/$$y.l lcov_data/$$y.l; \
fi; \
if test -f "$(top_srcdir)/$$y"; then \
ln -f -s $(top_srcdir)/$$y lcov_data/$$y; \
fi; \
if test -f "$(top_builddir)/$$y.c"; then \
ln -f -s $(top_builddir)/$$y.c lcov_data/$$y.c; \
fi; \
if test -f "$$x.gcno"; then \
cp $$x.gcno lcov_data/$$y.gcno ; \
fi; \
if test -f "$$x.gcda"; then \
cp $$x.gcda lcov_data/$$y.gcda ; \
fi; \
if test -f "$$x.da"; then \
cp $$x.da lcov_data/$$y.da ; \
fi; \
if test -f "$$x.bb"; then \
cp $$x.bb lcov_data/$$y.bb ; \
fi; \
if test -f "$$x.bbg"; then \
cp $$x.bbg lcov_data/$$y.bbg ; \
fi; \
done; \
for dir in ext/bcmath/libbcmath ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
if test -d lcov_data/$$dir; then \
rm -rf lcov_data/$$dir ; \
fi; \
done
@echo
@echo "Generating $@"
@$(LTP) --directory lcov_data/ --capture --base-directory=lcov_data --output-file $@
lcov-html: php_lcov.info
@echo "Generating lcov HTML"
@$(LTP_GENHTML) --legend --output-directory lcov_html/ --title "PHP Code Coverage" php_lcov.info
lcov-clean:
rm -f php_lcov.info
rm -rf lcov_data/
rm -rf lcov_html/
lcov-clean-data:
@find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
+332 -2106
View File
File diff suppressed because it is too large. Load diff
-43
View File
@@ -1,43 +0,0 @@
WHAT IT IS
It's a tool for automatically creating the basic framework for a PHP extension.
HOW TO USE IT
Very simple. First, change to the ext/ directory of the PHP sources. Then
run the following
php ext_skel.php --ext extension_name
and everything you need will be placed in directory ext/extension_name.
If you don't need to test the existence of any external header files,
libraries or functions in them, the extension is ready to be compiled in
PHP. To compile the extension, run the following:
./buildconf; ./configure --enable-extension_name; make
The definition of PHP_extension_NAME_VERSION will be present in the
php_extension_name.h and injected into the zend_extension_entry definition. This
is required by the PECL website for the version string conformity checks
against package.xml
SOURCE AND HEADER FILE NAME
The ext_skel.php script generates 'extension_name.c' and 'php_extension_name.h'
as the main source and header files. Keep these names.
extension functions (User functions) must be named
extension_name_function()
When you need to expose extension functions to other extensions, expose functions
strictly needed by others. Exposed internal function must be named
php_extension_name_function()
See also CODING_STANDARDS.
OTHER OPTIONS
Run php ext_skel.php --help to see the available options.
-141
View File
@@ -1,141 +0,0 @@
====================
Git Commit Rules
====================
This is the first file you should be reading when contributing code via Git.
We'll assume you're basically familiar with Git, but feel free to post
your questions on the mailing list. Please have a look at
http://git-scm.com/ for more detailed information on Git.
PHP is developed through the efforts of a large number of people.
Collaboration is a Good Thing(tm), and Git lets us do this. Thus, following
some basic rules with regards to Git usage will::
a. Make everybody happier, especially those responsible for maintaining
PHP itself.
b. Keep the changes consistently well documented and easily trackable.
c. Prevent some of those 'Oops' moments.
d. Increase the general level of good will on planet Earth.
Having said that, here are the organizational rules::
1. Respect other people working on the project.
2. Discuss any significant changes on the list before committing and get
confirmation from the release manager for the given branch.
3. Look at EXTENSIONS file to see who is the primary maintainer of
the code you want to contribute to.
4. If you "strongly disagree" about something another person did, don't
start fighting publicly - take it up in private email.
5. If you don't know how to do something, ask first!
6. Test your changes before committing them. We mean it. Really.
To do so use "make test".
7. For development use the --enable-debug switch to avoid memory leaks
and the --enable-maintainer-zts switch to ensure your code handles
TSRM correctly and doesn't break for those who need that.
Currently we have the following branches in use::
master The active development branch.
PHP-7.2 Is used to release the PHP 7.2.x series. This is a current
stable version and is open for bugfixes only.
PHP-7.1 Is used to release the PHP 7.1.x series. This is a current
stable version and is open for bugfixes only.
PHP-7.0 Is used to release the PHP 7.0.x series. This is an old
stable version and is open for security fixes only.
PHP-5.6 Is used to release the PHP 5.6.x series. This is an old
stable version and is open for security fixes only.
PHP-5.5 This branch is closed.
PHP-5.4 This branch is closed.
PHP-5.3 This branch is closed.
PHP-5.2 This branch is closed.
PHP-5.1 This branch is closed.
PHP-4.4 This branch is closed.
PHP-X.Y.Z These branches are used for the release managers for tagging
the releases, hence they are closed to the general public.
The next few rules are more of a technical nature::
1. All changes should first go to the lowest branch (i.e. 5.6) and then
get merged up to all other branches. If a change is not needed for
later branches (i.e. fixes for features which were dropped from later
branches) an empty merge should be done.
2. All news updates intended for public viewing, such as new features,
bug fixes, improvements, etc., should go into the NEWS file of *any
stable release* version with the given change. In other words,
news about a bug fix which went into PHP-5.4, PHP-5.5 and master
should be noted in both PHP-5.4/NEWS and PHP-5.5/NEWS but
not master, which is not a public released version yet.
3. Do not commit multiple files and dump all messages in one commit. If you
modified several unrelated files, commit each group separately and
provide a nice commit message for each one. See example below.
4. Do write your commit message in such a way that it makes sense even
without the corresponding diff. One should be able to look at it, and
immediately know what was modified. Definitely include the function name
in the message as shown below.
5. In your commit messages, keep each line shorter than 80 characters. And
try to align your lines vertically, if they wrap. It looks bad otherwise.
6. If you modified a function that is callable from PHP, prepend PHP to
the function name as shown below.
The format of the commit messages is pretty simple.
<max 79 characters short description>\n
\n
<long description, 79 chars per line>
\n
An Example from the git project (commit 2b34e486bc):
pack-objects: Fix compilation with NO_PTHREDS
It looks like commit 99fb6e04 (pack-objects: convert to use
parse_options(), 2012-02-01) moved the #ifdef NO_PTHREDS around but
hasn't noticed that the 'arg' variable no longer is available.
If you fix some bugs, you should note the bug ID numbers in your
commit message. Bug ID should be prefixed by "#" for easier access to
bug report when developers are browsing CVS via LXR or Bonsai.
Example:
Fixed bug #14016 (pgsql notice handler double free crash bug.)
When you change the NEWS file for a bug fix, then please keep the bugs
sorted in decreasing order under the fixed version.
You can use OpenGrok (http://lxr.php.net/) and gitweb (http://git.php.net/)
to look at PHP Git repository in various ways.
For further information on the process and further details please refer to
https://wiki.php.net/vcs/gitworkflow and https://wiki.php.net/vcs/gitfaq
Happy hacking,
PHP Team
-79
View File
@@ -1,79 +0,0 @@
====================
Mailinglist Rules
====================
This is the first file you should be reading before doing any posts on PHP
mailinglists. Following these rules is considered imperative to the success of
the PHP project. Therefore expect your contributions to be of much less positive
impact if you do not follow these rules. More importantly you can actually
assume that not following these rules will hurt the PHP project.
PHP is developed through the efforts of a large number of people.
Collaboration is a Good Thing(tm), and mailinglists lets us do this. Thus,
following some basic rules with regards to mailinglist usage will:
a. Make everybody happier, especially those responsible for developing PHP
itself.
b. Help in making sure we all use our time more efficiently.
c. Prevent you from making a fool of yourself in public.
d. Increase the general level of good will on planet Earth.
Having said that, here are the organizational rules:
1. Respect other people working on the project.
2. Do not post when you are angry. Any post can wait a few hours. Review
your post after a good breather or a good nights sleep.
3. Make sure you pick the right mailinglist for your posting. Please review
the descriptions on the mailinglist overview page
(http://www.php.net/mailing-lists.php). When in doubt ask a friend or
someone you trust on IRC.
4. Make sure you know what you are talking about. PHP is a very large project
that strives to be very open. The flip side is that the core developers
are faced with a lot of requests. Make sure that you have done your
research before posting to the entire developer community.
5. Patches have a much greater chance of acceptance than just asking the
PHP developers to implement a feature for you. For one it makes the
discussion more concrete and it shows that the poster put thought and time
into the request.
6. If you are posting to an existing thread, make sure that you know what
previous posters have said. This is even more important the longer the
thread is already.
7. Please configure your email client to use a real name and keep message
signatures to a maximum of 2 lines if at all necessary.
The next few rules are more some general hints:
1. If you notice that your posting ratio is much higher than that of other
people, double check the above rules. Try to wait a bit longer before
sending your replies to give other people more time to digest your answers
and more importantly give you the opportunity to make sure that you
aggregate your current position into a single mail instead of multiple
ones.
2. Consider taking a step back from a very active thread now and then. Maybe
talking to some friends and fellow developers will help in understanding
the other opinions better.
3. Do not top post. Place your answer underneath anyone you wish to quote
and remove any previous comment that is not relevant to your post.
4. Do not high-jack threads, by bringing up entirely new topics. Please
create an entirely new thread copying anything you wish to quote into the
new thread.
Finally, additional hints on how to behave inside the virtual community can be
found in RFC 1855 (http://www.faqs.org/rfcs/rfc1855.html).
Happy hacking,
PHP Team
-139
View File
@@ -1,139 +0,0 @@
API adjustment to the old output control code:
Everything now resides beneath the php_output namespace,
and there's an API call for every output handler op.
Checking output control layers status:
// Using OG()
php_output_get_status();
Starting the default output handler:
// php_start_ob_buffer(NULL, 0, 1);
php_output_start_default();
Starting an user handler by zval:
// php_start_ob_buffer(zhandler, chunk_size, erase);
php_output_start_user(zhandler, chunk_size, flags);
Starting an internal handler without context:
// php_ob_set_internal_handler(my_php_output_handler_func_t, buffer_size, "output handler name", erase);
php_output_start_internal(handler_name, handler_name_len, my_php_output_handler_func_t, chunk_size, flags);
Starting an internal handler with context:
// not possible with old API
php_output_handler *h;
h = php_output_handler_create_internal(handler_name, handler_name_len, my_php_output_handler_context_func_t, chunk_size, flags);
php_output_handler_set_context(h, my_context, my_context_dtor);
php_output_handler_start(h);
Testing whether a certain output handler has already been started:
// php_ob_handler_used("output handler name");
php_output_handler_started(handler_name, handler_name_len);
Flushing one output buffer:
// php_end_ob_buffer(1, 1);
php_output_flush();
Flushing all output buffers:
// not possible with old API
php_output_flush_all();
Cleaning one output buffer:
// php_ob_end_buffer(0, 1);
php_output_clean();
Cleaning all output buffers:
// not possible with old API
php_output_clean_all();
Discarding one output buffer:
// php_ob_end_buffer(0, 0);
php_output_discard();
Discarding all output buffers:
// php_ob_end_buffers(0);
php_output_discard_all();
Stopping (and dropping) one output buffer:
// php_ob_end_buffer(1, 0)
php_output_end();
Stopping (and dropping) all output buffers:
// php_ob_end_buffers(1, 0);
php_output_end_all();
Retrieving output buffers contents:
// php_ob_get_buffer(zstring);
php_output_get_contents(zstring);
Retrieving output buffers length:
// php_ob_get_length(zlength);
php_output_get_length(zlength);
Retrieving output buffering level:
// OG(nesting_level);
php_output_get_level();
Issue a warning because of an output handler conflict:
// php_ob_init_conflict("to be started handler name", "to be tested if already started handler name");
php_output_handler_conflict(new_handler_name, new_handler_name_len, set_handler_name, set_handler_name_len);
Registering a conflict checking function, which will be checked prior starting the handler:
// not possible with old API, unless hardcoding into output.c
php_output_handler_conflict_register(handler_name, handler_name_len, my_php_output_handler_conflict_check_t);
Registering a reverse conflict checking function, which will be checked prior starting the specified foreign handler:
// not possible with old API
php_output_handler_reverse_conflict_register(foreign_handler_name, foreign_handler_name_len, my_php_output_handler_conflict_check_t);
Facilitating a context from within an output handler callable with ob_start():
// not possible with old API
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ, (void *) &custom_ctx_ptr_ptr);
Disabling of the output handler by itself:
//not possible with old API
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_DISABLE, NULL);
Marking an output handler immutable by itself because of irreversibility of its operation:
// not possible with old API
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL);
Restarting the output handler because of a CLEAN operation:
// not possible with old API
if (flags & PHP_OUTPUT_HANDLER_CLEAN) { ... }
Recognizing by the output handler itself if it gets discarded:
// not possible with old API
if ((flags & PHP_OUTPUT_HANDLER_CLEAN) && (flags & PHP_OUTPUT_HANDLER_FINAL)) { ... }
Output handler hooks
The output handler can change its abilities at runtime. Eg. the gz handler can
remove the CLEANABLE and REMOVABLE bits when the first output has passed through it;
or handlers implemented in C to be used with ob_start() can contain a non-global
context:
PHP_OUTPUT_HANDLER_HOOK_GET_OPAQ
pass a void*** pointer as second arg to receive the address of a pointer
pointer to the opaque field of the output handler context
PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS
pass a int* pointer as second arg to receive the flags set for the output handler
PHP_OUTPUT_HANDLER_HOOK_GET_LEVEL
pass a int* pointer as second arg to receive the level of this output handler
(starts with 0)
PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE
the second arg is ignored; marks the output handler to be neither cleanable
nor removable
PHP_OUTPUT_HANDLER_HOOK_DISABLE
the second arg is ignored; marks the output handler as disabled
Open questions
Should the userland API be adjusted and unified?
Many bits of the manual (and very first implementation) do not comply
with the behaviour of the current (to be obsoleted) code, thus should
the manual or the behaviour be adjusted?
END
-235
View File
@@ -1,235 +0,0 @@
New parameter parsing functions
===============================
It should be easier to parse input parameters to an extension function.
Hence, borrowing from Python's example, there are now a set of functions
that given the string of type specifiers, can parse the input parameters
and store the results in the user specified variables. This avoids most
of the IS_* checks and convert_to_* conversions. The functions also
check for the appropriate number of parameters, and try to output
meaningful error messages.
Prototypes
----------
/* Implemented. */
int zend_parse_parameters(int num_args, char *type_spec, ...);
int zend_parse_parameters_ex(int flags, int num_args, char *type_spec, ...);
The zend_parse_parameters() function takes the number of parameters
passed to the extension function, the type specifier string, and the
list of pointers to variables to store the results in. The _ex() version
also takes 'flags' argument -- current only ZEND_PARSE_PARAMS_QUIET can
be used as 'flags' to specify that the function should operate quietly
and not output any error messages.
Both functions return SUCCESS or FAILURE depending on the result.
The auto-conversions are performed as necessary. Arrays, objects, and
resources cannot be auto-converted.
PHP 5.3 includes a new function (actually implemented as macro):
int zend_parse_parameters_none();
This returns SUCCESS if no argument has been passed to the function,
FAILURE otherwise.
PHP 5.5 includes a new function:
int zend_parse_parameter(int flags, int arg_num, zval **arg, const char *spec, ...);
This function behaves like zend_parse_parameters_ex() except that instead of
reading the arguments from the stack, it receives a single zval to convert
(passed with double indirection). The passed zval may be changed in place as
part of the conversion process.
See also https://wiki.php.net/rfc/zpp_improv#expose_zend_parse_arg_as_zend_parse_parameter
Type specifiers
---------------
The following list shows the type specifier, its meaning and the parameter
types that need to be passed by address. All passed parameters are set
if the PHP parameter is non optional and untouched if optional and the
parameter is not present. The only exception is O where the zend_class_entry*
has to be provided on input and is used to verify the PHP parameter is an
instance of that class.
a - array (zval*)
A - array or object (zval*)
b - boolean (zend_bool)
C - class (zend_class_entry*)
d - double (double)
f - function or array containing php method call info (returned as
zend_fcall_info and zend_fcall_info_cache)
h - array (returned as HashTable*)
H - array or HASH_OF(object) (returned as HashTable*)
l - long (zend_long)
L - long, limits out-of-range numbers to LONG_MAX/LONG_MIN (zend_long, ZEND_LONG_MAX/ZEND_LONG_MIN)
o - object of any type (zval*)
O - object of specific type given by class entry (zval*, zend_class_entry)
p - valid path (string without null bytes in the middle) and its length (char*, size_t)
P - valid path (string without null bytes in the middle) as zend_string (zend_string*)
r - resource (zval*)
s - string (with possible null bytes) and its length (char*, size_t)
S - string (with possible null bytes) as zend_string (zend_string*)
z - the actual zval (zval*)
* - variable arguments list (0 or more)
+ - variable arguments list (1 or more)
The following characters also have a meaning in the specifier string:
| - indicates that the remaining parameters are optional, they
should be initialized to default values by the extension since they
will not be touched by the parsing function if they are not
passed to it.
/ - use SEPARATE_ZVAL_IF_NOT_REF() on the parameter it follows
! - the parameter it follows can be of specified type or NULL. If NULL is
passed and the output for such type is a pointer, then the output
pointer is set to a native NULL pointer.
For 'b', 'l' and 'd', an extra argument of type zend_bool* must be
passed after the corresponding bool*, zend_long* or double* arguments,
respectively. A non-zero value will be written to the zend_bool if a
PHP NULL is passed.
Note on 64bit compatibility
---------------------------
Please note that since version 7 PHP uses zend_long as integer type and
zend_string with size_t as length, so make sure you pass zend_longs to "l"
and size_t to strings length (i.e. for "s" you need to pass char * and size_t),
not the other way round!
Both mistakes might cause memory corruptions and segfaults:
1)
char *str;
long str_len; /* XXX THIS IS WRONG!! Use size_t instead. */
zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len)
2)
int num; /* XXX THIS IS WRONG!! Use zend_long instead. */
zend_parse_parameters(ZEND_NUM_ARGS(), "l", &num)
If you're in doubt, use check_parameters.php script to the parameters
and their types (it can be found in ./scripts/dev/ directory of PHP sources):
# php ./scripts/dev/check_parameters.php /path/to/your/sources/
Examples
--------
/* Gets a long, a string and its length, and a zval */
zend_long l;
char *s;
size_t s_len;
zval *param;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "lsz",
&l, &s, &s_len, &param) == FAILURE) {
return;
}
/* Gets an object of class specified by my_ce, and an optional double. */
zval *obj;
double d = 0.5;
zend_class_entry *my_ce;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|d",
&obj, my_ce, &d) == FAILURE) {
return;
}
/* Gets an object or null, and an array.
If null is passed for object, obj will be set to NULL. */
zval *obj;
zval *arr;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o!a",
&obj, &arr) == FAILURE) {
return;
}
/* Gets a separated array which can also be null. */
zval *arr;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/!",
&arr) == FAILURE) {
return;
}
/* Get either a set of 3 longs or a string. */
zend_long l1, l2, l3;
char *s;
/*
* The function expects a pointer to a size_t in this case, not a long
* or any other type. If you specify a type which is larger
* than a 'size_t', the upper bits might not be initialized
* properly, leading to random crashes on platforms like
* Tru64 or Linux/Alpha.
*/
size_t length;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
"lll", &l1, &l2, &l3) == SUCCESS) {
/* manipulate longs */
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
"s", &s, &length) == SUCCESS) {
/* manipulate string */
} else {
/* output error */
return;
}
/* Function that accepts only varargs (0 or more) */
int i, num_varargs;
zval *varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "*", &varargs, &num_varargs) == FAILURE) {
return;
}
for (i = 0; i < num_varargs; i++) {
/* do something with varargs[i] */
}
if (varargs) {
efree(varargs);
}
/* Function that accepts a string, followed by varargs (1 or more) */
char *str;
size_t str_len;
int i, num_varargs;
zval *varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s+", &str, &str_len, &varargs, &num_varargs) == FAILURE) {
return;
}
for (i = 0; i < num_varargs; i++) {
/* do something with varargs[i] */
}
/* Function that takes an array, followed by varargs, and ending with a long */
zend_long num;
zval *array;
int i, num_varargs;
zval *varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a*l", &array, &varargs, &num_varargs, &num) == FAILURE) {
return;
}
for (i = 0; i < num_varargs; i++) {
/* do something with varargs[i] */
}
/* Function that doesn't accept any arguments */
if (zend_parse_parameters_none() == FAILURE) {
return;
}
+238 -115
View File
@@ -1,25 +1,24 @@
1. libmagic (ext/fileinfo) see ext/fileinfo/libmagic/LICENSE
2. Oniguruma (ext/mbstring) see ext/mbstring/oniguruma/COPYING
3. libmbfl (ext/mbstring) see ext/mbstring/libmbfl/LICENSE
4. pcre2lib (ext/pcre)
5. ext/standard crypt
6. ext/standard crypt's blowfish implementation
7. Sqlite/Sqlite3 ext/sqlite3 ext/sqlite
8. ext/standard/rand
9. ext/standard/scanf
10. ext/standard/strnatcmp.c
11. ext/standard/uuencode
12. libxmlrpc ext/xmlrpc
13. libzip ext/zip
14. main/snprintf.c
15. main/strlcat
16. main/strlcpy
17. libgd see ext/gd/libgd/COPYING
18. ext/phar portions of tar implementations
19. libbcmath (ext/bcmath) see ext/bcmath/libbcmath/COPYING.LIB
1. libmagic (ext/fileinfo) see ext/fileinfo/libmagic/LICENSE
2. libmbfl (ext/mbstring) see ext/mbstring/libmbfl/LICENSE
3. pcre2lib (ext/pcre)
4. ext/standard crypt
5. ext/standard crypt's blowfish implementation
6. ext/standard/rand
7. ext/standard/scanf
8. ext/standard/strnatcmp.c
9. ext/standard/uuencode
10. libxmlrpc ext/xmlrpc
11. main/snprintf.c
12. main/strlcat
13. main/strlcpy
14. libgd (ext/gd)
15. ext/phar portions of tar implementations
16. ext/phar/zip.c portion extracted from libzip
17. libbcmath (ext/bcmath) see ext/bcmath/libbcmath/LICENSE
18. ext/mbstring/ucgendat portions based on the ucgendat.c from the OpenLDAP
4. pcre2lib (ext/pcre)
3. pcre2lib (ext/pcre)
PCRE2 LICENCE
-------------
@@ -27,11 +26,11 @@ PCRE2 LICENCE
PCRE2 is a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language.
Release 10 of PCRE2 is distributed under the terms of the "BSD" licence, as
specified below, with one exemption for certain binary redistributions. The
documentation for PCRE2, supplied in the "doc" directory, is distributed under
the same terms as the software itself. The data in the testdata directory is
not copyrighted and is in the public domain.
Releases 10.00 and above of PCRE2 are distributed under the terms of the "BSD"
licence, as specified below, with one exemption for certain binary
redistributions. The documentation for PCRE2, supplied in the "doc" directory,
is distributed under the same terms as the software itself. The data in the
testdata directory is not copyrighted and is in the public domain.
The basic library functions are written in C and are freestanding. Also
included in the distribution is a just-in-time compiler that can be used to
@@ -49,7 +48,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.
Copyright (c) 1997-2018 University of Cambridge
Copyright (c) 1997-2019 University of Cambridge
All rights reserved.
@@ -58,9 +57,9 @@ PCRE2 JUST-IN-TIME COMPILATION SUPPORT
Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
Email domain: freemail.hu
Copyright(c) 2010-2018 Zoltan Herczeg
Copyright(c) 2010-2019 Zoltan Herczeg
All rights reserved.
@@ -69,9 +68,9 @@ STACK-LESS JUST-IN-TIME COMPILER
Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
Email domain: freemail.hu
Copyright(c) 2009-2018 Zoltan Herczeg
Copyright(c) 2009-2019 Zoltan Herczeg
All rights reserved.
@@ -117,7 +116,7 @@ PCRE2 independently.
End
5. ext/standard crypt
4. ext/standard crypt
FreeSec: libcrypt for NetBSD
@@ -128,13 +127,13 @@ Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the author nor the names of other contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -149,7 +148,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
6. ext/standard crypt's blowfish implementation
5. ext/standard crypt's blowfish implementation
The crypt_blowfish homepage is:
@@ -195,16 +194,8 @@ Blowfish library (I can't be sure if I would think of something if I
hadn't seen his code).
7. Sqlite/Sqlite3 ext/sqlite3 ext/sqlite
6. ext/standard/rand
The author disclaims copyright to this source code. In place of
a legal notice, here is a blessing:
May you do good and not evil.
May you find forgiveness for yourself and forgive others.
May you share freely, never taking more than you give.
8. ext/standard/rand
The following php_mt_...() functions are based on a C++ class MTRand by
Richard J. Wagner. For more information see the web page at
http://www-personal.engin.umich.edu/~wagnerr/MersenneTwister.html
@@ -234,15 +225,15 @@ modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written
permission.
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -257,7 +248,8 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9. ext/standard/scanf
7. ext/standard/scanf
scanf.c --
This file contains the base code which implements sscanf and by extension
@@ -303,7 +295,8 @@ authors grant the U.S. Government and others acting in its behalf
permission to use and distribute the software in accordance with the
terms specified in this license.
10. ext/standard/strnatcmp.c
8. ext/standard/strnatcmp.c
strnatcmp.c -- Perform 'natural order' comparisons of strings in C.
Copyright (C) 2000 by Martin Pool <mbp@humbug.org.au>
@@ -317,14 +310,16 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
11. ext/standard/uuencode
9. ext/standard/uuencode
Portions of this code are based on Berkeley's uuencode/uudecode
implementation.
@@ -335,17 +330,17 @@ Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
must display the following acknowledgement:
This product includes software developed by the University of
California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -360,7 +355,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
12. libxmlrpc ext/xmlrpc
10. libxmlrpc ext/xmlrpc
Copyright 2000 Epinions, Inc.
@@ -384,39 +379,9 @@ OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING
NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH
DAMAGES.
13. libzip ext/zip
zip.h -- exported declarations.
Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP archives.
The authors can be contacted at <libzip@nih.at>
11. main/snprintf.c
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The names of the authors may not be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14. main/snprintf.c
Copyright (c) 2002, 2006 Todd C. Miller <Todd.Miller@courtesan.com>
Permission to use, copy, modify, and distribute this software for any
@@ -443,26 +408,26 @@ modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. All advertising materials mentioning features or use of this
software must display the following acknowledgment:
"This product includes software developed by the Apache Group
for use in the Apache HTTP server project (http://www.apache.org/)."
software must display the following acknowledgment:
"This product includes software developed by the Apache Group
for use in the Apache HTTP server project (http://www.apache.org/)."
4. The names "Apache Server" and "Apache Group" must not be used to
endorse or promote products derived from this software without
prior written permission.
endorse or promote products derived from this software without
prior written permission.
5. Redistributions of any form whatsoever must retain the following
acknowledgment:
"This product includes software developed by the Apache Group
for use in the Apache HTTP server project (http://www.apache.org/)."
acknowledgment:
"This product includes software developed by the Apache Group
for use in the Apache HTTP server project (http://www.apache.org/)."
THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -489,8 +454,10 @@ This code is based on, and used with the permission of, the
SIO stdio-replacement strx_* functions by Panos Tsirigotis
<panos@alumni.cs.colorado.edu> for xinetd.
15. main/strlcat
16. main/strlcpy
12. main/strlcat
13. main/strlcpy
Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
All rights reserved.
@@ -498,12 +465,12 @@ Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
@@ -516,7 +483,78 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18. ext/phar portions of tar implementations
14. libgd (ext/gd)
* Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004 by Cold Spring Harbor Laboratory. Funded under
Grant P41-RR02188 by the National Institutes of Health.
* Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004 by Boutell.Com, Inc.
* Portions relating to GD2 format copyright 1999, 2000, 2001, 2002,
2003, 2004 Philip Warner.
* Portions relating to PNG copyright 1999, 2000, 2001, 2002, 2003,
2004 Greg Roelofs.
* Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002,
2003, 2004 John Ellson (ellson@graphviz.org).
* Portions relating to gdft.c copyright 2001, 2002, 2003, 2004 John
Ellson (ellson@graphviz.org).
* Portions copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Pierre-Alain Joye (pierre@libgd.org).
* Portions relating to JPEG and to color quantization copyright
2000, 2001, 2002, 2003, 2004, Doug Becker and copyright (C) 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Thomas
G. Lane. This software is based in part on the work of the
Independent JPEG Group. See the file README-JPEG.TXT for more
information.
* Portions relating to GIF compression copyright 1989 by Jef
Poskanzer and David Rowley, with modifications for thread safety
by Thomas Boutell.
* Portions relating to GIF decompression copyright 1990, 1991, 1993
by David Koblas, with modifications for thread safety by Thomas
Boutell.
* Portions relating to WBMP copyright 2000, 2001, 2002, 2003, 2004
Maurice Szmurlo and Johan Van den Brande.
* Portions relating to GIF animations copyright 2004 Jaakko Hyvätti
(jaakko.hyvatti@iki.fi)
Permission has been granted to copy, distribute and modify gd in
any context without fee, including a commercial application,
provided that this notice is present in user-accessible supporting
documentation.
This does not affect your ownership of the derived work itself,
and the intent is to assure proper credit for the authors of gd,
not to interfere with your productive use of gd. If you have
questions, ask. "Derived works" includes all programs that utilize
the library. Credit must be given in user-accessible
documentation.
This software is provided "AS IS." The copyright holders disclaim
all warranties, either express or implied, including but not
limited to implied warranties of merchantability and fitness for a
particular purpose, with respect to this code and accompanying
documentation.
Although their code does not appear in the current release, the
authors wish to thank David Koblas, David Rowley, and Hutchison
Avenue Software Corporation for their prior contributions.
END OF COPYRIGHT STATEMENT
15. ext/phar portions of tar implementations
portions of tar implementations in ext/phar - phar_tar_octal() are based on an
implementation by Tim Kientzle from libarchive, licensed with this license:
@@ -543,3 +581,88 @@ implementation by Tim Kientzle from libarchive, licensed with this license:
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16. ext/phar/zip.c portion extracted from libzip
zip_dirent.c -- read directory entry (local or central), clean dirent
Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner
This function is part of libzip, a library to manipulate ZIP archives.
The authors can be contacted at <nih@giga.or.at>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The names of the authors may not be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18. ext/mbstring/ucgendat portions based on the ucgendat.c from the OpenLDAP
The OpenLDAP Public License
Version 2.8, 17 August 2003
Redistribution and use of this software and associated documentation
("Software"), with or without modification, are permitted provided
that the following conditions are met:
1. Redistributions in source form must retain copyright statements
and notices,
2. Redistributions in binary form must reproduce applicable copyright
statements and notices, this list of conditions, and the following
disclaimer in the documentation and/or other materials provided
with the distribution, and
3. Redistributions must contain a verbatim copy of this document.
The OpenLDAP Foundation may revise this license from time to time.
Each revision is distinguished by a version number. You may use
this Software under terms of this license revision or under the
terms of any subsequent revision of the license.
THIS SOFTWARE IS PROVIDED BY THE OPENLDAP FOUNDATION AND ITS
CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE OPENLDAP FOUNDATION, ITS CONTRIBUTORS, OR THE AUTHOR(S)
OR OWNER(S) OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
The names of the authors and copyright holders must not be used in
advertising or otherwise to promote the sale, use or other dealing
in this Software without specific, written prior permission. Title
to copyright in this Software shall at all times remain with copyright
holders.
OpenLDAP is a registered trademark of the OpenLDAP Foundation.
Copyright 1999-2003 The OpenLDAP Foundation, Redwood City,
California, USA. All Rights Reserved. Permission to copy and
distribute verbatim copies of this document is granted.
-372
View File
@@ -1,372 +0,0 @@
=======================
PHP Release Process
=======================
General notes and tips
----------------------
1. Do not release on Fridays, Saturdays or Sundays
because the sysadmins can not upgrade stuff then.
2. Package two days before a release. So if the release is to be on Thursday,
package on Tuesday. Think about timezones as well.
3. Ensure that the tests on Travis CI are green.
See: https://travis-ci.org/php/php-src/builds
It is recommended to do so a couple of days before the packaging day, to
have enough time to investigate failures, communicate with the authors and
commit the fixes.
The RM for the branch is also responsible for keeping the CI green on
ongoing basis between the releases. Check the CI status for your branch
periodically and resolve the failures ASAP. See more in:
https://wiki.php.net/rfc/travis_ci
4. Ensure that Windows builds will work before packaging
5. Follow all steps to the letter. When unclear ask previous RM's (David/Julien/
Johannes/Stas/Derick/Ilia) before proceeding. Ideally make sure that for the
first releases one of the previous RM's is around to answer questions. For the
steps related to the php/QA/bug websites try to have someone from the webmaster
team (Bjori) on hand.
6. Verify the tags to be extra sure everything was tagged properly.
7. Moving extensions from/to PECL requires write access to the destination.
Most developers should have this.
Moving extensions from php-src to PECL
- Checkout the pecl directory, most likely you want a sparse-root checkout
svn co --depth=empty https://svn.php.net/repository/pecl
- Create a directory for the extension incl. branch and tag structure,
no trunk at this point and commit this to svn
cd pecl; mkdir foo foo/tags foo/branches; svn add foo; svn commit
- Move the extension from php-src to the new location
svn mv https://svn.php.net/repository/php/php-src/trunk/ext/foo \
https://svn.php.net/repository/pecl/foo/trunk
If the extension is still usable or not dead, in cooperation with the extension
maintainers if any:
- create the pecl.php.net/foo package and its content, license, maintainer
- create the package.xml, commit
- release the package
For Moving extensions from PECL to php-src the svn mv has to be done the other
way round.
Rolling a non stable release (alpha/beta/RC)
--------------------------------------------
1. Check windows snapshot builder logs (http://windows.php.net/downloads/snaps/ the last revision)
2. Check the tests at https://travis-ci.org/php/php-src/builds
3. run the "scripts/dev/credits" script in php-src and commit the changes in the
credits files in ext/standard.
4. Checkout the release branch for this release (e.g., PHP-5.4.2) from the main branch.
5. Bump the version numbers in ``main/php_version.h``, ``configure.ac`` and possibly ``NEWS``.
Do not use abbreviations for alpha and beta. Do not use dashes, you should
``#define PHP_VERSION "5.4.22RC1"`` and not ``#define PHP_VERSION "5.4.22-RC1"``
6. Compile and make test, with and without ZTS, using the right Bison version
(for example, for 5.5, Bison 2.4.1 is used)
7. Check ./sapi/cli/php -v output for version matching.
8. If all is right, commit the changes to the release branch with ``git commit -a``.
9. Tag the repository release branch with the version, e.g.:
``git tag -u YOURKEYID php-5.4.2RC2``
10. Bump the version numbers in ``main/php_version.h``, ``configure.ac`` and ``NEWS``
in the *main* branch (PHP-5.4 for example) to prepare for the **next** version.
F.e. if the RC is "5.4.1RC1" then the new one should be "5.4.2-dev" - regardless if we get
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
Commit the changes to the main branch.
11. Push the changes to the main repo, the tag, the main branch and the release branch :
``git push --tags origin HEAD``
``git push origin {main branch}``
``git push origin {release branch}``
12. run: ``PHPROOT=. ./makedist 5.4.2RC2``, this will export the tree, create configure
and build three tarballs (gz, bz2 and xz).
13. run ``scripts/dev/gen_verify_stub <version> [identity]``, this will sign the tarballs
and output verification information to be included in announcement email
14. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
directory "public_html/". Copy them into there, so that the system can generate
MD5 sums. If you do not have this directory, create it.
15. Now the RC can be found on http://downloads.php.net/~yourname,
f.e. http://downloads.php.net/~derick/
16. Once the release has been tagged, contact the release-managers@ distribution list
so that Windows binaries can be created. Once those are made, they can be found at
http://windows.php.net/download
Getting the non stable release (alpha/beta/RC) announced
--------------------------------------------------------
1. Update ``qa.git/include/release-qa.php`` with the appropriate information.
See the documentation within release-qa.php for more information, but all releases
and RCs are configured here. Only $QA_RELEASES needs to be edited.
Example: When rolling an RC, set the 'rc' with appropriate information for the
given version.
Note: Remember to update the MD5 and sha256 checksum information.
2. Update ``web/php.git/include/version.inc`` (x=major version number)
a. ``$PHP_x_RC`` = "5.4.0RC1" (should be set to "false" before)
b. ``$PHP_x_RC_DATE`` = "06 September 2007"
3. Add a short notice to phpweb stating that there is a new release, and
highlight the major important things (security fixes) and when it is important
to upgrade.
a. Call php bin/createNewsEntry in your local phpweb checkout
Use category "releases" for all stable releases.
Use category "frontpage" for X.Y.0 non-stable releases only (news only).
b. Add the content for the news entry. Be sure to include the text:
"THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION!"
4. Commit and push changes to qa and web
*Wait for web and qa sites to update with new information before sending announce*
5. Send **separate** emails **To** ``internals@lists.php.net`` and ``php-general@lists.php.net``
lists pointing out "the location of the release" and "the possible release date of
either the next RC, or the final release". Include in this information the verification
information output by ``gen_verify_stub``.
6. Send **separate** emails (see example here http://news.php.net/php.pear.qa/5201) **To**
``php-qa@lists.php.net`` and ``primary-qa-tester@lists.php.net``.
These emails are to notify the selected projects about a new release so that they
can make sure their projects keep working. Make sure that you have been setup
as a moderator for ``primary-qa-tester@lists.php.net`` by having someone (Hannes, Dan,
Derick) run the following commands for you:
``ssh lists.php.net``
``sudo -u ezmlm ezmlm-sub ~ezmlm/primary-qa-tester/mod moderator-email-address``
Rolling a stable release
------------------------
1. Checkout your release branch, you should have created when releasing previous RC
and bump the version numbers in ``main/php_version.h``, ``configure.ac`` and possibly ``NEWS``.
2. If a CVE commit needs to be merged to the release, then have it committed to
the base branches and merged upwards as usual (f.e commit the CVE fix to 5.3,
merge to 5.4, 5.5 etc...). Then you can cherry-pick it in your release branch.
Don't forget to update NEWS manually in an extra commit then.
3. Commit those changes. Ensure the tests at https://travis-ci.org/php/php-src/builds are
still passing.
4. run the "scripts/dev/credits" script in php-src and commit the changes in the
credits files in ext/standard.
5. Compile and make test, with and without ZTS, using the right Bison version
(for example, for 5.5, Bison 2.4.1 is used)
6. Check ./sapi/cli/php -v output for version matching.
7. tag the repository with the version f.e. "``git tag -u YOURKEYID -s php-5.4.1``"
8. Push the tag f.e. "``git push origin php-5.4.1``"
9. run: ``PHPROOT=. ./makedist php 5.4.1``, this will export the tag, create configure
and build three tarballs (gz, bz2 and xz).
Check if the pear files are updated (phar).
On some systems the behavior of GNU tar can default to produce POSIX compliant archives
with PAX headers. As not every application is compatible with that format, creation of
archives with PAX headers should be avoided. When packaging on such a system, the GNU tar
can be influenced by defining the environment variable TAR_OPTIONS='--format=gnu'.
10. Generate the GPG signature files for the archives.
``gpg -u YOUREMAIL --armor --detach-sign php-X.Y.Z.tar.xxx``
11. Commit and push all the tarballs and signature files to web/php-distributions.git,
then update the git submodule reference in web/php.git:
``git submodule init;
git submodule update;
cd distributions;
git fetch;
git pull --rebase origin master;
cd ..;
git commit distributions;
git push;``
This is to fetch the last commit id from php-distributions.git and commit this
last commit id to web/php.git, then, mirrors will now sync
12. Once the release has been tagged, contact release managers, windows builders, and package maintainers
so that they can build releases. Do not send this announcement to any public lists.
Getting the stable release announced
------------------------------------
1. Update phpweb/include/releases.inc with the old release info
(updates the download archives)
a. You can run ``php bin/bumpRelease 5`` if you are making a release for the
highest branch, otherwise you have to do this manually, see point 1.b
b. In case multiple PHP minor versions are in active development you have
to manually copy the old information to include/releases.inc
2. Edit ``phpweb/include/version.inc`` and change (X=major release number):
a. ``$PHP_X_VERSION`` to the correct version
b. ``$PHP_X_DATE`` to the release date
c. ``$PHP_X_MD5`` array and update all the md5 sums
d. ``$PHP_X_SHA256`` array and update all the SHA256 sums
e. set ``$PHP_X_RC`` to false!
f. Make sure there are no outdated "notes" or edited "date" keys in the
``$RELEASES[X][$PHP_X_VERSION]["source"]`` array
g. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows")
3. Create the release file (releases/x_y_z.php)
Usually we use the same content as for point 6, but included in php template
instead of the release xml.
4. Update php-qa/include/release-qa.php and add the next version as an QARELEASE
(prepare for next RC)
5. Update the ChangeLog file for the given major version
f.e. ``ChangeLog-5.php`` from the NEWS file
a. go over the list and put every element on one line
b. check for &, < and > and escape them if necessary
c. remove all the names at the ends of lines
d. for marking up, you can do the following (with VI):
I. ``s/^- /<li>/``
II. ``s/$/<\/li>/``
III. ``s/Fixed bug #\([0-9]\+\)/<?php bugfix(\1); ?>/``
IV. ``s/Fixed PECL bug #\([0-9]\+\)/<?php peclbugfix(\1); ?>/``
V. ``s/FR #\([0-9]\+\)/FR <?php bugl(\1); ?>/``
e. You may want to try php-web/bin/news2html to automate this task
6. Add a short notice to phpweb stating that there is a new release, and
highlight the major important things (security fixes) and when it is important
to upgrade.
a. Call php bin/createNewsEntry in your local phpweb checkout
b. Add the content for the news entry
7. **Check mirrors have been synced before announcing or pushing news**
Try, f.e. http://www.php.net/get/php-5.5.1.tar.bz2/from/a/mirror
Try several mirrors, mirrors may update slowly (may take an hour)
8. Commit all the changes to their respective git repos
9. Please note down the sha256 and the PGP signature (.asc). These *must* be
included in the release mail.
10. Wait an hour or two, then send a mail to php-announce@lists.php.net,
php-general@lists.php.net and internals@lists.php.net with a text similar to
http://news.php.net/php.internals/17222.
Please make sure that the mail to php-announce@ is its own completely separate email.
This is to make sure that replies to the announcement on php-general@ or internals@
will not accidentally hit the php-announce@ mailinglist.
Re-releasing the same version (or -pl)
--------------------------------------
1. Commit the new binaries to ``phpweb/distributions/``
2. Edit ``phpweb/include/version.inc`` and change (X=major release number):
a. If only releasing for one OS, make sure you edit only those variables
b. ``$PHP_X_VERSION`` to the correct version
c. ``$PHP_X_DATE`` to the release date
d. ``$PHP_X_MD5`` array and update all the md5 sums
e. ``$PHP_X_SHA256`` array and update all the SHA256 sums
f. Make sure there are no outdated "notes" or edited "date" keys in the
``$RELEASES[X][$PHP_X_VERSION]["source"]`` array
3. Add a short notice to phpweb stating that there is a new release, and
highlight the major important things (security fixes) and when it is important
to upgrade.
a. Call php bin/createNewsEntry in your local phpweb checkout
b. Add the content for the news entry
4. Commit all the changes (``include/version.inc``, ``archive/archive.xml``,
``archive/entries/YYYY-MM-DD-N.xml``)
5. Wait an hour or two, then send a mail to php-announce@lists.php.net,
php-general@lists.php.net and internals@lists.php.net with a text similar to
the news entry.
Please make sure that the mail to php-announce@ is its own completely separate email.
This is to make sure that replies to the announcement on php-general@ or internals@
will not accidentally hit the php-announce@ mailinglist.
Forking a new release branch
----------------------------
1. One week prior to cutting X.Y.0beta1, warn internals@ that your version's branch
is about to be cut, and that PHP-X.Y will be moving into feature freeze.
Try to be specific about when the branch will be cut.
Example: http://news.php.net/php.internals/99864
2. Just prior to cutting X.Y.0beta1, create the new branch locally.
Add a commit on master after the branch point clearing the NEWS file, and updating
main/php_versions.h and Zend/zend.h to update versions.
Example: https://github.com/php/php-src/commit/5230541ef59e0637d5522293a7d099bf18ce6af3
Push the new branch and the commit just added to master.
3. Immediately notify internals@ of the branch cut and advise the new merging order:
Example: http://news.php.net/php.internals/99903
4. Update php-web:git.php and wiki.php.net/vcs/gitworkflow to reflect the new branch:
Example: https://github.com/php/web-php/commit/74bcad4c770d95f21b7fbeeedbd76d943bb83f23
5. Notify nlopess@ to add PHP_X_Y tag to gcov.php.net
New Release Manager Checklist
-----------------------------
1. Email systems@ to get setup for access to downloads.php.net and to be added to the
release-managers@ distribution list.
2. Create a GPG key for your @php.net address and publish it by editing `include/gpg-keys.inc`
in the `web-php` repository, adding the output of `gpg --fingerprint "$USER@php.net"`. Let
one or more of the previous RMs sign your key. Publish your public key to pgp.mit.edu with:
`gpg --keyserver pgp.mit.edu --send-keys $KEYID`
3. Request karma to edit main/php_version.h. Possibly karma for other restricted parts of
php-src might come in question.
4. Request karma for web/qa.git and web/php.git for publishing release announcements.
5. Request moderation access to announce@php.net and primary-qa-tester@lists.php.net lists, to
be able to moderate your release announcements. All the announcements should be sent from
the @php.net alias.
-166
View File
@@ -1,166 +0,0 @@
HOW TO CREATE A SELF-CONTAINED PHP EXTENSION
A self-contained extension can be distributed independently of
the PHP source. To create such an extension, two things are
required:
- Configuration file (config.m4)
- Source code for your module
We will describe now how to create these and how to put things
together.
PREPARING YOUR SYSTEM
While the result will run on any system, a developer's setup needs these
tools:
GNU autoconf
GNU automake
GNU libtool
GNU m4
All of these are available from
ftp://ftp.gnu.org/pub/gnu/
CONVERTING AN EXISTING EXTENSION
Just to show you how easy it is to create a self-contained
extension, we will convert an embedded extension into a
self-contained one. Install PHP and execute the following
commands.
$ mkdir /tmp/newext
$ cd /tmp/newext
You now have an empty directory. We will copy the files from
the mysql extension:
$ cp -rp php-4.0.X/ext/mysql/* .
It is time to finish the module. Run:
$ phpize
You can now ship the contents of the directory - the extension
can live completely on its own.
The user instructions boil down to
$ ./configure \
[--with-php-config=/path/to/php-config] \
[--with-mysql=MYSQL-DIR]
$ make install
The MySQL module will either use the embedded MySQL client
library or the MySQL installation in MYSQL-DIR.
DEFINING THE NEW EXTENSION
Our demo extension is called "foobar".
It consists of two source files "foo.c" and "bar.c"
(and any arbitrary amount of header files, but that is not
important here).
The demo extension does not reference any external
libraries (that is important, because the user does not
need to specify anything).
LTLIBRARY_SOURCES specifies the names of the sources files. You can
name an arbitrary number of source files here.
CREATING THE M4 CONFIGURATION FILE
The m4 configuration can perform additional checks. For a
self-contained extension, you do not need more than a few
macro calls.
------------------------------------------------------------------------------
PHP_ARG_ENABLE(foobar,whether to enable foobar,
[ --enable-foobar Enable foobar])
if test "$PHP_FOOBAR" != "no"; then
PHP_NEW_EXTENSION(foobar, foo.c bar.c, $ext_shared)
fi
------------------------------------------------------------------------------
PHP_ARG_ENABLE will automatically set the correct variables, so
that the extension will be enabled by PHP_NEW_EXTENSION in shared mode.
The first argument of PHP_NEW_EXTENSION describes the name of the
extension. The second names the source-code files. The third passes
$ext_shared which is set by PHP_ARG_ENABLE/WITH to PHP_NEW_EXTENSION.
Please use always PHP_ARG_ENABLE or PHP_ARG_WITH. Even if you do not
plan to distribute your module with PHP, these facilities allow you
to integrate your module easily into the main PHP module framework.
CREATING SOURCE FILES
ext_skel can be of great help when creating the common code for all modules
in PHP for you and also writing basic function definitions and C code for
handling arguments passed to your functions. See README.EXT_SKEL for further
information.
As for the rest, you are currently alone here. There are a lot of existing
modules, use a simple module as a starting point and add your own code.
CREATING THE SELF-CONTAINED EXTENSION
Put config.m4 and the source files into one directory. Then, run phpize
(this is installed during make install by PHP 4.0).
For example, if you configured PHP with --prefix=/php, you would run
$ /php/bin/phpize
This will automatically copy the necessary build files and create
configure from your config.m4.
And that's it. You now have a self-contained extension.
INSTALLING A SELF-CONTAINED EXTENSION
An extension can be installed by running:
$ ./configure \
[--with-php-config=/path/to/php-config]
$ make install
ADDING SHARED MODULE SUPPORT TO A MODULE
In order to be useful, a self-contained extension must be loadable
as a shared module. I will explain now how you can add shared module
support to an existing module called foo.
1. In config.m4, use PHP_ARG_WITH/PHP_ARG_ENABLE. Then you will
automatically be able to use --with-foo=shared[,..] or
--enable-foo=shared[,..].
2. In config.m4, use PHP_NEW_EXTENSION(foo,.., $ext_shared) to enable
building the extension.
3. Add the following lines to your C source file:
#ifdef COMPILE_DL_FOO
ZEND_GET_MODULE(foo)
#endif
PECL SITE CONFORMITY
If you plan to release an extension to the PECL website, there are several
points to be regarded.
1. Add LICENSE or COPYING to the package.xml
2. The following should be defined in one of the extension header files
#define PHP_FOO_VERSION "1.2.3"
This macros has to be used within your foo_module_entry to indicate the
extension version.
-378
View File
@@ -1,378 +0,0 @@
An Overview of the PHP Streams abstraction
==========================================
WARNING: some prototypes in this file are out of date.
The information contained here is being integrated into
the PHP manual - stay tuned...
Please send comments to: Wez Furlong <wez@thebrainroom.com>
Why Streams?
============
You may have noticed a shed-load of issock parameters flying around the PHP
code; we don't want them - they are ugly and cumbersome and force you to
special case sockets and files every time you need to work with a "user-level"
PHP file pointer.
Streams take care of that and present the PHP extension coder with an ANSI
stdio-alike API that looks much nicer and can be extended to support non file
based data sources.
Using Streams
=============
Streams use a php_stream* parameter just as ANSI stdio (fread etc.) use a
FILE* parameter.
The main functions are:
PHPAPI size_t php_stream_read(php_stream * stream, char * buf, size_t count);
PHPAPI size_t php_stream_write(php_stream * stream, const char * buf, size_t
count);
PHPAPI size_t php_stream_printf(php_stream * stream,
const char * fmt, ...);
PHPAPI int php_stream_eof(php_stream * stream);
PHPAPI int php_stream_getc(php_stream * stream);
PHPAPI char *php_stream_gets(php_stream * stream, char *buf, size_t maxlen);
PHPAPI int php_stream_close(php_stream * stream);
PHPAPI int php_stream_flush(php_stream * stream);
PHPAPI int php_stream_seek(php_stream * stream, off_t offset, int whence);
PHPAPI off_t php_stream_tell(php_stream * stream);
PHPAPI int php_stream_lock(php_stream * stream, int mode);
These (should) behave in the same way as the ANSI stdio functions with similar
names: fread, fwrite, fprintf, feof, fgetc, fgets, fclose, fflush, fseek, ftell, flock.
Opening Streams
===============
In most cases, you should use this API:
PHPAPI php_stream *php_stream_open_wrapper(const char *path, const char *mode,
int options, char **opened_path);
Where:
path is the file or resource to open.
mode is the stdio compatible mode eg: "wb", "rb" etc.
options is a combination of the following values:
IGNORE_PATH (default) - don't use include path to search for the file
USE_PATH - use include path to search for the file
IGNORE_URL - do not use plugin wrappers
REPORT_ERRORS - show errors in a standard format if something
goes wrong.
STREAM_MUST_SEEK - If you really need to be able to seek the stream
and don't need to be able to write to the original
file/URL, use this option to arrange for the stream
to be copied (if needed) into a stream that can
be seek()ed.
opened_path is used to return the path of the actual file opened,
but if you used STREAM_MUST_SEEK, may not be valid. You are
responsible for efree()ing opened_path. opened_path may be (and usually
is) NULL.
If you need to open a specific stream, or convert standard resources into
streams there are a range of functions to do this defined in php_streams.h.
A brief list of the most commonly used functions:
PHPAPI php_stream *php_stream_fopen_from_file(FILE *file, const char *mode);
Convert a FILE * into a stream.
PHPAPI php_stream *php_stream_fopen_tmpfile(void);
Open a FILE * with tmpfile() and convert into a stream.
PHPAPI php_stream *php_stream_fopen_temporary_file(const char *dir,
const char *pfx, char **opened_path);
Generate a temporary file name and open it.
There are some network enabled relatives in php_network.h:
PHPAPI php_stream *php_stream_sock_open_from_socket(int socket, int persistent);
Convert a socket into a stream.
PHPAPI php_stream *php_stream_sock_open_host(const char *host, unsigned short port,
int socktype, int timeout, int persistent);
Open a connection to a host and return a stream.
PHPAPI php_stream *php_stream_sock_open_unix(const char *path, int persistent,
struct timeval *timeout);
Open a UNIX domain socket.
Stream Utilities
================
If you need to copy some data from one stream to another, you will be please
to know that the streams API provides a standard way to do this:
PHPAPI size_t php_stream_copy_to_stream(php_stream *src,
php_stream *dest, size_t maxlen);
If you want to copy all remaining data from the src stream, pass
PHP_STREAM_COPY_ALL as the maxlen parameter, otherwise maxlen indicates the
number of bytes to copy.
This function will try to use mmap where available to make the copying more
efficient.
If you want to read the contents of a stream into an allocated memory buffer,
you should use:
PHPAPI size_t php_stream_copy_to_mem(php_stream *src, char **buf,
size_t maxlen, int persistent);
This function will set buf to the address of the buffer that it allocated,
which will be maxlen bytes in length, or will be the entire length of the
data remaining on the stream if you set maxlen to PHP_STREAM_COPY_ALL.
The buffer is allocated using pemalloc(); you need to call pefree() to
release the memory when you are done.
As with copy_to_stream, this function will try use mmap where it can.
If you have an existing stream and need to be able to seek() it, you
can use this function to copy the contents into a new stream that can
be seek()ed:
PHPAPI int php_stream_make_seekable(php_stream *origstream, php_stream **newstream);
It returns one of the following values:
#define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */
#define PHP_STREAM_RELEASED 1 /* newstream should be used; origstream is no longer valid */
#define PHP_STREAM_FAILED 2 /* an error occurred while attempting conversion */
#define PHP_STREAM_CRITICAL 3 /* an error occurred; origstream is in an unknown state; you should close origstream */
make_seekable will always set newstream to be the stream that is valid
if the function succeeds.
When you have finished, remember to close the stream.
NOTE: If you only need to seek forward, there is no need to call this
function, as the php_stream_seek can emulate forward seeking when the
whence parameter is SEEK_CUR.
NOTE: Writing to the stream may not affect the original source, so it
only makes sense to use this for read-only use.
NOTE: If the origstream is network based, this function will block
until the whole contents have been downloaded.
NOTE: Never call this function with an origstream that is referenced
as a resource! It will close the origstream on success, and this
can lead to a crash when the resource is later used/released.
NOTE: If you are opening a stream and need it to be seekable, use the
STREAM_MUST_SEEK option to php_stream_open_wrapper();
PHPAPI int php_stream_supports_lock(php_stream * stream);
This function will return either 1 (success) or 0 (failure) indicating whether or
not a lock can be set on this stream. Typically you can only set locks on stdio streams.
Casting Streams
===============
What if your extension needs to access the FILE* of a user level file pointer?
You need to "cast" the stream into a FILE*, and this is how you do it:
FILE * fp;
php_stream * stream; /* already opened */
if (php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void*)&fp, REPORT_ERRORS) == FAILURE) {
RETURN_FALSE;
}
The prototype is:
PHPAPI int php_stream_cast(php_stream * stream, int castas, void ** ret, int
show_err);
The show_err parameter, if non-zero, will cause the function to display an
appropriate error message of type E_WARNING if the cast fails.
castas can be one of the following values:
PHP_STREAM_AS_STDIO - a stdio FILE*
PHP_STREAM_AS_FD - a generic file descriptor
PHP_STREAM_AS_SOCKETD - a socket descriptor
If you ask a socket stream for a FILE*, the abstraction will use fdopen to
create it for you. Be warned that doing so may cause buffered data to be lost
if you mix ANSI stdio calls on the FILE* with php stream calls on the stream.
If your system has the fopencookie function, php streams can synthesize a
FILE* on top of any stream, which is useful for SSL sockets, memory based
streams, data base streams etc. etc.
In situations where this is not desirable, you should query the stream
to see if it naturally supports FILE *. You can use this code snippet
for this purpose:
if (php_stream_is(stream, PHP_STREAM_IS_STDIO)) {
/* can safely cast to FILE* with no adverse side effects */
}
You can use:
PHPAPI int php_stream_can_cast(php_stream * stream, int castas)
to find out if a stream can be cast, without actually performing the cast, so
to check if a stream is a socket you might use:
if (php_stream_can_cast(stream, PHP_STREAM_AS_SOCKETD) == SUCCESS) {
/* it can be a socket */
}
Please note the difference between php_stream_is and php_stream_can_cast;
stream_is tells you if the stream is a particular type of stream, whereas
can_cast tells you if the stream can be forced into the form you request.
The former doesn't change anything, while the later *might* change some
state in the stream.
Stream Internals
================
There are two main structures associated with a stream - the php_stream
itself, which holds some state information (and possibly a buffer) and a
php_stream_ops structure, which holds the "virtual method table" for the
underlying implementation.
The php_streams ops struct consists of pointers to methods that implement
read, write, close, flush, seek, gets and cast operations. Of these, an
implementation need only implement write, read, close and flush. The gets
method is intended to be used for streams if there is an underlying method
that can efficiently behave as fgets. The ops struct also contains a label
for the implementation that will be used when printing error messages - the
stdio implementation has a label of "STDIO" for example.
The idea is that a stream implementation defines a php_stream_ops struct, and
associates it with a php_stream using php_stream_alloc.
As an example, the php_stream_fopen() function looks like this:
PHPAPI php_stream * php_stream_fopen(const char * filename, const char * mode)
{
FILE * fp = fopen(filename, mode);
php_stream * ret;
if (fp) {
ret = php_stream_alloc(&php_stream_stdio_ops, fp, 0, 0, mode);
if (ret)
return ret;
fclose(fp);
}
return NULL;
}
php_stream_stdio_ops is a php_stream_ops structure that can be used to handle
FILE* based streams.
A socket based stream would use code similar to that above to create a stream
to be passed back to fopen_wrapper (or it's yet to be implemented successor).
The prototype for php_stream_alloc is this:
PHPAPI php_stream * php_stream_alloc(php_stream_ops * ops, void * abstract,
size_t bufsize, int persistent, const char * mode)
ops is a pointer to the implementation,
abstract holds implementation specific data that is relevant to this instance
of the stream,
bufsize is the size of the buffer to use - if 0, then buffering at the stream
level will be disabled (recommended for underlying sources that implement
their own buffering - such a FILE*),
persistent controls how the memory is to be allocated - persistently so that
it lasts across requests, or non-persistently so that it is freed at the end
of a request (it uses pemalloc),
mode is the stdio-like mode of operation - php streams places no real meaning
in the mode parameter, except that it checks for a 'w' in the string when
attempting to write (this may change).
The mode parameter is passed on to fdopen/fopencookie when the stream is cast
into a FILE*, so it should be compatible with the mode parameter of fopen().
Writing your own stream implementation
======================================
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
RULE #1: when writing your own streams: make sure you have configured PHP with
--enable-debug.
I've taken some great pains to hook into the Zend memory manager to help track
down allocation problems. It will also help you spot incorrect use of the
STREAMS_DC, STREAMS_CC and the semi-private STREAMS_REL_CC macros for function
definitions.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
RULE #2: Please use the stdio stream as a reference; it will help you
understand the semantics of the stream operations, and it will always
be more up to date than these docs :-)
First, you need to figure out what data you need to associate with the
php_stream. For example, you might need a pointer to some memory for memory
based streams, or if you were making a stream to read data from an RDBMS like
MySQL, you might want to store the connection and rowset handles.
The stream has a field called abstract that you can use to hold this data.
If you need to store more than a single field of data, define a structure to
hold it, allocate it (use pemalloc with the persistent flag set
appropriately), and use the abstract pointer to refer to it.
For structured state you might have this:
struct my_state {
MYSQL conn;
MYSQL_RES * result;
};
struct my_state * state = pemalloc(sizeof(struct my_state), persistent);
/* initialize the connection, and run a query, using the fields in state to
* hold the results */
state->result = mysql_use_result(&state->conn);
/* now allocate the stream itself */
stream = php_stream_alloc(&my_ops, state, 0, persistent, "r");
/* now stream->abstract == state */
Once you have that part figured out, you can write your implementation and
define the your own php_stream_ops struct (we called it my_ops in the above
example).
For example, for reading from this weird MySQL stream:
static size_t php_mysqlop_read(php_stream * stream, char * buf, size_t count)
{
struct my_state * state = (struct my_state*)stream->abstract;
if (buf == NULL && count == 0) {
/* in this special case, php_streams is asking if we have reached the
* end of file */
if (... at end of file ...)
return EOF;
else
return 0;
}
/* pull out some data from the stream and put it in buf */
... mysql_fetch_row(state->result) ...
/* we could do something strange, like format the data as XML here,
and place that in the buf, but that brings in some complexities,
such as coping with a buffer size too small to hold the data,
so I won't even go in to how to do that here */
}
Implement the other operations - remember that write, read, close and flush
are all mandatory. The rest are optional. Declare your stream ops struct:
php_stream_ops my_ops = {
php_mysqlop_write, php_mysqlop_read, php_mysqlop_close,
php_mysqlop_flush, NULL, NULL, NULL,
"Strange MySQL example"
}
Thats it!
Take a look at the STDIO implementation in streams.c for more information
about how these operations work.
The main thing to remember is that in your close operation you need to release
and free the resources you allocated for the abstract field. In the case of
the example above, you need to use mysql_free_result on the rowset, close the
connection and then use pefree to dispose of the struct you allocated.
You may read the stream->persistent field to determine if your struct was
allocated in persistent mode or not.
vim:tw=78:et
-194
View File
@@ -1,194 +0,0 @@
Submitting Enhancements and Patches to PHP
==========================================
This document describes how to submit an enhancement or patch for PHP.
It's easy!
You don't need any login accounts or special access to download,
build, debug and begin submitting PHP or PECL code, tests or
documentation. Once you've followed this README and had several
patches accepted, commit privileges are often quickly granted.
An excellent article to read first is:
http://phpadvent.org/2008/less-whining-more-coding-by-elizabeth-smith
Online Forums
-------------
There are several IRC channels where PHP developers are often
available to discuss questions. They include #php.pecl and #php.doc
on the EFNet network and #winphp-dev on FreeNode.
PHP Patches
-----------
If you are fixing broken functionality in PHP C source code first
create a bug or identify an existing bug at http://bugs.php.net/. A
bug can be used to track the patch progress and prevent your changes
getting lost in the PHP mail archives.
If your change is large then create a Request For Comment (RFC) page
on http://wiki.php.net/rfc, discuss it with the extension maintainer,
and discuss it on the development mail list internals@lists.php.net.
RFC Wiki accounts can be requested on
http://wiki.php.net/start?do=register. PHP extension maintainers can
be found in the EXTENSIONS file in the PHP source. Mail list
subscription is explained on http://php.net/mailing-lists.php.
Information on PHP internal C functions is at
http://php.net/internals, though this is considered incomplete.
Various external resources can be found on the web. See
https://wiki.php.net/internals for some references. A standard
printed reference is the book "Extending and Embedding PHP" by Sara
Golemon.
The preferred way to propose PHP patch is sending pull request from
GitHub: https://github.com/php/php-src
Fork the official PHP repository and send a pull request. A
notification will be sent to the pull request mailing list. Sending a
note to PHP Internals list (internals@lists.php.net) may help getting
more feedback and quicker turnaround. You can also add pull requests
to bug reports at http://bugs.php.net/.
If you are not using GitHub, attach your patch to a PHP bug and
consider sending a notification email about the change to
internals@lists.php.net. If the bug is for an extension, also CC the
extension maintainer. Explain what has been changed by your patch.
Test scripts should be included.
Please make the mail subject prefix "[PATCH]". If attaching a patch,
ensure it has a file extension of ".txt". This is because only MIME
attachments of type 'text/*' are accepted.
PHP Documentation Patches
-------------------------
If you are fixing incorrect PHP documentation first create a bug or
identify an existing bug at http://bugs.php.net/. A bug can be used
to track the patch progress and prevent your changes getting lost in
the PHP mail archives.
If your change is large, then first discuss it with the mail list
phpdoc@lists.php.net. Subscription is explained on
http://php.net/mailing-lists.php.
Information on contributing to PHP documentation is at
http://php.net/dochowto and http://wiki.php.net/doc/howto
Attach the patch to the PHP bug and consider sending a notification
email about the change to phpdoc@lists.php.net. Explain what has been
fixed/added/changed by your patch.
Please make the mail subject prefix "[PATCH]". Include the bug id(s)
which can be closed by your patch. If attaching a patch, ensure it
has a file extension of ".txt". This is because only MIME attachments
of type 'text/*' are accepted.
PECL Extension Patches: http://pecl.php.net/
--------------------------------------------
If you are fixing broken functionality in a PECL extension then create
a bug or identify an existing bug at http://bugs.php.net/. A bug
can be used to track the patch progress and prevent your changes
getting lost in the PHP mail archives.
If your change is large then create a Request For Comment (RFC) page
on http://wiki.php.net/rfc, discuss it with the extension maintainer,
and discuss it on the development mail list pecl-dev@lists.php.net.
PECL mail list subscription is explained on
http://pecl.php.net/support.php. RFC Wiki accounts can be requested
on http://wiki.php.net/start?do=register
Information on PHP internal C functions is at
http://www.php.net/internals, though this is considered incomplete.
Various external resources can be found on the web. A standard
printed reference is the book "Extending and Embedding PHP" by Sara
Golemon.
Update any open bugs and add a link to the source of your patch. Send
the patch or pointer to the bug to pecl-dev@lists.php.net. Also CC
the extension maintainer. Explain what has been changed by your
patch. Test scripts should be included.
Please make the mail subject prefix "[PATCH] ...". Include the patch
as an attachment with a file extension of ".txt". This is because
only MIME attachments of type 'text/*' are accepted.
PEAR Package Patches: http://pear.php.net/
------------------------------------------
Information on contributing to PEAR is available at
http://pear.php.net/manual/en/developers-newmaint.php and
http://pear.php.net/manual/en/guide-developers.php
How to create your PHP, PHP Documentation or PECL patch
-------------------------------------------------------
PHP and most PECL packages use Git for revision control. Some PECL
packages use Subversion (SVN) Read http://www.php.net/git.php for help
on using Git to get and build PHP source code. We recommend to look
at our workflow on https://wiki.php.net/vcs/gitworkflow and our FAQ
https://wiki.php.net/vcs/gitfaq.
Generally we ask that bug fix patches work on the current stable PHP
development branches and on "master". New PHP features only need to
work on "master".
Read CODING_STANDARDS before you start working.
After modifying the source see README.TESTING and
http://qa.php.net/write-test.php for how to test. Submitting test
scripts helps us to understand what functionality has changed. It is
important for the stability and maintainability of PHP that tests are
comprehensive.
After testing is finished, create a patch file using the command:
git diff > your_patch.txt
For ease of review and later troubleshooting, submit individual
patches for each bug or feature.
Checklist for submitting your PHP or PECL code patch
----------------------------------------------------
- Update git source just before running your final 'diff' and
before testing.
- Add in-line comments and/or have external documentation ready.
Use only "/* */" style comments, not "//".
- Create test scripts for use with "make test".
- Run "make test" to check your patch doesn't break other features.
- Rebuild PHP with --enable-debug (which will show some kinds of
memory errors) and check the PHP and web server error logs after
running your PHP tests.
- Rebuild PHP with --enable-maintainer-zts to check your patch
compiles on multi-threaded web servers.
- Review the patch once more just before submitting it.
What happens after submitting your PHP, PHP Documentation or PECL patch
-----------------------------------------------------------------------
If your patch is easy to review and obviously has no side-effects,
it might be committed relatively quickly.
Because PHP is a volunteer-driven effort more complex patches will
require patience on your side. If you do not receive feedback in a
few days, consider resubmitting the patch. Before doing this think
about these questions:
- Did I send the patch to the right mail list?
- Did I review the mail list archives to see if these kind of
changes had been discussed before?
- Did I explain my patch clearly?
- Is my patch too hard to review? Because of what factors?
What happens when your PHP or PECL patch is applied
---------------------------------------------------
Your name will likely be included in the Git commit log. If your
patch affects end users, a brief description and your name might be
added to the NEWS file.
Thank you for patching PHP!
-316
View File
@@ -1,316 +0,0 @@
[IMPORTANT NOTICE]
------------------
Failed tests usually indicate a problem with your local system setup
and not within PHP itself (at least for official PHP release versions).
You may decide to automatically submit a test summary to our QA workflow
at the end of a test run.
Please do *not* submit a failed test as a bug or ask for help on why
it failed on your system without providing substantial backup information
on *why* the test failed on your special setup. Thank you :-)
[Testing Basics]
----------------
The easiest way to test your PHP build is to run "make test" from the
command line after successfully compiling. This will run the complete
tests for all enabled functionalities and extensions using the PHP
CLI binary.
To execute test scripts, you must build PHP with some SAPI, then you
type "make test" to execute all or some test scripts saved under
"tests" directory under source root directory.
Usage:
make test
"make test" basically executes "run-tests.php" script
under the source root (parallel builds will not work). Therefore you
can execute the script as follows:
TEST_PHP_EXECUTABLE=sapi/cli/php \
sapi/cli/php [-c /path/to/php.ini] run-tests.php [ext/foo/tests/GLOB]
[Which "php" executable "make test" look for]
---------------------------------------------
If you are running the run-tests.php script from the command line (as above)
you must set the TEST_PHP_EXECUTABLE environment variable to explicitly
select the PHP executable that is to be tested, that is, used to run the test scripts.
If you run the tests using make test, the PHP CLI and CGI executables are
automatically set for you. "make test" executes "run-tests.php" script with the CLI binary. Some
test scripts such as session must be executed by CGI SAPI. Therefore,
you must build PHP with CGI SAPI to perform all tests.
NOTE: PHP binary executing "run-tests.php" and php binary used for
executing test scripts may differ. If you use different PHP binary for
executing "run-tests.php" script, you may get errors.
[Which php.ini is used]
-----------------------
"make test" uses the same php.ini file as it would once installed.
The tests have been written to be independent of that php.ini file,
so if you find a test that is affected by a setting, please report
this, so we can address the issue.
[Which test scripts are executed]
---------------------------------
"run-tests.php" ("make test"), without any arguments executes all
test scripts by extracting all directories named "tests"
from the source root and any subdirectories below. If there are files,
which have a "phpt" extension, "run-tests.php" looks at the sections
in these files, determines whether it should run it, by evaluating
the 'SKIPIF' section. If the test is eligible for execution, the 'FILE'
section is extracted into a ".php" file (with the same name besides
the extension) and gets executed.
When an argument is given or TESTS environment variable is set, the
GLOB is expanded by the shell and any file with extension "*.phpt" is
regarded as a test file.
Tester can easily execute tests selectively with as follows.
Examples:
./sapi/cli/php run-tests.php ext/mbstring/*
./sapi/cli/php run-tests.php ext/mbstring/020.phpt
[Test results]
--------------
Test results are printed to standard output. If there is a failed test,
the "run-tests.php" script saves the result, the expected result and the
code executed to the test script directory. For example, if
ext/myext/tests/myext.phpt fails to pass, the following files are created:
ext/myext/tests/myext.php - actual test file executed
ext/myext/tests/myext.log - log of test execution (L)
ext/myext/tests/myext.exp - expected output (E)
ext/myext/tests/myext.out - output from test script (O)
ext/myext/tests/myext.diff - diff of .out and .exp (D)
Failed tests are always bugs. Either the test is bugged or not considering
factors applying to the tester's environment, or there is a bug in PHP.
If this is a known bug, we strive to provide bug numbers, in either the
test name or the file name. You can check the status of such a bug, by
going to: http://bugs.php.net/12345 where 12345 is the bug number.
For clarity and automated processing, bug numbers are prefixed by a hash
sign '#' in test names and/or test cases are named bug12345.phpt.
NOTE: The files generated by tests can be selected by setting the
environment variable TEST_PHP_LOG_FORMAT. For each file you want to be
generated use the character in brackets as shown above (default is LEOD).
The php file will be generated always.
NOTE: You can set environment variable TEST_PHP_DETAILED to enable
detailed test information.
[Automated Testing]
--------------
If you like to keep up to speed, with latest developments and quality
assurance, setting the environment variable NO_INTERACTION to 1, will not
prompt the tester for any user input.
Normally, the exit status of "make test" is zero, regardless of the results
of independent tests. Set the environment variable REPORT_EXIT_STATUS to 1,
and "make test" will set the exit status ("$?") to non-zero, when an
individual test has failed.
Example script to be run by cron(1):
========== qa-test.sh =============
#!/bin/sh
CO_DIR=$HOME/cvs/php7
MYMAIL=qa-test@domain.com
TMPDIR=/var/tmp
TODAY=`date +"%Y%m%d"`
# Make sure compilation environment is correct
CONFIGURE_OPTS='--disable-all --enable-cli --with-pcre'
export MAKE=gmake
export CC=gcc
# Set test environment
export NO_INTERACTION=1
export REPORT_EXIT_STATUS=1
cd $CO_DIR
cvs update . >>$TMPDIR/phpqatest.$TODAY
./cvsclean ; ./buildconf ; ./configure $CONFIGURE_OPTS ; $MAKE
$MAKE test >>$TMPDIR/phpqatest.$TODAY 2>&1
if test $? -gt 0
then
cat $TMPDIR/phpqatest.$TODAY | mail -s"PHP-QA Test Failed for $TODAY" $MYMAIL
fi
========== end of qa-test.sh =============
NOTE: The exit status of run-tests.php will be 1 when
REPORT_EXIT_STATUS is set. The result of "make test" may be higher
than that. At present, gmake 3.79.1 returns 2, so it is
advised to test for non-zero, rather then a specific value.
[Creating new test files]
-------------------------
Writing test file is very easy if you are used to PHP.
See the HOWTO at http://qa.php.net/write-test.php
[How to help us]
----------------
If you find bug in PHP, you can submit bug report AND test script
for us. You don't have to write complete script, just give us test
script with following format. Please test the script and make sure
you write the correct ACTUAL OUTPUT and EXPECTED OUTPUT before you
submit.
<?php
/*
Bug #12345
substr() bug. Do not return expected string.
ACTUAL OUTPUT
XYXA
EXPECTED OUTPUT
ABCD
*/
$str = "XYZABCD";
echo substr($str,3,7);
?>
[IMPORTANT NOTICE]
------------------
This is an addendum to README.TESTING with additional information
specific to server-tests.php.
server-tests.php is backward compatible with tests developed for
the original run-tests.php script. server-tests is *not* used by
'make test'. server-tests was developed to provide support for
testing PHP under it's primary environment, HTTP, and can run the
PHP tests under any of the SAPI modules that are direct executables,
or are accessible via HTTP.
[New features]
----------------
* Command line interface:
You can run 'php server-tests.php -h' to get all the possible options.
* Configuration file:
the -c argument will allow you to use a configuration file. This is
handy if you are testing multiple environments and need various options
depending on the environment.
see server-tests-config.php for details.
* CGI Emulation:
Will emulate a CGI environment when testing with the cgi sapi executable.
* HTTP testing:
can be configured to run test scripts through an HTTP server running
on localhost. localhost is required since either the web server must
alias a directory to the php source directory, or the test scripts
must be copied to a directory under the web server
(see config options TEST_WEB_BASE_URL, TEST_BASE_PATH, and TEST_WEB_EXT)
* New sections supported for test files (see below)
When running tests over http, tests that require ini settings different that what
the web server runs under will be skipped. Since the test harness defines a number
of ini settings by default, the web server may require special configuration to
make testing work.
[Example Usage]
----------------
Some (but not all!) examples of usage:
1. run tests from the php source directory
php server-tests.php -p /path/to/php-cli
2. run tests using cgi emulation
php server-tests.php -p /path/to/php-cgi
3. run tests over http, copying test files into document root
php server-tests.php -w -u http://localhost/test -m /path/to/htdocs/test
4. run tests over http, php sources have been aliased in web server
php server-tests.php -w -u http://localhost/test
5. run tests using configuration file
php server-tests.php -c /path/to/server-tests-config.php
6. run tests using configuration file, but overriding some settings:
(config file must be first)
php server-tests.php -c /path/to/server-tests-config.php -w -t 3 -d /path/to/testdir
NOTE: configuration as described in README.TESTING still works.
[New Test Sections]
----------------
In addition to the traditional test sections
(see http://qa.php.net/write-test.php), several new sections are available
under server-tests.
--POST--
This is not a new section, but not multipart posts are supported for testing
file uploads, or other types of POST data.
--CGI--
This section takes no value. It merely provides a simple marker for tests
that MUST be run as CGI, even if there is no --POST-- or --GET-- sections
in the test file.
--DESCRIPTION--
Not used for anything, just a section for documenting the test
--ENV--
This section get's eval()'d to help build an environment for the
execution of the test. This can be used to change environment
vars that are used for CGI emulation, or simply to set env vars
for cli testing. A full example looks like:
--ENV--
return <<<END
PATH_TRANSLATED=$filename
PATH_INFO=$scriptname
SCRIPT_NAME=$scriptname
END;
Some variables are made easily available for use in this section, they
include:
$filename full native path to file, will become PATH_TRANSLATED
$filepath =dirname($filename)
$scriptname this is what will become SCRIPT_NAME unless you override it
$docroot the equivalent of DOCUMENT_ROOT under Apache
$cwd the directory that the test is being initiated from
$this->conf all server-tests configuration vars
$this->env all environment variables that will get passed to the test
--REQUEST--
This section is also eval'd, and is similar in nature to --ENV--. However,
this section is used to build the url used in an HTTP request. Valid values
to set in this section would include:
SCRIPT_NAME The initial part of the request url
PATH_INFO The pathinfo part of a request url
FRAGMENT The fragment section of a url (after #)
QUERY_STRING The query part of a url (after ?)
--REQUEST--
return <<<END
PATH_INFO=/path/info
END;
--HEADERS--
This section is also eval'd. It is used to provide additional headers sent
in an HTTP request, such as content type for multipart posts, cookies, etc.
--HEADERS--
return <<<END
Content-Type=multipart/form-data; boundary=---------------------------240723202011929
Content-Length=100
END;
--EXPECTHEADERS--
This section can be used to define what headers are required to be
received back from a request, and is checked in addition to the
regular expect sections. For example:
--EXPECTHEADERS--
Status: 404
-123
View File
@@ -1,123 +0,0 @@
PHP Build System V5 Overview
- supports Makefile.ins during transition phase
- not-really-portable Makefile includes have been eliminated
- supports separate build directories without VPATH by using
explicit rules only
- does not waste disk-space/CPU-time for building temporary libraries
=> especially noticeable on slower systems
- slow recursive make replaced with one global Makefile
- eases integration of proper dependencies
- adds PHP_DEFINE(what[, value]) which creates a single include-file
per what. This will allow more fine-grained dependencies.
- abandoning the "one library per directory" concept
- improved integration of the CLI
- several new targets
build-modules: builds and copies dynamic modules into modules/
install-cli: installs the CLI only, so that the install-sapi
target does only what its name says
- finally abandoned automake (still requires aclocal at this time)
- changed some configure-time constructs to run at buildconf-time
- upgraded shtool to 1.5.4
- removed $(moduledir) (use EXTENSION_DIR)
The Reason For a New System
It became more and more apparent that there is a severe need
for addressing the portability concerns and improving the chance
that your build is correct (how often have you been told to
"make clean"? When this is done, you won't need to anymore).
If You Build PHP on a Unix System
You, as a user of PHP, will notice no changes. Of course, the build
system will be faster, look better and work smarter.
If You Are Developing PHP
Extension developers:
Makefile.ins are abandoned. The files which are to be compiled
are specified in the config.m4 now using the following macro:
PHP_NEW_EXTENSION(foo, foo.c bar.c baz.cpp, $ext_shared)
E.g. this enables the extension foo which consists of three source-code
modules, two in C and one in C++. And, depending on the user's wishes,
the extension will even be built as a dynamic module.
The full syntax:
PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags]]])
Please have a look at acinclude.m4 for the gory details and meanings
of the other parameters.
And that's basically it for the extension side.
If you previously built sub-libraries for this module, add
the source-code files here as well. If you need to specify
separate include directories, do it this way:
PHP_NEW_EXTENSION(foo, foo.c mylib/bar.c mylib/gregor.c,,,-I@ext_srcdir@/lib)
E.g. this builds the three files which are located relative to the
extension source directory and compiles all three files with the
special include directive (@ext_srcdir@ is automatically replaced).
Now, you need to tell the build system that you want to build files
in a directory called $ext_builddir/lib:
PHP_ADD_BUILD_DIR($ext_builddir/lib)
Make sure to call this after PHP_NEW_EXTENSION, because $ext_builddir
is only set by the latter.
If you have a complex extension, you might to need add special
Make rules. You can do this by calling PHP_ADD_MAKEFILE_FRAGMENT
in your config.m4 after PHP_NEW_EXTENSION.
This will read a file in the source-dir of your extension called
Makefile.frag. In this file, $(builddir) and $(srcdir) will be
replaced by the values which are correct for your extension
and which are again determined by the PHP_NEW_EXTENSION macro.
Make sure to prefix *all* relative paths correctly with either
$(builddir) or $(srcdir). Because the build system does not
change the working directory anymore, we must use either
absolute paths or relative ones to the top build-directory.
Correct prefixing ensures that.
SAPI developers:
Instead of using PHP_SAPI=foo/PHP_BUILD_XYZ, you will need to type
PHP_SELECT_SAPI(name, type, sources.c)
I.e. specify the source-code files as above and also pass the
information regarding how PHP is supposed to be built (shared
module, program, etc).
For example for APXS:
PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php7.c php_apache.c)
General info
The foundation for the new system is the flexible handling of
sources and their contexts. With the help of macros you
can define special flags for each source-file, where it is
located, in which target context it can work, etc.
Have a look at the well documented macros
PHP_ADD_SOURCES(_X) in acinclude.m4.
-5
View File
@@ -1,5 +0,0 @@
The Win32 Build System.
See https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2
vim:tw=78:sw=1:ts=1:et
-182
View File
@@ -1,182 +0,0 @@
Input Filter Support in PHP 5
-----------------------------
XSS (Cross Site Scripting) hacks are becoming more and more prevalent,
and can be quite difficult to prevent. Whenever you accept user data
and somehow display this data back to users, you are likely vulnerable
to XSS hacks.
The Input Filter support in PHP 5 is aimed at providing the framework
through which a company-wide or site-wide security policy can be
enforced. It is implemented as a SAPI hook and is called from the
treat_data and post handler functions. To implement your own security
policy you will need to write a standard PHP extension. There is also
a powerful standard implementation in ext/filter that should suit most
peoples' needs. However, if you want to implement your own security
policy, read on.
A simple implementation might look like the following. This stores the
original raw user data and adds a my_get_raw() function while the normal
$_POST, $_GET and $_COOKIE arrays are only populated with stripped
data. In this simple example all I am doing is calling strip_tags() on
the data.
ZEND_BEGIN_MODULE_GLOBALS(my_input_filter)
zval *post_array;
zval *get_array;
zval *cookie_array;
ZEND_END_MODULE_GLOBALS(my_input_filter)
#ifdef ZTS
#define IF_G(v) TSRMG(my_input_filter_globals_id, zend_my_input_filter_globals *, v)
#else
#define IF_G(v) (my_input_filter_globals.v)
#endif
ZEND_DECLARE_MODULE_GLOBALS(my_input_filter)
zend_function_entry my_input_filter_functions[] = {
PHP_FE(my_get_raw, NULL)
{NULL, NULL, NULL}
};
zend_module_entry my_input_filter_module_entry = {
STANDARD_MODULE_HEADER,
"my_input_filter",
my_input_filter_functions,
PHP_MINIT(my_input_filter),
PHP_MSHUTDOWN(my_input_filter),
NULL,
PHP_RSHUTDOWN(my_input_filter),
PHP_MINFO(my_input_filter),
"0.1",
STANDARD_MODULE_PROPERTIES
};
PHP_MINIT_FUNCTION(my_input_filter)
{
ZEND_INIT_MODULE_GLOBALS(my_input_filter, php_my_input_filter_init_globals, NULL);
REGISTER_LONG_CONSTANT("POST", PARSE_POST, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GET", PARSE_GET, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("COOKIE", PARSE_COOKIE, CONST_CS | CONST_PERSISTENT);
sapi_register_input_filter(my_sapi_input_filter);
return SUCCESS;
}
PHP_RSHUTDOWN_FUNCTION(my_input_filter)
{
if(IF_G(get_array)) {
zval_ptr_dtor(&IF_G(get_array));
IF_G(get_array) = NULL;
}
if(IF_G(post_array)) {
zval_ptr_dtor(&IF_G(post_array));
IF_G(post_array) = NULL;
}
if(IF_G(cookie_array)) {
zval_ptr_dtor(&IF_G(cookie_array));
IF_G(cookie_array) = NULL;
}
return SUCCESS;
}
PHP_MINFO_FUNCTION(my_input_filter)
{
php_info_print_table_start();
php_info_print_table_row( 2, "My Input Filter Support", "enabled" );
php_info_print_table_end();
}
/* The filter handler. If you return 1 from it, then PHP also registers the
* (modified) variable. Returning 0 prevents PHP from registering the variable;
* you can use this if your filter already registers the variable under a
* different name, or if you just don't want the variable registered at all. */
SAPI_INPUT_FILTER_FUNC(my_sapi_input_filter)
{
zval new_var;
zval *array_ptr = NULL;
char *raw_var;
int var_len;
assert(*val != NULL);
switch(arg) {
case PARSE_GET:
if(!IF_G(get_array)) {
ALLOC_ZVAL(array_ptr);
array_init(array_ptr);
INIT_PZVAL(array_ptr);
}
IF_G(get_array) = array_ptr;
break;
case PARSE_POST:
if(!IF_G(post_array)) {
ALLOC_ZVAL(array_ptr);
array_init(array_ptr);
INIT_PZVAL(array_ptr);
}
IF_G(post_array) = array_ptr;
break;
case PARSE_COOKIE:
if(!IF_G(cookie_array)) {
ALLOC_ZVAL(array_ptr);
array_init(array_ptr);
INIT_PZVAL(array_ptr);
}
IF_G(cookie_array) = array_ptr;
break;
}
Z_STRLEN(new_var) = val_len;
Z_STRVAL(new_var) = estrndup(*val, val_len);
Z_TYPE(new_var) = IS_STRING;
var_len = strlen(var);
raw_var = emalloc(var_len+5); /* RAW_ and a \0 */
strcpy(raw_var, "RAW_");
strlcat(raw_var,var,var_len+5);
php_register_variable_ex(raw_var, &new_var, array_ptr);
php_strip_tags(*val, val_len, NULL, NULL, 0);
*new_val_len = strlen(*val);
return 1;
}
PHP_FUNCTION(my_get_raw)
{
long arg;
char *var;
int var_len;
zval **tmp;
zval *array_ptr = NULL;
if(zend_parse_parameters(2, "ls", &arg, &var, &var_len) == FAILURE) {
return;
}
switch(arg) {
case PARSE_GET:
array_ptr = IF_G(get_array);
break;
case PARSE_POST:
array_ptr = IF_G(post_array);
break;
case PARSE_COOKIE:
array_ptr = IF_G(post_array);
break;
}
if(!array_ptr) {
RETURN_FALSE;
}
if(zend_hash_find(HASH_OF(array_ptr), var, var_len+5, (void **)&tmp) == SUCCESS) {
*return_value = **tmp;
zval_copy_ctor(return_value);
} else {
RETVAL_FALSE;
}
}
+122 -27
View File
@@ -1,39 +1,134 @@
The PHP Interpreter
===================
<div align="center">
<a href="https://php.net">
<img
alt="PHP"
src="https://www.php.net/images/logos/new-php-logo.svg"
width="150">
</a>
</div>
This is the github mirror of the official PHP repository located at
https://git.php.net.
# The PHP Interpreter
[![Build Status](https://secure.travis-ci.org/php/php-src.svg?branch=master)](http://travis-ci.org/php/php-src)
PHP is a popular general-purpose scripting language that is especially suited to
web development. Fast, flexible and pragmatic, PHP powers everything from your
blog to the most popular websites in the world. PHP is distributed under the PHP
License v3.01.
[![Build status](https://travis-ci.org/php/php-src.svg?branch=master)](https://travis-ci.org/php/php-src)
[![Build status](https://ci.appveyor.com/api/projects/status/meyur6fviaxgdwdy?svg=true)](https://ci.appveyor.com/project/php/php-src)
[![Build Status](https://dev.azure.com/phpazuredevops/php/_apis/build/status/php.php-src?branchName=PHP-7.4)](https://dev.azure.com/phpazuredevops/php/_build/latest?definitionId=1&branchName=PHP-7.4)
Pull Requests
=============
PHP accepts pull requests via github. Discussions are done on github, but
depending on the topic can also be relayed to the official PHP developer
mailing list internals@lists.php.net.
## Documentation
New features require an RFC and must be accepted by the developers.
See https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more
information on the process.
The PHP manual is available at [php.net/docs](https://php.net/docs).
Bug fixes **do not** require an RFC, but require a bugtracker ticket. Always
open a ticket at https://bugs.php.net and reference the bug id using #NNNNNN.
## Installation
### Prebuilt packages and binaries
Prebuilt packages and binaries can be used to get up and running fast with PHP.
For Windows, the PHP binaries can be obtained from
[windows.php.net](https://windows.php.net). After extracting the archive the
`*.exe` files are ready to use.
For other systems, see the [installation chapter](https://php.net/install).
### Building PHP source code
*For Windows, see [Build your own PHP on Windows](https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2).*
PHP uses autotools on Unix systems to configure the build:
./buildconf
./configure [options]
*See `./configure -h` for configuration options.*
make [options]
*See `make -h` for make options.*
The `-j` option shall set the maximum number of jobs `make` can use for the
build:
make -j4
Shall run `make` with a maximum of 4 concurrent jobs: Generally the maximum
number of jobs should not exceed the number of cores available.
## Testing PHP source code
PHP ships with an extensive test suite, the command `make test` is used after
successful compilation of the sources to run this test suite.
It is possible to run tests using multiple cores by setting `-jN` in
`TEST_PHP_ARGS`:
make TEST_PHP_ARGS=-j4 test
Shall run `make test` with a maximum of 4 concurrent jobs: Generally the maximum
number of jobs should not exceed the number of cores available.
The [qa.php.net](https://qa.php.net) site provides more detailed info about
testing and quality assurance.
## Installing PHP built from source
After a successful build (and test), PHP may be installed with:
make install
Depending on your permissions and prefix, `make install` may need super user
permissions.
## PHP extensions
Extensions provide additional functionality on top of PHP. PHP consists of many
essential bundled extensions. Additional extensions can be found in the PHP
Extension Community Library - [PECL](https://pecl.php.net).
## Contributing
The PHP source code is located in the Git repository at
[git.php.net](https://git.php.net). Contributions are most welcome by forking
the [GitHub mirror repository](https://github.com/php/php-src) and sending a
pull request.
Discussions are done on GitHub, but depending on the topic can also be relayed
to the official PHP developer mailing list internals@lists.php.net.
New features require an RFC and must be accepted by the developers. See
[Request for comments - RFC](https://wiki.php.net/rfc) and
[Voting on PHP features](https://wiki.php.net/rfc/voting) for more information
on the process.
Bug fixes **do not** require an RFC but require a bug tracker ticket. Open a
ticket at [bugs.php.net](https://bugs.php.net) and reference the bug id using
`#NNNNNN`.
Fix #55371: get_magic_quotes_gpc() throws deprecation warning
After removing magic quotes, the get_magic_quotes_gpc function caused
a deprecate warning. get_magic_quotes_gpc can be used to detected
the magic_quotes behavior and therefore should not raise a warning at any
time. The patch removes this warning
After removing magic quotes, the get_magic_quotes_gpc function caused a
deprecated warning. get_magic_quotes_gpc can be used to detect the
magic_quotes behavior and therefore should not raise a warning at any time.
The patch removes this warning.
We do not merge pull requests directly on github. All PRs will be
pulled and pushed through https://git.php.net.
Pull requests are not merged directly on GitHub. All PRs will be pulled and
pushed through [git.php.net](https://git.php.net). See
[Git workflow](https://wiki.php.net/vcs/gitworkflow) for more details.
### Guidelines for contributors
Guidelines for contributors
===========================
- [CODING_STANDARDS](/CODING_STANDARDS)
- [README.GIT-RULES](/README.GIT-RULES)
- [README.MAILINGLIST_RULES](/README.MAILINGLIST_RULES)
- [README.RELEASE_PROCESS](/README.RELEASE_PROCESS)
See further documents in the repository for more information on how to
contribute:
- [Contributing to PHP](/CONTRIBUTING.md)
- [PHP coding standards](/CODING_STANDARDS.md)
- [Mailinglist rules](/docs/mailinglist-rules.md)
- [PHP release process](/docs/release-process.md)
## Credits
For the list of people who've put work into PHP, please see the
[PHP credits page](https://php.net/credits.php).
-6
View File
@@ -1,6 +0,0 @@
## process this file with automake to produce Makefile.am
AUTOMAKE_OPTIONS=foreign
noinst_LTLIBRARIES=libtsrm.la
libtsrm_la_SOURCES = TSRM.c tsrm_strtok_r.c
depend:
+173 -111
View File
@@ -15,16 +15,19 @@
#ifdef ZTS
#include <stdio.h>
#if HAVE_STDARG_H
#include <stdarg.h>
#ifdef ZEND_DEBUG
# include <assert.h>
# define TSRM_ASSERT assert
#else
# define TSRM_ASSERT
#endif
typedef struct _tsrm_tls_entry tsrm_tls_entry;
#if defined(TSRM_WIN32)
/* TSRMLS_CACHE_DEFINE; is already done in Zend, this is being always compiled statically. */
#endif
TSRMLS_CACHE_EXTERN();
struct _tsrm_tls_entry {
void **storage;
@@ -38,6 +41,7 @@ typedef struct {
size_t size;
ts_allocate_ctor ctor;
ts_allocate_dtor dtor;
size_t fast_offset;
int done;
} tsrm_resource_type;
@@ -51,8 +55,12 @@ static ts_rsrc_id id_count;
static tsrm_resource_type *resource_types_table=NULL;
static int resource_types_table_size;
/* Reserved space for fast globals access */
static size_t tsrm_reserved_pos = 0;
static size_t tsrm_reserved_size = 0;
static MUTEX_T tsmm_mutex; /* thread-safe memory manager mutex */
static MUTEX_T tsmm_mutex; /* thread-safe memory manager mutex */
static MUTEX_T tsrm_env_mutex; /* tsrm environ mutex */
/* New thread handlers */
static tsrm_thread_begin_func_t tsrm_new_thread_begin_handler = NULL;
@@ -122,6 +130,7 @@ static DWORD tls_key;
#endif
TSRM_TLS uint8_t in_main_thread = 0;
TSRM_TLS uint8_t is_thread_shutdown = 0;
/* Startup TSRM (call once for the entire process) */
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename)
@@ -140,6 +149,7 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
/* ensure singleton */
in_main_thread = 1;
is_thread_shutdown = 0;
tsrm_error_file = stderr;
tsrm_error_set(debug_level, debug_filename);
@@ -148,6 +158,7 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
tsrm_tls_table = (tsrm_tls_entry **) calloc(tsrm_tls_table_size, sizeof(tsrm_tls_entry *));
if (!tsrm_tls_table) {
TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate TLS table"));
is_thread_shutdown = 1;
return 0;
}
id_count=0;
@@ -156,14 +167,20 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
resource_types_table = (tsrm_resource_type *) calloc(resource_types_table_size, sizeof(tsrm_resource_type));
if (!resource_types_table) {
TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate resource types table"));
is_thread_shutdown = 1;
free(tsrm_tls_table);
tsrm_tls_table = NULL;
return 0;
}
tsmm_mutex = tsrm_mutex_alloc();
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Started up TSRM, %d expected threads, %d expected resources", expected_threads, expected_resources));
tsrm_reserved_pos = 0;
tsrm_reserved_size = 0;
tsrm_env_mutex = tsrm_mutex_alloc();
return 1;
}/*}}}*/
@@ -173,41 +190,44 @@ TSRM_API void tsrm_shutdown(void)
{/*{{{*/
int i;
if (!in_main_thread) {
/* ensure singleton */
if (is_thread_shutdown) {
/* shutdown must only occur once */
return;
}
if (tsrm_tls_table) {
for (i=0; i<tsrm_tls_table_size; i++) {
tsrm_tls_entry *p = tsrm_tls_table[i], *next_p;
is_thread_shutdown = 1;
while (p) {
int j;
if (!in_main_thread) {
/* only the main thread may shutdown tsrm */
return;
}
next_p = p->next;
for (j=0; j<p->count; j++) {
if (p->storage[j]) {
if (resource_types_table && !resource_types_table[j].done && resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j]);
}
for (i=0; i<tsrm_tls_table_size; i++) {
tsrm_tls_entry *p = tsrm_tls_table[i], *next_p;
while (p) {
int j;
next_p = p->next;
for (j=0; j<p->count; j++) {
if (p->storage[j]) {
if (resource_types_table && !resource_types_table[j].done && resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j]);
}
if (!resource_types_table[j].fast_offset) {
free(p->storage[j]);
}
}
free(p->storage);
free(p);
p = next_p;
}
free(p->storage);
free(p);
p = next_p;
}
free(tsrm_tls_table);
tsrm_tls_table = NULL;
}
if (resource_types_table) {
free(resource_types_table);
resource_types_table=NULL;
}
free(tsrm_tls_table);
free(resource_types_table);
tsrm_mutex_free(tsmm_mutex);
tsmm_mutex = NULL;
tsrm_mutex_free(tsrm_env_mutex);
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Shutdown TSRM"));
if (tsrm_error_file!=stderr) {
fclose(tsrm_error_file);
@@ -226,14 +246,55 @@ TSRM_API void tsrm_shutdown(void)
tsrm_new_thread_begin_handler = NULL;
tsrm_new_thread_end_handler = NULL;
tsrm_shutdown_handler = NULL;
tsrm_reserved_pos = 0;
tsrm_reserved_size = 0;
}/*}}}*/
/* {{{ */
/* environ lock api */
TSRM_API void tsrm_env_lock() {
tsrm_mutex_lock(tsrm_env_mutex);
}
TSRM_API void tsrm_env_unlock() {
tsrm_mutex_unlock(tsrm_env_mutex);
} /* }}} */
/* enlarge the arrays for the already active threads */
static void tsrm_update_active_threads(void)
{/*{{{*/
int i;
for (i=0; i<tsrm_tls_table_size; i++) {
tsrm_tls_entry *p = tsrm_tls_table[i];
while (p) {
if (p->count < id_count) {
int j;
p->storage = (void *) realloc(p->storage, sizeof(void *)*id_count);
for (j=p->count; j<id_count; j++) {
if (resource_types_table[j].fast_offset) {
p->storage[j] = (void *) (((char*)p) + resource_types_table[j].fast_offset);
} else {
p->storage[j] = (void *) malloc(resource_types_table[j].size);
}
if (resource_types_table[j].ctor) {
resource_types_table[j].ctor(p->storage[j]);
}
}
p->count = id_count;
}
p = p->next;
}
}
}/*}}}*/
/* allocates a new thread-safe-resource id */
TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor)
{/*{{{*/
int i;
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Obtaining a new resource id, %d bytes", size));
tsrm_mutex_lock(tsmm_mutex);
@@ -258,28 +319,68 @@ TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].size = size;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].ctor = ctor;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].dtor = dtor;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].fast_offset = 0;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].done = 0;
/* enlarge the arrays for the already active threads */
for (i=0; i<tsrm_tls_table_size; i++) {
tsrm_tls_entry *p = tsrm_tls_table[i];
tsrm_update_active_threads();
tsrm_mutex_unlock(tsmm_mutex);
while (p) {
if (p->count < id_count) {
int j;
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully allocated new resource id %d", *rsrc_id));
return *rsrc_id;
}/*}}}*/
p->storage = (void *) realloc(p->storage, sizeof(void *)*id_count);
for (j=p->count; j<id_count; j++) {
p->storage[j] = (void *) malloc(resource_types_table[j].size);
if (resource_types_table[j].ctor) {
resource_types_table[j].ctor(p->storage[j]);
}
}
p->count = id_count;
}
p = p->next;
}
/* Reserve space for fast thread-safe-resources */
TSRM_API void tsrm_reserve(size_t size)
{/*{{{*/
tsrm_reserved_pos = 0;
tsrm_reserved_size = TSRM_ALIGNED_SIZE(size);
}/*}}}*/
/* allocates a new fast thread-safe-resource id */
TSRM_API ts_rsrc_id ts_allocate_fast_id(ts_rsrc_id *rsrc_id, size_t *offset, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor)
{/*{{{*/
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Obtaining a new fast resource id, %d bytes", size));
tsrm_mutex_lock(tsmm_mutex);
/* obtain a resource id */
*rsrc_id = TSRM_SHUFFLE_RSRC_ID(id_count++);
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Obtained resource id %d", *rsrc_id));
size = TSRM_ALIGNED_SIZE(size);
if (tsrm_reserved_size - tsrm_reserved_pos < size) {
tsrm_mutex_unlock(tsmm_mutex);
TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate space for fast resource"));
*rsrc_id = 0;
*offset = 0;
return 0;
}
*offset = TSRM_ALIGNED_SIZE(sizeof(tsrm_tls_entry)) + tsrm_reserved_pos;
tsrm_reserved_pos += size;
/* store the new resource type in the resource sizes table */
if (resource_types_table_size < id_count) {
tsrm_resource_type *_tmp;
_tmp = (tsrm_resource_type *) realloc(resource_types_table, sizeof(tsrm_resource_type)*id_count);
if (!_tmp) {
tsrm_mutex_unlock(tsmm_mutex);
TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Unable to allocate storage for resource"));
*rsrc_id = 0;
return 0;
}
resource_types_table = _tmp;
resource_types_table_size = id_count;
}
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].size = size;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].ctor = ctor;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].dtor = dtor;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].fast_offset = *offset;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].done = 0;
tsrm_update_active_threads();
tsrm_mutex_unlock(tsmm_mutex);
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully allocated new resource id %d", *rsrc_id));
@@ -292,7 +393,7 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
int i;
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Creating data structures for thread %x", thread_id));
(*thread_resources_ptr) = (tsrm_tls_entry *) malloc(sizeof(tsrm_tls_entry));
(*thread_resources_ptr) = (tsrm_tls_entry *) malloc(TSRM_ALIGNED_SIZE(sizeof(tsrm_tls_entry)) + tsrm_reserved_size);
(*thread_resources_ptr)->storage = NULL;
if (id_count > 0) {
(*thread_resources_ptr)->storage = (void **) malloc(sizeof(void *)*id_count);
@@ -303,6 +404,7 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
/* Set thread local storage to this new thread resources structure */
tsrm_tls_set(*thread_resources_ptr);
TSRMLS_CACHE = *thread_resources_ptr;
if (tsrm_new_thread_begin_handler) {
tsrm_new_thread_begin_handler(thread_id);
@@ -310,9 +412,12 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
for (i=0; i<id_count; i++) {
if (resource_types_table[i].done) {
(*thread_resources_ptr)->storage[i] = NULL;
} else
{
(*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
} else {
if (resource_types_table[i].fast_offset) {
(*thread_resources_ptr)->storage[i] = (void *) (((char*)(*thread_resources_ptr)) + resource_types_table[i].fast_offset);
} else {
(*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
}
if (resource_types_table[i].ctor) {
resource_types_table[i].ctor((*thread_resources_ptr)->storage[i]);
}
@@ -405,7 +510,9 @@ void tsrm_free_interpreter_context(void *context)
}
}
for (i=0; i<thread_resources->count; i++) {
free(thread_resources->storage[i]);
if (!resource_types_table[i].fast_offset) {
free(thread_resources->storage[i]);
}
}
free(thread_resources->storage);
free(thread_resources);
@@ -458,6 +565,8 @@ void ts_free_thread(void)
int hash_value;
tsrm_tls_entry *last=NULL;
TSRM_ASSERT(!in_main_thread);
tsrm_mutex_lock(tsmm_mutex);
hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size);
thread_resources = tsrm_tls_table[hash_value];
@@ -470,7 +579,9 @@ void ts_free_thread(void)
}
}
for (i=0; i<thread_resources->count; i++) {
free(thread_resources->storage[i]);
if (!resource_types_table[i].fast_offset) {
free(thread_resources->storage[i]);
}
}
free(thread_resources->storage);
if (last) {
@@ -490,53 +601,6 @@ void ts_free_thread(void)
tsrm_mutex_unlock(tsmm_mutex);
}/*}}}*/
/* frees all resources allocated for all threads except current */
void ts_free_worker_threads(void)
{/*{{{*/
tsrm_tls_entry *thread_resources;
int i;
THREAD_T thread_id = tsrm_thread_id();
int hash_value;
tsrm_tls_entry *last=NULL;
tsrm_mutex_lock(tsmm_mutex);
hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size);
thread_resources = tsrm_tls_table[hash_value];
while (thread_resources) {
if (thread_resources->thread_id != thread_id) {
for (i=0; i<thread_resources->count; i++) {
if (resource_types_table[i].dtor) {
resource_types_table[i].dtor(thread_resources->storage[i]);
}
}
for (i=0; i<thread_resources->count; i++) {
free(thread_resources->storage[i]);
}
free(thread_resources->storage);
if (last) {
last->next = thread_resources->next;
} else {
tsrm_tls_table[hash_value] = thread_resources->next;
}
free(thread_resources);
if (last) {
thread_resources = last->next;
} else {
thread_resources = tsrm_tls_table[hash_value];
}
} else {
if (thread_resources->next) {
last = thread_resources;
}
thread_resources = thread_resources->next;
}
}
tsrm_mutex_unlock(tsmm_mutex);
}/*}}}*/
/* deallocates all occurrences of a given id */
void ts_free_id(ts_rsrc_id id)
{/*{{{*/
@@ -556,7 +620,9 @@ void ts_free_id(ts_rsrc_id id)
if (resource_types_table && resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j]);
}
free(p->storage[j]);
if (!resource_types_table[j].fast_offset) {
free(p->storage[j]);
}
p->storage[j] = NULL;
}
p = p->next;
@@ -781,6 +847,11 @@ TSRM_API uint8_t tsrm_is_main_thread(void)
return in_main_thread;
}/*}}}*/
TSRM_API uint8_t tsrm_is_shutdown(void)
{/*{{{*/
return is_thread_shutdown;
}/*}}}*/
TSRM_API const char *tsrm_api_name(void)
{/*{{{*/
#if defined(GNUPTH)
@@ -797,12 +868,3 @@ TSRM_API const char *tsrm_api_name(void)
}/*}}}*/
#endif /* ZTS */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
+29 -26
View File
@@ -15,9 +15,9 @@
#if !defined(__CYGWIN__) && defined(WIN32)
# define TSRM_WIN32
# include "tsrm_config.w32.h"
# include "Zend/zend_config.w32.h"
#else
# include <tsrm_config.h>
# include "main/php_config.h"
#endif
#include "main/php_stdint.h"
@@ -52,9 +52,14 @@ typedef uintptr_t tsrm_uintptr_t;
# include <pthread.h>
#elif defined(TSRM_ST)
# include <st.h>
#elif defined(BETHREADS)
#include <kernel/OS.h>
#include <TLS.h>
#endif
#if SIZEOF_SIZE_T == 4
# define TSRM_ALIGNED_SIZE(size) \
(((size) + INT32_C(15)) & ~INT32_C(15))
#else
# define TSRM_ALIGNED_SIZE(size) \
(((size) + INT64_C(15)) & ~INT64_C(15))
#endif
typedef int ts_rsrc_id;
@@ -74,9 +79,7 @@ typedef int ts_rsrc_id;
# define MUTEX_T st_mutex_t
#endif
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
typedef void (*ts_allocate_ctor)(void *);
typedef void (*ts_allocate_dtor)(void *);
@@ -91,9 +94,17 @@ extern "C" {
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename);
TSRM_API void tsrm_shutdown(void);
/* environ lock API */
TSRM_API void tsrm_env_lock();
TSRM_API void tsrm_env_unlock();
/* allocates a new thread-safe-resource id */
TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor);
/* Fast resource in reserved (pre-allocated) space */
TSRM_API void tsrm_reserve(size_t size);
TSRM_API ts_rsrc_id ts_allocate_fast_id(ts_rsrc_id *rsrc_id, size_t *offset, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor);
/* fetches the requested resource for the current thread */
TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id);
#define ts_resource(id) ts_resource_ex(id, NULL)
@@ -101,9 +112,6 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id);
/* frees all resources allocated for the current thread */
TSRM_API void ts_free_thread(void);
/* frees all resources allocated for all threads except current */
void ts_free_worker_threads(void);
/* deallocates all occurrences of a given id */
TSRM_API void ts_free_id(ts_rsrc_id id);
@@ -143,16 +151,13 @@ TSRM_API void tsrm_free_interpreter_context(void *context);
TSRM_API void *tsrm_get_ls_cache(void);
TSRM_API uint8_t tsrm_is_main_thread(void);
TSRM_API uint8_t tsrm_is_shutdown(void);
TSRM_API const char *tsrm_api_name(void);
#if defined(__cplusplus) && __cplusplus > 199711L
# define TSRM_TLS thread_local
#ifdef TSRM_WIN32
# define TSRM_TLS __declspec(thread)
#else
# ifdef TSRM_WIN32
# define TSRM_TLS __declspec(thread)
# else
# define TSRM_TLS __thread
# endif
# define TSRM_TLS __thread
#endif
#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1)
@@ -162,9 +167,13 @@ TSRM_API const char *tsrm_api_name(void);
#define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_get_ls_cache()
#define TSRMG(id, type, element) (TSRMG_BULK(id, type)->element)
#define TSRMG_BULK(id, type) ((type) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(id)])
#define TSRMG_FAST(offset, type, element) (TSRMG_FAST_BULK(offset, type)->element)
#define TSRMG_FAST_BULK(offset, type) ((type) (((char*) tsrm_get_ls_cache())+(offset)))
#define TSRMG_STATIC(id, type, element) (TSRMG_BULK_STATIC(id, type)->element)
#define TSRMG_BULK_STATIC(id, type) ((type) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(id)])
#define TSRMG_FAST_STATIC(offset, type, element) (TSRMG_FAST_BULK_STATIC(offset, type)->element)
#define TSRMG_FAST_BULK_STATIC(offset, type) ((type) (((char*) TSRMLS_CACHE)+(offset)))
#define TSRMLS_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE;
#define TSRMLS_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE = NULL;
#define TSRMLS_CACHE_UPDATE() TSRMLS_CACHE = tsrm_get_ls_cache()
@@ -183,6 +192,9 @@ TSRM_API const char *tsrm_api_name(void);
#else /* non ZTS */
#define tsrm_env_lock()
#define tsrm_env_unlock()
#define TSRMLS_FETCH()
#define TSRMLS_FETCH_FROM_CTX(ctx)
#define TSRMLS_SET_CTX(ctx)
@@ -204,12 +216,3 @@ TSRM_API const char *tsrm_api_name(void);
#endif /* ZTS */
#endif /* TSRM_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
-3
View File
@@ -1,3 +0,0 @@
AC_DEFUN([AM_SET_LIBTOOL_VARIABLE],[
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
])
-40
View File
@@ -1,40 +0,0 @@
# Makefile to generate build tools
#
# Standard usage:
# make -f build.mk
#
# Written by Sascha Schumann
LT_TARGETS = ltmain.sh ltconfig
config_h_in = tsrm_config.h.in
makefile_am_files = Makefile.am
makefile_in_files = $(makefile_am_files:.am=.in)
makefile_files = $(makefile_am_files:e.am=e)
targets = $(makefile_in_files) $(LT_TARGETS) configure $(config_h_in)
all: $(targets)
clean:
rm -f $(targets)
$(LT_TARGETS):
rm -f $(LT_TARGETS)
libtoolize --automake $(AMFLAGS) -f
$(makefile_in_files): $(makefile_am_files)
automake -a -i $(AMFLAGS) $(makefile_files)
aclocal.m4: configure.ac acinclude.m4
aclocal
$(config_h_in): configure.ac
# explicitly remove target since autoheader does not seem to work
# correctly otherwise (timestamps are not updated)
@rm -f $@
autoheader
configure: aclocal.m4 configure.ac
autoconf
-33
View File
@@ -1,33 +0,0 @@
#!/bin/sh
case "$1" in
--copy)
automake_flags=--copy
shift
;;
esac
libtoolize --force --automake $automake_flags
mv aclocal.m4 aclocal.m4.old 2>/dev/null
aclocal
if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
echo "buildconf: keeping ${1}aclocal.m4"
mv aclocal.m4.old aclocal.m4
else
echo "buildconf: created or modified ${1}aclocal.m4"
fi
autoheader
automake --add-missing --include-deps $automake_flags
mv configure configure.old 2>/dev/null
autoconf
if cmp configure.old configure > /dev/null 2>&1; then
echo "buildconf: keeping ${1}configure"
mv configure.old configure
else
echo "buildconf: created or modified ${1}configure"
fi
+1 -1
View File
@@ -1,4 +1,4 @@
// vim:ft=javascript
ADD_SOURCES("TSRM", "TSRM.c tsrm_strtok_r.c tsrm_win32.c");
ADD_SOURCES("TSRM", "TSRM.c tsrm_win32.c");
ADD_FLAG("CFLAGS_BD_TSRM", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
-35
View File
@@ -1,35 +0,0 @@
dnl
dnl Minimalistic configure.ac for TSRM.
dnl
AC_INIT(TSRM.c)
AM_INIT_AUTOMAKE(TSRM, 1.0, nodefine)
AM_CONFIG_HEADER(tsrm_config.h)
AH_TOP([
#undef PTHREADS
])
sinclude(tsrm.m4)
TSRM_BASIC_CHECKS
TSRM_THREADS_CHECKS
AM_PROG_LIBTOOL
if test "$enable_debug" != "yes"; then
AM_SET_LIBTOOL_VARIABLE([--silent])
fi
dnl TSRM_PTHREAD
AC_CHECK_HEADERS(
utime.h \
dirent.h \
stdarg.h \
alloca.h \
unistd.h \
limits.h
)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
-3
View File
@@ -1,3 +0,0 @@
/* Keep this header for compatibility with external code, it's currently not
used anywhere in the core and there are no implementations in TSRM. */
#include "win32/readdir.h"
+9 -34
View File
@@ -28,7 +28,7 @@ dnl OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
dnl PTHREADS_FLAGS
dnl
dnl Set some magic defines to achieve POSIX threads conformance
dnl Set some magic defines to achieve POSIX threads conformance.
dnl
AC_DEFUN([PTHREADS_FLAGS],[
if test -z "$host_alias" && test -n "$host"; then
@@ -52,18 +52,17 @@ AC_DEFUN([PTHREADS_FLAGS],[
PTHREAD_FLAGS=-D_REENTRANT;;
*sco*)
PTHREAD_FLAGS=-D_REENTRANT;;
dnl Solves sigwait() problem, creates problems with u_long etc.
dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE_EXTENDED=1";;
esac
if test -n "$PTHREAD_FLAGS"; then
CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS"
fi
])dnl
])
dnl
dnl PTHREADS_CHECK_COMPILE
dnl
dnl Check whether the current setup can use POSIX threads calls
dnl Check whether the current setup can use POSIX threads calls.
dnl
AC_DEFUN([PTHREADS_CHECK_COMPILE], [
AC_LINK_IFELSE([ AC_LANG_SOURCE([
@@ -85,11 +84,12 @@ int main() {
], [
pthreads_checked=no
]
) ] )dnl
) ] )
dnl
dnl PTHREADS_CHECK()
dnl PTHREADS_CHECK
dnl
dnl Try to find a way to enable POSIX threads
dnl Try to find a way to enable POSIX threads.
dnl
dnl Magic flags
dnl -kthread gcc (FreeBSD)
@@ -102,14 +102,6 @@ dnl -qthreaded AIX cc V5
dnl -threads gcc (HP-UX)
dnl
AC_DEFUN([PTHREADS_CHECK],[
save_CFLAGS=$CFLAGS
save_LIBS=$LIBS
PTHREADS_ASSIGN_VARS
PTHREADS_CHECK_COMPILE
LIBS=$save_LIBS
CFLAGS=$save_CFLAGS
AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
ac_cv_pthreads_cflags=
if test "$pthreads_working" != "yes"; then
@@ -145,21 +137,4 @@ fi
if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
pthreads_working="yes"
fi
if test "$pthreads_working" = "yes"; then
threads_result="POSIX-Threads found"
else
threads_result="POSIX-Threads not found"
fi
])dnl
dnl
dnl
AC_DEFUN([PTHREADS_ASSIGN_VARS],[
if test -n "$ac_cv_pthreads_lib"; then
LIBS="$LIBS -l$ac_cv_pthreads_lib"
fi
if test -n "$ac_cv_pthreads_cflags"; then
CFLAGS="$CFLAGS $ac_cv_pthreads_cflags"
fi
])dnl
])
+31 -46
View File
@@ -1,23 +1,9 @@
m4_include([TSRM/m4/ax_func_which_gethostbyname_r.m4])
AC_DEFUN([TSRM_BASIC_CHECKS],[
AC_REQUIRE([AC_PROG_CC])dnl
dnl AC_REQUIRE([AM_PROG_CC_STDC])dnl
AC_REQUIRE([AC_PROG_CC_C_O])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_CHECK_HEADERS(stdarg.h)
AC_CHECK_FUNCS(sigprocmask)
AX_FUNC_WHICH_GETHOSTBYNAME_R()
])
dnl This file contains TSRM specific autoconf macros.
dnl
dnl TSRM_CHECK_PTH
dnl
AC_DEFUN([TSRM_CHECK_PTH],[
AC_MSG_CHECKING(for GNU Pth)
PTH_PREFIX="`$1 --prefix`"
if test -z "$PTH_PREFIX"; then
@@ -30,9 +16,11 @@ LIBS="$LIBS `$1 --libs`"
AC_DEFINE(GNUPTH, 1, [Whether you use GNU Pth])
AC_MSG_RESULT(yes - installed in $PTH_PREFIX)
])
dnl
dnl TSRM_CHECK_ST
dnl
AC_DEFUN([TSRM_CHECK_ST],[
if test -r "$1/include/st.h"; then
CPPFLAGS="$CPPFLAGS -I$1/include"
@@ -50,10 +38,10 @@ AC_DEFUN([TSRM_CHECK_ST],[
AC_DEFINE(TSRM_ST, 1, [ ])
])
sinclude(threads.m4)
dnl
dnl TSRM_CHECK_PTHREADS
dnl
AC_DEFUN([TSRM_CHECK_PTHREADS],[
PTHREADS_CHECK
if test "$pthreads_working" != "yes"; then
@@ -66,32 +54,30 @@ AC_MSG_CHECKING(for POSIX threads)
AC_MSG_RESULT(yes)
])
dnl
dnl TSRM_THREADS_CHECKS
dnl
dnl For the thread implementations, we always use --with-* to maintain
dnl consistency.
dnl
AC_DEFUN([TSRM_THREADS_CHECKS],[
AC_ARG_WITH([tsrm-pth],
[AS_HELP_STRING([[--with-tsrm-pth[=pth-config]]],
[Use GNU Pth])],
[TSRM_PTH=$withval],
[TSRM_PTH=no])
dnl For the thread implementations, we always use --with-*
dnl to maintain consistency
AC_ARG_WITH([tsrm-st],
[AS_HELP_STRING([--with-tsrm-st],
[Use SGI's State Threads])],
[TSRM_ST=$withval],
[TSRM_ST=no])
AC_ARG_WITH(tsrm-pth,
[ --with-tsrm-pth[=pth-config]
Use GNU Pth],[
TSRM_PTH=$withval
],[
TSRM_PTH=no
])
AC_ARG_WITH(tsrm-st,
[ --with-tsrm-st Use SGI's State Threads],[
TSRM_ST=$withval
],[
TSRM_ST=no
])
AC_ARG_WITH(tsrm-pthreads,
[ --with-tsrm-pthreads Use POSIX threads (default)],[
TSRM_PTHREADS=$withval
],[
TSRM_PTHREADS=yes
])
AC_ARG_WITH([tsrm-pthreads],
[AS_HELP_STRING([--with-tsrm-pthreads],
[Use POSIX threads (default)])],
[TSRM_PTHREADS=$withval],
[TSRM_PTHREADS=yes])
test "$TSRM_PTH" = "yes" && TSRM_PTH=pth-config
@@ -102,5 +88,4 @@ elif test "$TSRM_ST" != "no"; then
elif test "$TSRM_PTHREADS" != "no"; then
TSRM_CHECK_PTHREADS
fi
])
-23
View File
@@ -1,23 +0,0 @@
#ifndef TSRM_CONFIG_W32_H
#define TSRM_CONFIG_W32_H
#include <../main/config.w32.h>
#include "Zend/zend_config.w32.h"
#define HAVE_UTIME 1
#define HAVE_ALLOCA 1
#include <malloc.h>
#include <stdlib.h>
#include <crtdbg.h>
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
-80
View File
@@ -1,80 +0,0 @@
#ifndef TSRM_CONFIG_COMMON_H
#define TSRM_CONFIG_COMMON_H
#ifndef __CYGWIN__
# ifdef _WIN32
# define TSRM_WIN32
# endif
#endif
#ifdef TSRM_WIN32
# include "tsrm_config.w32.h"
#else
# include <tsrm_config.h>
# include <sys/param.h>
#endif
#if HAVE_ALLOCA_H && !defined(_ALLOCA_H)
# include <alloca.h>
#endif
/* AIX requires this to be the first thing in the file. */
#ifndef __GNUC__
# ifndef HAVE_ALLOCA_H
# ifdef _AIX
#pragma alloca
# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
# endif
# endif
# endif
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_LIMITS_H
#include <limits.h>
#endif
#ifndef MAXPATHLEN
# if _WIN32
# include "win32/ioutil.h"
# define MAXPATHLEN PHP_WIN32_IOUTIL_MAXPATHLEN
# elif PATH_MAX
# define MAXPATHLEN PATH_MAX
# elif defined(MAX_PATH)
# define MAXPATHLEN MAX_PATH
# else
# define MAXPATHLEN 256
# endif
#endif
#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2))
# define TSRM_ALLOCA_MAX_SIZE 4096
# define TSRM_ALLOCA_FLAG(name) \
int name;
# define tsrm_do_alloca_ex(size, limit, use_heap) \
((use_heap = ((size) > (limit))) ? malloc(size) : alloca(size))
# define tsrm_do_alloca(size, use_heap) \
tsrm_do_alloca_ex(size, TSRM_ALLOCA_MAX_SIZE, use_heap)
# define tsrm_free_alloca(p, use_heap) \
do { if (use_heap) free(p); } while (0)
#else
# define TSRM_ALLOCA_FLAG(name)
# define tsrm_do_alloca(p, use_heap) malloc(p)
# define tsrm_free_alloca(p, use_heap) free(p)
#endif
#endif /* TSRM_CONFIG_COMMON_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
-72
View File
@@ -1,72 +0,0 @@
#include <stdio.h>
#include "tsrm_config_common.h"
#include "tsrm_strtok_r.h"
static inline int in_character_class(char ch, const char *delim)
{/*{{{*/
while (*delim) {
if (*delim == ch) {
return 1;
}
delim++;
}
return 0;
}/*}}}*/
TSRM_API char *tsrm_strtok_r(char *s, const char *delim, char **last)
{/*{{{*/
char *token;
if (s == NULL) {
s = *last;
}
while (*s && in_character_class(*s, delim)) {
s++;
}
if (!*s) {
return NULL;
}
token = s;
while (*s && !in_character_class(*s, delim)) {
s++;
}
if (!*s) {
*last = s;
} else {
*s = '\0';
*last = s + 1;
}
return token;
}/*}}}*/
#if 0
main()
{
char foo[] = "/foo/bar//\\barbara";
char *last;
char *token;
token = tsrm_strtok_r(foo, "/\\", &last);
while (token) {
printf ("Token = '%s'\n", token);
token = tsrm_strtok_r(NULL, "/\\", &last);
}
return 0;
}
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
-8
View File
@@ -1,8 +0,0 @@
#ifndef TSRM_STRTOK_R
#define TSRM_STRTOK_R
#include "TSRM.h"
TSRM_API char *tsrm_strtok_r(char *s, const char *delim, char **last);
#endif
+9 -25
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2018 The PHP Group |
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -458,7 +458,6 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
process_pair *proc;
char *cmd = NULL;
wchar_t *cmdw = NULL, *cwdw = NULL, *envw = NULL;
int i;
char *ptype = (char *)type;
HANDLE thread_token = NULL;
HANDLE token_user = NULL;
@@ -468,17 +467,17 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
return NULL;
}
/*The following two checks can be removed once we drop XP support */
type_len = (int)strlen(type);
if (type_len <1 || type_len > 2) {
if (type_len < 1 || type_len > 2) {
return NULL;
}
for (i=0; i < type_len; i++) {
if (!(*ptype == 'r' || *ptype == 'w' || *ptype == 'b' || *ptype == 't')) {
return NULL;
}
ptype++;
if (ptype[0] != 'r' && ptype[0] != 'w') {
return NULL;
}
if (type_len > 1 && (ptype[1] != 'b' && ptype[1] != 't')) {
return NULL;
}
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
@@ -721,7 +720,6 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
TSRM_API int shmdt(const void *shmaddr)
{/*{{{*/
shm_pair *shm = shm_get(0, (void*)shmaddr);
int ret;
if (!shm->segment) {
return -1;
@@ -731,12 +729,7 @@ TSRM_API int shmdt(const void *shmaddr)
shm->descriptor->shm_lpid = getpid();
shm->descriptor->shm_nattch--;
ret = UnmapViewOfFile(shm->addr) ? 0 : -1;
if (!ret && shm->descriptor->shm_nattch <= 0) {
ret = UnmapViewOfFile(shm->descriptor) ? 0 : -1;
shm->descriptor = NULL;
}
return ret;
return UnmapViewOfFile(shm->addr) ? 0 : -1;
}/*}}}*/
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf)
@@ -826,12 +819,3 @@ TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
/* }}} */
#endif
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
+1 -10
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2018 The PHP Group |
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -109,12 +109,3 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags);
TSRM_API int shmdt(const void *shmaddr);
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf);
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
+685 -627
View File
File diff suppressed because it is too large. Load diff
+274 -155
View File
@@ -1,208 +1,327 @@
PHP 7.3 INTERNALS UPGRADE NOTES
PHP 7.4 INTERNALS UPGRADE NOTES
1. Internal API changes
a. array_init() and array_init_size()
b. Run-time constant operand addressing
c. Array/Object recursion protection
d. HASH_FLAG_PERSISTENT
e. AST and IS_CONSTANT
f. GC_REFCOUNT()
g. zend_get_parameters()
h. zend_register_persistent_resource()
i. RAND_RANGE()
j. cast_object() with _IS_NUMBER
k. zend_fcall_info_cache.initialized
l. php_hrtime_current()
m. zend_cpu_supports()
n. IS_TYPE_COPYABLE
o. IS_UNUSED
p. VM instruction operands (FETCH_CLASS, FETCH_CONSTANT, CATCH)
q. sapi_cli_single_write()
r. php_url
s. zend_function.reserved[]
t. zif_handler
u. GC_G
v. php_add[c]slashes
w. zend_class_entry.iterator_funcs
x. Class declaration opcodes (DECLARE_INHERITED_CLASS ...)
y. zend_constant
z. HAVE_ST_BLKSIZE and HAVE_ST_RDEV
aa. RETSIGTYPE
bb. php_setcookie
a. php_sys_symlink() and php_sys_link()
b. zend_lookup_class_ex() and zend_fetch_class_by_name()
c. Function/property/class flags
d. Removed zend_check_private()
e. php_win32_error_to_msg() memory management
f. get_properties_for() handler / Z_OBJDEBUG_P
g. Required object handlers
h. Immutable classes and op_arrays
i. php_fgetcsv() and php_fputcsv()
j. Removed add_get_assoc_*() and add_get_index_*()
k. Class declaration opcodes
l. HASH_FLAG_INITIALIZED
m. write_property return value
n. Assignments to references
o. ZEND_COMPILE_EXTENDED_INFO split
p. ZEND_EXT_FCALL_BEGIN can access arguments
q. ZEND_COMPILE_IGNORE_USER_FUNCTIONS and ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS
r. TSRM environment locking
s. Typed references support
t. Exceptions thrown by string conversions.
u. Removed uint and ulong typedefs
v. Compound assignment opcodes
w. APACHE symbol removed
x. php_error_docref0() renamed to php_error_docref()
y. Stream wrapper read/write ops
2. Build system changes
a. Unix build system changes
b. Windows build system changes
a. Abstract
b. Unix build system changes
c. Windows build system changes
3. Module changes
a. ext/xml
b. ext/hash
========================
1. Internal API changes
========================
a. array_init() and array_init_size() are not functions anymore.
They don't return any values.
a. php_sys_symlink() and php_sys_link() portability macros have been
added, which behave like POSIX's symlink() and link(), respectively, on
POSIX compliant systems and on Windows.
b. In 64-bit builds PHP-7.2 and below used relative run-time constant operand
addressing. E.g. opline->op1.constant kept an offset from start of literals
table - op_array->literals. To speedup access op_array->literals was cached
in execute_data->literals. So the resulting address calculated as
EX(literals) + opline->op1.constant.
b. zend_lookup_class_ex() and zend_fetch_class_by_name() prototypes were
changed to accept optional lower-case class name as zend_string*,
instead of zval*.
Now at run-time literals allocated close to opcodes, and addressed
relatively from current opline. This eliminates load of EX(literals) on
each constant access as well as EX(literals) initialization on each call.
c. Function/property/class flags changes
- ZEND_ACC_IMPLEMENTED_ABSTRACT is removed (it was used only internally
during inheritance).
- ZEND_ACC_IMPLICIT_PUBLIC is removed (it was used only for reflection)
- ZEND_ACC_SHADOW property flag is removed. Instead of creating shadow
clone, now we use the same private property_info, and should also
check property_info->ce (in the same way as with methods).
- ZEND_ACC_ANON_BOUND is replaced with ZEND_ACC_LINKED. This flag is set
not only during anonymous classes declaration, but also during any
run-time or compile-time class declaration.
- ZEND_ACC_NO_RT_ARENA renamed into ZEND_ACC_HEAP_RT_CACHE. Now it's used
not only for closures, but also for pseudo-main op_arrays.
- ZEND_ACC_... flags are re-numbered.
As result some related macros were removed (ZEND_EX_USE_LITERALS,
EX_LOAD_LITERALS, EX_LITERALS, RT_CONSTANT_EX, EX_CONSTANT) or changed
(RT_CONSTANT, ZEND_PASS_TWO_UPDATE_CONSTANT, ZEND_PASS_TWO_UNDO_CONSTANT).
This change may affect only some "system" extensions. EX_LITERALS,
RT_CONSTANT_EX, EX_CONSTANT should be substituted by RT_CONSTANT, and now
use "opline" (instead of "op_array") as first argument.
d. zend_check_private() is removed. Use (func->common.scope == scope) instead.
c. Protection from recursion during processing circular data structures was
refactored. HashTable.nApplyCount and IS_OBJ_APPLY_COUNT are replaced by
single flag GC_PROTECTED. Corresponding macros Z_OBJ_APPLY_COUNT,
Z_OBJ_INC_APPLY_COUNT, Z_OBJ_DEC_APPLY_COUNT, ZEND_HASH_GET_APPLY_COUNT,
ZEND_HASH_INC_APPLY_COUNT, ZEND_HASH_DEC_APPLY_COUNT are replaced with
GC_IS_RECURSIVE, GC_PROTECT_RECURSION, GC_UNPROTECT_RECURSION,
Z_IS_RECURSIVE, Z_PROTECT_RECURSION, Z_UNPROTECT_RECURSION.
e. Pointers returned by php_win32_error_to_msg() have to be freed using
php_win32_error_msg_free(). Same regarding php_win_err() vs.
php_win_err_free().
HASH_FLAG_APPLY_PROTECTION flag and ZEND_HASH_APPLY_PROTECTION() macro
are removed. All mutable arrays should use recursion protection.
Corresponding checks should be replaced by Z_REFCOUNTED() or
!(GC_FLAGS(p) & GC_IMMUTABLE).
f. A new, optional object handler with the signature
d. HASH_FLAG_PERSISTENT renamed into IS_ARRAY_PERSISTENT and moved into
GC_FLAGS (to be consistent with IS_STR_PERSISTENT).
HashTable *get_properties_for(zval *obj, zend_prop_purpose purpose)
e. zend_ast_ref structure is changed to use only one allocation.
zend_ast_copy() now returns zend_ast_ref (instead of zend_asr).
zend_ast_destroy_and_free() is removed. ZVAL_NEW_AST() is replaced
by ZVAL_AST().
has been introduced, where zend_prop_purpose (currently) takes one of:
IS_CONSTANT type and Z_CONST_FLAGS() are removed. Now constants are always
represented using IS_CONSTANT_AST (ZEND_AST_CONSTANT kind). AST node
attributes are used instead of constant flags. IS_TYPE_CONSTANT flag is
removed, but Z_CONSTANT() macro is kept for compatibility.
ZEND_PROP_PURPOSE_DEBUG // var_dump etc.
ZEND_PROP_PURPOSE_ARRAY_CAST // (array) $obj
ZEND_PROP_PURPOSE_SERIALIZE // "O"-format serialization (__wakeup)
ZEND_PROP_PURPOSE_VAR_EXPORT // var_export (__set_state)
ZEND_PROP_PURPOSE_JSON // json_encode
f. GC_REFCOUNT() is turned into inline function and can't be modified direcly.
All reference-counting operations should be done through corresponding
macros GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF().
The handler returns a non-null HashTable with increased refcounted, and
the return value must be released using zend_release_properties().
GC_REFCOUNT(p)++ should be changed into GC_ADDREF(p),
GC_REFCOUNT(p)-- into GC_DELREF(p),
GC_REFCOUNT(p) = 1 into GC_SET_REFCOUNT(p, 1).
This handler serves the same general function as get_properties(), but
provides more control over different property uses, while also making
it possible to return a temporary property table.
g. The zend_get_parameters() and zend_get_parameters_ex() functions were
removed. Instead zend_parse_parameters() should be used.
get_properties() is still used in cases where none of the above purposes
apply, but overloading get_properties() is generally discouraged. If you
want to provide purposes for general usage rather than just debugging or
serialization, please prefer using properly declared properties.
h. New functions zend_register_persistent_resource() or
zend_register_persistent_resource_ex() should beused to register
persistent resources, instead of manual insertion into EG(persistent_list).
get_debug_info() is superseded by get_properties_for() with the
ZEND_PROP_PURPOSE_DEBUG purpose, but remains available for backwards-
compatibility reasons. However, while it is fine to define this handler,
it should never be directly called by consuming code.
i. The RAND_RANGE() macro has been removed. php_mt_rand_range() should be
used instead.
The Z_OBJDEBUG_P macro has been removed. It should be replaced by calls to
zend_get_properties_for() with the ZEND_PROP_PURPOSE_DEBUG purpose:
j. The cast_object() object handler now also accepts the _IS_NUMBER type. The
handler should return either an integer or float value in this case,
whichever is more appropriate.
// OLD
int is_temp;
HashTable *ht = Z_OBJDEBUG_P(obj, is_temp);
// ...
if (is_temp) {
zend_hash_destroy(ht);
FREE_HASHTABLE(ht);
}
k. zend_fcall_info_cache.initialized is removed. zend_fcall_info_cache is
initialized if zend_fcall_info_cache.function_handler is set.
// NEW
HashTable *ht = zend_get_properties_for(obj, ZEND_PROP_PURPOSE_DEBUG);
// ...
zend_release_properties(ht);
l. php_hrtime_current() delivers the number of nanoseconds since an uncertain
point in the past.
g. The following object handlers are now required (must be non-NULL):
m. zend_cpu_supports() determines if a feature is supported by current cpu.
Also serial inline zend_cpu_supports_xxx() are added, which is designed for
ifunc resolver function, as resolver function should not depend on any
external function.
* free_obj
* dtor_obj
* read_property
* write_property
* read_dimension
* write_dimension
* get_property_ptr_ptr
* has_property
* unset_property
* has_dimension
* unset_dimension
* get_properties
* get_method
* get_constructor
* get_class_name
* get_gc
n. IS_TYPE_COPYABLE flag is removed. IS_STRING zvals didn't need to be
duplication by zval_copy_ctor(), ZVAL_DUP() and SEPARATE_ZVAL*() macros.
Interned strings didn't set IS_TYPE_COPYABLE, so they aren't affected at
all. Now instead of checking for IS_TYPE_COPYABLE, engine checks for
IS_ARRAY type (it may be IS_TYPE_REFCOUNTED or not). All the related
macros: Z_COPYABLE..., Z_IMMUTABLE... are kept for compatibility.
It is recommended to initialize object handler structures by copying the
std object handlers and only overwriting those you want to change.
o. IS_UNUSED became zero and can't be used as a bitmask (there were no such
usages in PHP sources).
h. Opcache may make classes and op_arrays immutable. Such classes are marked
by ZEND_ACC_IMMUTABLE flag, they are not going to be copied from opcache
shared memory to process memory and must not be modified at all.
Few related data structures were changed to allow addressing mutable data
structures from immutable ones. This access is implemented through
ZEND_MAP_PTR... abstraction macros and, basically, uses additional level of
indirection. op_array->run_time_cache, op_array->static_variables_ptr and
class_entry->static_members_table now have to be accessed through
ZEND_MAP_PTR... macros.
It's also not allowed to change op_array->reserved[] handles of immutable
op_arrays. Instead, now you have to reserve op_array handle using
zend_get_op_array_extension_handle() during MINIT and access its value
using ZEND_OP_ARRAY_EXTENSION(op_array, handle).
p. Operands of few VM instructions were changed
- FETCH_CLASS op1<fetch-flags>, op2<name>, result<var>
- FETCH_CONSTANT op1<fetch-flags>, op2<name>, result<tmp>
- CATCH ext<last-flag>, op1<name>, op2<jump_addr>, result<cv>
i. The type of the escape parameter of php_fgetcsv() and php_fputcsv() has
been changed from char to int. This allows to pass the new constant macro
PHP_CSV_NO_ESCAPE to this parameter, to disable PHP's proprietary escape
mechanism.
q. sapi_cli_single_write() now returns ssize_t instead of size_t.
j. add_get_assoc_*() and add_get_index_*() are removed. Use add_assoc*(),
add_index*() or zend_hash_*() API functions instead.
r. fields of php_url struct change from char * to zend_string *
k. Complex class declaration opcodes ZEND_ADD_INTERFACE, ZEND_ADD_TRAIT,
ZEND_BIND_TRAITS and ZEND_VERIFY_ABSTRACT_CLASS were removed. Information
about interfaces and traits is kept in zend_class_entry structure and
actual linked performed by ZEND_DECLARE_...CLASS... opcode(s).
Linked classes have ZEND_ACC_LINKED flag set.
s. Special purpose zend_functions marked by ZEND_ACC_CALL_VIA_TRAMPOLINE or
ZEND_ACC_FAKE_CLOSURE flags use reserved[0] for internal purpose.
Third party extensions must not modify reserved[] fields of these functions.
l. HASH_FLAG_INITIALIZED was reverted into HASH_FLAG_UNINITIALIZED. Special
HT_IS_INITIALIZED() and HT_INVALIDATE() macro were introduced to hide
implementation details.
t. For internal functions the typedef zif_handler has been introduced. It is
recommended to use this from now on, instead of defining own handler types.
m. The write_property() object handler now returns the assigned value (after
possible type coercions) rather than void. For extensions, it should
usually be sufficient to return whatever was passed as the argument.
u. The GC globals (GC_G) are now private. Use the new zend_gc_get_status() to
retrieve status information of the GC.
n. Assignments to references now need to ensure that they respect property
types that affect the reference. This means that references should no
longer be directly assigned to, and instead a set of specialized macros of
the form ZEND_TRY_ASSIGN* needs to be used. You can find detailed porting
instructions as well as a compatibility shim in the wiki:
https://wiki.php.net/rfc/typed_properties_v2#assignments_to_references
v. The should_free argument of the php_add[c]slashes functions has been
removed. It is now always the caller's responsibility to free the passed
string.
o. ZEND_COMPILE_EXTENDED_INFO has been split into:
ZEND_COMPILE_EXTENDED_FCALL and ZEND_COMPILE_EXTENDED_STMT
This allows tooling to choose between profiling and debugging behaviour
ZEND_COMPILE_EXTENDED_INFO remains and preserves behaviour.
w. zend_class_entry.iterator_funcs have been replaced by iterator_funcs_ptr.
You don't have to set its value, setting parent.funcs in the get_iterator
function is enough.
p. ZEND_EXT_BEGIN_FCALL is emitted after arguments are sent, this means
that handlers may access arguments.
x. Class declaration opcode formats were changed
- DECLARE_INHERITED_CLASS and DECLARE_ANON_INHERITED_CLASS now encode parent
class name in second operand directly (as IS_CONST operand). Previously,
parent class was fetched by the prior FETCH_CLASS opcode.
- ADD_INTERFACE and ADD_TRAIT don't use run-time cache to keep interface or
trait. These instructions are executed once, and caching is useless.
q. ZEND_COMPILE_IGNORE_USER_FUNCTIONS and ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS
are respected by zend_get_call_op such that when set, the only possible
call opcodes are ZEND_DO_FCALL and ZEND_DO_FCALL_BY_NAME, previously they
were ignored by zend_get_call_op.
y. zend_constant.flags and zend_constant.module_number are packed into
reserved space inside zend_constant.value. They should be accessed using
ZEND_CONSTANT_FLAGS(), ZEND_CONSTANT_MODULE_NUMBER() and
ZEND_CONSTANT_SET_FLAGS() macros.
r. TSRM adds tsrm_env_lock() and tsrm_env_unlock() for ZTS:
code that may change environ and may run concurrently with user code in ZTS
is expected to use this exclusion API to maintain as much safety as
reasonable. This results in "thread safe" getenv/putenv in Windows and
Unix, however functions that may read the environment without exclusion
still exist, for example:
- setlocale
- mktime
- tzset
The above is not an exhaustive list of such functions, while getenv/putenv
will behave as if they are safe, care should still be taken in
multi-threaded environments.
z. HAVE_ST_BLKSIZE must be replaced with HAVE_STRUCT_STAT_ST_BLKSIZE and
HAVE_ST_RDEV must be replaced with HAVE_STRUCT_STAT_ST_RDEV.
s. Correct support for typed properties requires the use of new macros to
assign values to references. For more information see
https://wiki.php.net/rfc/typed_properties_v2#impact_on_extensions.
aa. RETSIGTYPE has been removed from the generated php_config.h and should be
replaced with void.
t. convert_to_string() and zval_get_string() are now more likely to result in
an exception. For instructions on how to gracefully handle this see
https://wiki.php.net/rfc/tostring_exceptions#extension_guidelines.
bb. php_setcookie() now expects an additional samesite argument, and the
url_encode parameter has been moved to the end. The signature is now:
int php_setcookie(zend_string *name, zend_string *value, time_t expires,
zend_string *path, zend_string *domain, int secure,
int httponly, zend_string *samesite, int url_encode);
u. The Windows typedefs uint and ulong are no longer available, and have to be
replaced with standard types.
v. Compound assignment opcodes were changed. Instead of ZEND_ASSIGN_ADD (and
others) with 0, ZEND_ASSIGN_DIM, ZEND_ASSIGN_OBJ or
ZEND_ASSIGN_STATIC_PROP in extended value, now we use ZEND_ASSIGN_OP,
ZEND_ASSIGN_DIM_OP, ZEND_ASSIGN_OBJ_OP and ZEND_ASSIGN_STATIC_PROP_OP with
ZEND_ADD (or other) in extended_value.
w. APACHE symbol has been removed and is no longer defined.
x. php_error_docref0() has been removed and renamed to php_error_docref().
y. The read and write operations of php_stream_ops now return ssize_t, with
negative values indicating an error.
========================
2. Build system changes
========================
a. Unix build system changes
- PHP_PROG_LEX, TSRM_CHECK_GCC_ARG, and LIBZEND_CPLUSPLUS_CHECKS Autoconf
macros have been removed.
- Minimum Autoconf version is 2.68+ for generating the configure script.
a. Abstract
- The hash extension is now always available, meaning the --enable-hash
configure argument has been removed.
- The filter extension no longer exposes the --with-pcre-dir configure
argument and therefore allows shared builds with ./configure for Unix
builds.
- Symbols HAVE_DATE, HAVE_REFLECTION, and HAVE_SPL have been removed. It
should be considered to have these extensions always available.
- Removed unused build time symbols: PHP_ADA_INCLUDE, PHP_ADA_LFLAGS,
PHP_ADA_LIBS, PHP_APACHE_INCLUDE, PHP_APACHE_TARGET, PHP_FHTTPD_INCLUDE,
PHP_FHTTPD_LIB, PHP_FHTTPD_TARGET, PHP_CFLAGS, PHP_DBASE_LIB,
PHP_BUILD_DEBUG, PHP_GDBM_INCLUDE, PHP_IBASE_INCLUDE, PHP_IBASE_LFLAGS,
PHP_IBASE_LIBS, PHP_IFX_INCLUDE, PHP_IFX_LFLAGS, PHP_IFX_LIBS,
PHP_INSTALL_IT, PHP_IODBC_INCLUDE, PHP_IODBC_LFLAGS, PHP_IODBC_LIBS,
PHP_MSQL_LFLAGS, PHP_MSQL_INCLUDE, PHP_MSQL_LFLAGS, PHP_MSQL_LIBS,
PHP_MYSQL_INCLUDE, PHP_MYSQL_LIBS, PHP_MYSQL_TYPE, PHP_OCI8_SHARED_LIBADD,
PHP_ORACLE_SHARED_LIBADD, PHP_ORACLE_DIR, PHP_ORACLE_VERSION,
PHP_PGSQL_INCLUDE, PHP_PGSQL_LFLAGS, PHP_PGSQL_LIBS, PHP_SOLID_INCLUDE,
PHP_SOLID_LIBS, PHP_EMPRESS_INCLUDE, PHP_EMPRESS_LIBS, PHP_SYBASE_INCLUDE,
PHP_SYBASE_LFLAGS, PHP_SYBASE_LIBS, PHP_DBM_TYPE, PHP_DBM_LIB,
PHP_LDAP_LFLAGS, PHP_LDAP_INCLUDE, PHP_LDAP_LIBS.
- Removed unused symbols: HAVE_CURL_EASY_STRERROR, HAVE_CURL_MULTI_STRERROR,
HAVE_MPIR, HAVE_MBSTR_CN, HAVE_MBSTR_JA, HAVE_MBSTR_KR, HAVE_MBSTR_RU,
HAVE_MBSTR_TW.
b. Windows build system changes
- ZEND_WIN32_FORCE_INLINE doesn't affect C++ anymore. zend_always_inline is
still usable in C++, but anything else inlining related is up to
compiler.
- ZEND_WIN32_KEEP_INLINE was removed, it was only needed for C++
convenience and is now default behavior with C++.
- New configure option --enable-native-intrinsics accepts a list of the
intrinsic optimizations to enable. It affects both the code generation
and the explicit optimizations guarded by preprocessor macros.
- The configure option --with-codegen-arch accepts only ia32 as a value.
Use it, to produce builds suitable for older processors without SSE2 or
even SSE support.
b. Unix build system changes
- Added --ini-path and --ini-dir options to php-config.
- configure --help now also outputs --program-suffix and --program-prefix
information by using the Autoconf AC_ARG_PROGRAM macro.
- Obsolescent macros AC_FUNC_VPRINTF and AC_FUNC_UTIME_NULL have been
removed. Symbols HAVE_VPRINTF and HAVE_UTIME_NULL are no longer defined
since they are not needed on the current systems.
- Local PHP m4 unused or obsolete macros have been removed:
PHP_TARGET_RDYNAMIC, PHP_SOLARIS_PIC_WEIRDNESS, PHP_SYS_LFS,
PHP_AC_BROKEN_SPRINTF, PHP_EXTENSION, PHP_DECLARED_TIMEZONE,
PHP_CHECK_TYPES, PHP_CHECK_64BIT, PHP_READDIR_R_TYPE,
PHP_SETUP_KERBEROS.
- Local PHP_TM_GMTOFF m4 macro replaced with Autoconf's AC_CHECK_MEMBERS.
The HAVE_TM_GMTOFF symbol is replaced with HAVE_STRUCT_TM_TM_GMTOFF and
HAVE_TM_ZONE symbol is replaced with HAVE_STRUCT_TM_TM_ZONE.
- new --enable-rtld-now build option allow to switch dlopen behavior
from RTLD_LAZY to RTLD_NOW
- Minimum Bison version is 3.0+ for generating parser files.
- PHP_PROG_BISON macro now takes two optional arguments - minimum required
version and excluded versions that aren't supported.
- PHP_PROG_RE2C is not called in the generated configure.ac for extensions
anymore and now takes one optional argument - minimum required version.
- with-pcre-valgrind and with-valgrind are merged, and valgrind detected by
pkgconfig
- Removed unused AC_PROG_CC_C_O check and the NO_MINUS_C_MINUS_O symbol.
- Obsolescant checks for headers and functions that are part of C89 have
been removed. The following symbols are therefore no longer defined by the
PHP build system at the configure step and shouldn't be used anymore:
HAVE_SETLOCALE, HAVE_LOCALECONV, HAVE_STRSTR, HAVE_STRTOL, HAVE_STRBRK,
HAVE_PERROR, HAVE_STRFTIME, HAVE_TZNAME, HAVE_STDARG_H, HAVE_STRING_H,
HAVE_STDLIB_H, HAVE_SYS_VARARGS_H, HAVE_ASSERT_H, HAVE_SYS_DIR_H,
TM_IN_SYS_TIME, HAVE_STRTOD, HAVE_STRCOLL, HAVE_ERRNO_H, HAVE_MEMCPY,
HAVE_SNPRINTF, HAVE_STDIO_H, HAVE_STRPBRK, HAVE_TIME_H, HAVE_LIMITS_H,
HAVE_STRTOUL, HAVE_SYS_NDIR_H, HAVE_SYS_TIMES_H, PHP_HAVE_STDINT_TYPES,
HAVE_SIGNAL_H, HAVE_STRERROR.
- Removed unused check for dev/arandom and the HAVE_DEV_ARANDOM symbol.
- Remove unused functions checks: HAVE_MBSINIT, HAVE_MEMPCPY, HAVE_SETPGID,
HAVE_STRPNCPY, HAVE_STRTOULL, HAVE_VSNPRINTF, HAVE_CUSERID, HAVE_LRAND48,
HAVE_RANDOM, HAVE_SRAND48, HAVE_SRANDOM, HAVE_STRDUP, HAVE_GCVT,
HAVE_ISASCII, HAVE_LINK, HAVE_LOCKF, HAVE_SOCKOPT, HAVE_SETVBUF, HAVE_SIN,
HAVE_TEMPNAM.
- Unused check for struct cmsghdr and symbol HAVE_CMSGHDR have been removed.
- Unused ApplicationServices/ApplicationServices.h headers check and
HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H symbol have been removed.
- PHP_DEBUG_MACRO macro has been removed.
- PHP_CHECK_CONFIGURE_OPTIONS macro has been removed. Default Autoconf's
--enable-option-checking=fatal option can be used in the configure step
to enable error when invalid options are used.
- Removed unused check and symbols HAVE_SHM_MMAP_ZERO, HAVE_SHM_MMAP_FILE.
- Removed unused check and symbol MISSING_MSGHDR_MSGFLAGS.
c. Windows build system changes
. Visual Studio 2019 is utilized for the Windows builds
. Removed unused defined symbol HAVE_LIBBIND.
========================
3. Module changes
========================
a. ext/xml
- The public (internal) API of the ext/xml extension has been removed. All
functions and structures are private to the extension now.
b. ext/hash
- The hash extension is now always available, allowing extensions to rely
on its functionality to be available without compile time checks.
-55
View File
@@ -1,55 +0,0 @@
## Process this file with automake to produce Makefile.in -*- makefile -*-
#CLEANFILES = zend_language_parser.c zend_language_parser.h zend_language_scanner.c zend_language_parser.output zend_ini_parser.c zend_ini_parser.h zend_ini_scanner.c zend_ini_parser.output
AUTOMAKE_OPTIONS=foreign
noinst_LTLIBRARIES=libZend.la
libZend_la_SOURCES=\
zend_language_parser.y zend_language_scanner.l \
zend_ini_parser.y zend_ini_scanner.l \
zend_alloc.c zend_compile.c zend_constants.c \
zend_execute.c zend_execute_API.c zend_highlight.c zend_llist.c \
zend_vm_opcodes.c zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
zend_list.c zend_builtin_functions.c zend_sprintf.c \
zend_ini.c zend_sort.c zend_objects.c zend_object_handlers.c \
zend_objects_API.c zend_ts_hash.c zend_stream.c \
zend_default_classes.c \
zend_iterators.c zend_interfaces.c zend_exceptions.c \
zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c \
zend_generators.c zend_virtual_cwd.c zend_ast.c zend_smart_str.c zend_cpuinfo.c
libZend_la_CFLAGS = -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1
libZend_la_LDFLAGS =
libZend_la_LIBADD = @ZEND_EXTRA_LIBS@
# automake isn't too clever about "non-standard" use of lex and yacc
$(libZend_la_OBJECTS): zend_language_parser.h
zend_ini_scanner.lo: zend_ini_parser.h
# Language parser/scanner rules
zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
$(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt $(srcdir)/zend_language_scanner_defs.h -o$@ $(srcdir)/zend_language_scanner.l
zend_language_parser.h: zend_language_parser.c
zend_language_parser.c: $(srcdir)/zend_language_parser.y
$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o zend_language_parser.c
# INI parser/scanner rules
zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o zend_ini_parser.c
zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
$(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt $(srcdir)/zend_ini_scanner_defs.h -o$@ $(srcdir)/zend_ini_scanner.l
zend_ini_parser.h: zend_ini_parser.c
depend:
zend_execute.lo: $(srcdir)/zend_execute.c
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(INLINE_CFLAGS) -c $(srcdir)/zend_execute.c
Executable → Regular
+36
View File
@@ -1 +1,37 @@
#
# Zend
#
$(builddir)/zend_language_scanner.lo: $(srcdir)/zend_language_parser.h
$(builddir)/zend_ini_scanner.lo: $(srcdir)/zend_ini_parser.h
$(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/zend_language_scanner.l)
$(srcdir)/zend_language_parser.h: $(srcdir)/zend_language_parser.c
$(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
# Tweak zendparse to be exported through ZEND_API. This has to be revisited once
# bison supports foreign skeletons and that bison version is used. Read
# https://git.savannah.gnu.org/cgit/bison.git/tree/data/README.md for more.
@$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o $@
@$(SED) -e 's,^int zendparse\(.*\),ZEND_API int zendparse\1,g' < $@ \
> $@.tmp && \
mv $@.tmp $@
@$(SED) -e 's,^int zendparse\(.*\),ZEND_API int zendparse\1,g' < $(srcdir)/zend_language_parser.h \
> $(srcdir)/zend_language_parser.h.tmp && \
mv $(srcdir)/zend_language_parser.h.tmp $(srcdir)/zend_language_parser.h
@nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
$(SED) -e "s/^#ifndef YYTOKENTYPE/#include \"zend.h\"\\$${nl}#ifndef YYTOKENTYPE/" < $(srcdir)/zend_language_parser.h \
> $(srcdir)/zend_language_parser.h.tmp && \
mv $(srcdir)/zend_language_parser.h.tmp $(srcdir)/zend_language_parser.h
$(srcdir)/zend_ini_parser.h: $(srcdir)/zend_ini_parser.c
$(srcdir)/zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
@$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@
$(srcdir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
@(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l)
$(builddir)/zend_highlight.lo $(builddir)/zend_compile.lo: $(srcdir)/zend_language_parser.h
Zend/zend_execute.lo: $(srcdir)/zend_vm_execute.h $(srcdir)/zend_vm_opcodes.h
-43
View File
@@ -1,43 +0,0 @@
Zend Memory Manager
===================
General:
--------
The goal of the new memory manager (available since PHP 5.2) is to reduce memory
allocation overhead and speedup memory management.
The new manager's "configure" has no "--disable-zend-memory-manager" option,
but it has "--enable-malloc-mm" instead. It is enabled by default in DEBUG
build and disabled by default in RELEASE build. When enabled it allows selecting
between malloc and emalloc at runtime so you can use internal and external memory
debuggers without recompilation.
Debugging:
----------
Normal:
$ sapi/cli/php -r 'leak();'
Zend MM disabled:
$ USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php -r 'leak();'
Shared extensions:
------------------
Since PHP 5.3.11 it is possible to prevent shared extensions from unloading so
that valgrind can correctly track the memory leaks in shared extensions. For
this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then
DL_UNLOAD() is skipped during the shutdown of shared extensions.
Tweaking:
---------
The Zend MM can be tweaked using ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE environment
variables. Default values are "malloc" and "256K". Dependent on target system you
can also use "mmap_anon", "mmap_zero" and "win32" storage managers.
$ ZEND_MM_MEM_TYPE=mmap_anon ZEND_MM_SEG_SIZE=1M sapi/cli/php ..etc.
-102
View File
@@ -1,102 +0,0 @@
ZEND_VM
=======
ZEND_VM architecture allows specializing opcode handlers according to op_type
fields and using different execution methods (call threading, switch threading
and direct threading). As a result ZE2 got more than 20% speedup on raw PHP
code execution (with specialized executor and direct threading execution
method). As in most PHP applications raw execution speed isn't the limiting
factor but system calls and database calls are, your mileage with this patch
will vary.
Most parts of the old zend_execute.c go into zend_vm_def.h. Here you can
find opcode handlers and helpers. The typical opcode handler template looks
like this:
ZEND_VM_HANDLER(<OPCODE-NUMBER>, <OPCODE>, <OP1_TYPES>, <OP2_TYPES>)
{
<HANDLER'S CODE>
}
<OPCODE-NUMBER> is a opcode number (0, 1, ...)
<OPCODE> is an opcode name (ZEN_NOP, ZEND_ADD, :)
<OP1_TYPES> & <OP2_TYPES> are masks for allowed operand op_types. Specializer
will generate code only for defined combination of types. You can use any
combination of the following op_types UNUSED, CONST, VAR, TMP and CV also
you can use ANY mask to disable specialization according operand's op_type.
<HANDLER'S CODE> is a handler's code itself. For most handlers it stills the
same as in old zend_execute.c, but now it uses macros to access opcode operands
and some internal executor data.
You can see the conformity of new macros to old code in the following list:
EXECUTE_DATA
execute_data
ZEND_VM_DISPATCH_TO_HANDLER(<OP>)
return <OP>_helper(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)
ZEND_VM_DISPATCH_TO_HELPER(<NAME>)
return <NAME>(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)
ZEND_VM_DISPATCH_TO_HELPER_EX(<NAME>,<PARAM>,<VAL>)
return <NAME>(<VAL>, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)
ZEND_VM_CONTINUE()
return 0
ZEND_VM_NEXT_OPCODE()
NEXT_OPCODE()
ZEND_VM_SET_OPCODE(<TARGET>
SET_OPCODE(<TARGET>
ZEND_VM_INC_OPCODE()
INC_OPCOD()
ZEND_VM_RETURN_FROM_EXECUTE_LOOP()
RETURN_FROM_EXECUTE_LOOP()
ZEND_VM_C_LABEL(<LABEL>):
<LABEL>:
ZEND_VM_C_GOTO(<LABEL>)
goto <LABEL>
OP<X>_TYPE
opline->op<X>.op_type
GET_OP<X>_ZVAL_PTR(<TYPE>)
get_zval_ptr(&opline->op<X>, EX(Ts), &free_op<X>, <TYPE>)
GET_OP<X>_ZVAL_PTR_PTR(<TYPE>)
get_zval_ptr_ptr(&opline->op<X>, EX(Ts), &free_op<X>, <TYPE>)
GET_OP<X>_OBJ_ZVAL_PTR(<TYPE>)
get_obj_zval_ptr(&opline->op<X>, EX(Ts), &free_op<X>, <TYPE>)
GET_OP<X>_OBJ_ZVAL_PTR_PTR(<TYPE>)
get_obj_zval_ptr_ptr(&opline->op<X>, EX(Ts), &free_op<X>, <TYPE>)
IS_OP<X>_TMP_FREE()
IS_TMP_FREE(free_op<X>)
FREE_OP<X>()
FREE_OP(free_op<X>)
FREE_OP<X>_IF_VAR()
FREE_VAR(free_op<X>)
FREE_OP<X>_VAR_PTR()
FREE_VAR_PTR(free_op<X>)
Executor's helpers can be defined without parameters or with one parameter.
This is done with the following constructs:
ZEND_VM_HELPER(<HELPER-NAME>, <OP1_TYPES>, <OP2_TYPES>)
{
<HELPER'S CODE>
}
ZEND_VM_HELPER_EX(<HELPER-NAME>, <OP1_TYPES>, <OP2_TYPES>, <PARAM_SPEC>)
{
<HELPER'S CODE>
}
Executor's code is generated by PHP script zend_vm_gen.php it uses zend_vm_def.h
and zend_vm_execute.skl as input and produces zend_vm_opcodes.h and
zend_vm_execute.h. The first file is a list of opcode definitions. It is
included from zend_compile.h. The second one is an executor code itself. It is
included from zend_execute.c.
zend_vm_gen.php can produce different kind of executors. You can select
different opcode threading model using --with-vm-kind=CALL|SWITCH|GOTO. You can
disable opcode specialization using --without-specializer. You can include or
exclude old executor together with specialized one using --without-old-executor.
At last you can debug executor using original zend_vm_def.h or generated file
zend_vm_execute.h. Debugging with original file requires --with-lines
option. By default ZE2 uses the following command to generate executor:
$ php zend_vm_gen.php --with-vm-kind=CALL
+139
View File
@@ -0,0 +1,139 @@
# Zend Engine
## Zend memory manager
### General
The goal of the new memory manager (available since PHP 5.2) is to reduce memory
allocation overhead and speedup memory management.
### Debugging
Normal:
```bash
sapi/cli/php -r 'leak();'
```
Zend MM disabled:
```bash
USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php -r 'leak();'
```
### Shared extensions
Since PHP 5.3.11 it is possible to prevent shared extensions from unloading so
that valgrind can correctly track the memory leaks in shared extensions. For
this there is the `ZEND_DONT_UNLOAD_MODULES` environment variable. If set, then
`DL_UNLOAD()` is skipped during the shutdown of shared extensions.
## ZEND_VM
`ZEND_VM` architecture allows specializing opcode handlers according to
`op_type` fields and using different execution methods (call threading, switch
threading and direct threading). As a result ZE2 got more than 20% speedup on
raw PHP code execution (with specialized executor and direct threading execution
method). As in most PHP applications raw execution speed isn't the limiting
factor but system calls and database calls are, your mileage with this patch
will vary.
Most parts of the old zend_execute.c go into `zend_vm_def.h`. Here you can find
opcode handlers and helpers. The typical opcode handler template looks like
this:
```c
ZEND_VM_HANDLER(<OPCODE-NUMBER>, <OPCODE>, <OP1_TYPES>, <OP2_TYPES>)
{
<HANDLER'S CODE>
}
```
`<OPCODE-NUMBER>` is a opcode number (0, 1, ...)
`<OPCODE>` is an opcode name (ZEN_NOP, ZEND_ADD, :)
`<OP1_TYPES>` and `<OP2_TYPES>` are masks for allowed operand op_types.
Specializer will generate code only for defined combination of types. You can
use any combination of the following op_types UNUSED, CONST, VAR, TMP and CV
also you can use ANY mask to disable specialization according operand's op_type.
`<HANDLER'S CODE>` is a handler's code itself. For most handlers it stills the
same as in old `zend_execute.c`, but now it uses macros to access opcode
operands and some internal executor data.
You can see the conformity of new macros to old code in the following list:
```c
EXECUTE_DATA
execute_data
ZEND_VM_DISPATCH_TO_HANDLER(<OP>)
return <OP>_helper(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)
ZEND_VM_DISPATCH_TO_HELPER(<NAME>)
return <NAME>(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)
ZEND_VM_DISPATCH_TO_HELPER_EX(<NAME>,<PARAM>,<VAL>)
return <NAME>(<VAL>, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)
ZEND_VM_CONTINUE()
return 0
ZEND_VM_NEXT_OPCODE()
NEXT_OPCODE()
ZEND_VM_SET_OPCODE(<TARGET>
SET_OPCODE(<TARGET>
ZEND_VM_INC_OPCODE()
INC_OPCOD()
ZEND_VM_RETURN_FROM_EXECUTE_LOOP()
RETURN_FROM_EXECUTE_LOOP()
ZEND_VM_C_LABEL(<LABEL>):
<LABEL>:
ZEND_VM_C_GOTO(<LABEL>)
goto <LABEL>
OP<X>_TYPE
opline->op<X>.op_type
GET_OP<X>_ZVAL_PTR(<TYPE>)
get_zval_ptr(&opline->op<X>, EX(Ts), &free_op<X>, <TYPE>)
GET_OP<X>_ZVAL_PTR_PTR(<TYPE>)
get_zval_ptr_ptr(&opline->op<X>, EX(Ts), &free_op<X>, <TYPE>)
GET_OP<X>_OBJ_ZVAL_PTR(<TYPE>)
get_obj_zval_ptr(&opline->op<X>, EX(Ts), &free_op<X>, <TYPE>)
GET_OP<X>_OBJ_ZVAL_PTR_PTR(<TYPE>)
get_obj_zval_ptr_ptr(&opline->op<X>, EX(Ts), &free_op<X>, <TYPE>)
IS_OP<X>_TMP_FREE()
IS_TMP_FREE(free_op<X>)
FREE_OP<X>()
FREE_OP(free_op<X>)
FREE_OP<X>_IF_VAR()
FREE_VAR(free_op<X>)
FREE_OP<X>_VAR_PTR()
FREE_VAR_PTR(free_op<X>)
```
Executor's helpers can be defined without parameters or with one parameter. This
is done with the following constructs:
```c
ZEND_VM_HELPER(<HELPER-NAME>, <OP1_TYPES>, <OP2_TYPES>)
{
<HELPER'S CODE>
}
ZEND_VM_HELPER_EX(<HELPER-NAME>, <OP1_TYPES>, <OP2_TYPES>, <PARAM_SPEC>)
{
<HELPER'S CODE>
}
```
Executor's code is generated by PHP script zend_vm_gen.php it uses
`zend_vm_def.h` and `zend_vm_execute.skl` as input and produces
`zend_vm_opcodes.h` and `zend_vm_execute.h`. The first file is a list of opcode
definitions. It is included from `zend_compile.h`. The second one is an executor
code itself. It is included from `zend_execute.c`.
`zend_vm_gen.php` can produce different kind of executors. You can select
different opcode threading model using `--with-vm-kind=CALL|SWITCH|GOTO`. You
can disable opcode specialization using `--without-specializer`. You can include
or exclude old executor together with specialized one using
`--without-old-executor`. At last you can debug executor using original
`zend_vm_def.h` or generated file `zend_vm_execute.h`. Debugging with original
file requires `--with-lines` option. By default ZE2 uses the following command
to generate executor:
```bash
php zend_vm_gen.php --with-vm-kind=CALL
```
+165 -250
View File
@@ -1,77 +1,139 @@
dnl
dnl This file contains Zend specific autoconf functions.
dnl
dnl This file contains Zend specific autoconf macros.
AC_DEFUN([LIBZEND_CHECK_INT_TYPE],[
AC_MSG_CHECKING(for $1)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_INTTYPES_H
#include <inttypes.h>
#elif HAVE_STDINT_H
#include <stdint.h>
#endif]],
[[if (($1 *) 0)
return 0;
if (sizeof ($1))
return 0;
]])],[
AC_DEFINE_UNQUOTED([HAVE_]translit($1,a-z_-,A-Z__), 1,[Define if $1 type is present. ])
AC_MSG_RESULT(yes)
], [AC_MSG_RESULT(no)
])dnl
dnl
dnl ZEND_CHECK_FLOAT_PRECISION
dnl
dnl x87 floating point internal precision control checks
dnl See: http://wiki.php.net/rfc/rounding
dnl
AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
AC_MSG_CHECKING([for usable _FPU_SETCW])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <fpu_control.h>
]],[[
fpu_control_t fpu_oldcw, fpu_cw;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
_FPU_GETCW(fpu_oldcw);
fpu_cw = (fpu_oldcw & ~_FPU_EXTENDED & ~_FPU_SINGLE) | _FPU_DOUBLE;
_FPU_SETCW(fpu_cw);
result = a / b;
_FPU_SETCW(fpu_oldcw);
]])],[ac_cfp_have__fpu_setcw=yes],[ac_cfp_have__fpu_setcw=no])
if test "$ac_cfp_have__fpu_setcw" = "yes" ; then
AC_DEFINE(HAVE__FPU_SETCW, 1, [whether _FPU_SETCW is present and usable])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([for usable fpsetprec])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <machine/ieeefp.h>
]],[[
fp_prec_t fpu_oldprec;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
fpu_oldprec = fpgetprec();
fpsetprec(FP_PD);
result = a / b;
fpsetprec(fpu_oldprec);
]])], [ac_cfp_have_fpsetprec=yes], [ac_cfp_have_fpsetprec=no])
if test "$ac_cfp_have_fpsetprec" = "yes" ; then
AC_DEFINE(HAVE_FPSETPREC, 1, [whether fpsetprec is present and usable])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([for usable _controlfp])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <float.h>
]],[[
unsigned int fpu_oldcw;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
fpu_oldcw = _controlfp(0, 0);
_controlfp(_PC_53, _MCW_PC);
result = a / b;
_controlfp(fpu_oldcw, _MCW_PC);
]])], [ac_cfp_have__controlfp=yes], [ac_cfp_have__controlfp=no])
if test "$ac_cfp_have__controlfp" = "yes" ; then
AC_DEFINE(HAVE__CONTROLFP, 1, [whether _controlfp is present usable])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([for usable _controlfp_s])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <float.h>
]],[[
unsigned int fpu_oldcw, fpu_cw;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
_controlfp_s(&fpu_cw, 0, 0);
fpu_oldcw = fpu_cw;
_controlfp_s(&fpu_cw, _PC_53, _MCW_PC);
result = a / b;
_controlfp_s(&fpu_cw, fpu_oldcw, _MCW_PC);
]])], [ac_cfp_have__controlfp_s=yes], [ac_cfp_have__controlfp_s=no])
if test "$ac_cfp_have__controlfp_s" = "yes" ; then
AC_DEFINE(HAVE__CONTROLFP_S, 1, [whether _controlfp_s is present and usable])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([whether FPU control word can be manipulated by inline assembler])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
/* nothing */
]],[[
unsigned int oldcw, cw;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
__asm__ __volatile__ ("fnstcw %0" : "=m" (*&oldcw));
cw = (oldcw & ~0x0 & ~0x300) | 0x200;
__asm__ __volatile__ ("fldcw %0" : : "m" (*&cw));
result = a / b;
__asm__ __volatile__ ("fldcw %0" : : "m" (*&oldcw));
]])], [ac_cfp_have_fpu_inline_asm_x86=yes], [ac_cfp_have_fpu_inline_asm_x86=no])
if test "$ac_cfp_have_fpu_inline_asm_x86" = "yes" ; then
AC_DEFINE(HAVE_FPU_INLINE_ASM_X86, 1, [whether FPU control word can be manipulated by inline assembler])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
])
dnl
dnl LIBZEND_BASIC_CHECKS
dnl
dnl Basic checks specific for the Zend engine library.
dnl
AC_DEFUN([LIBZEND_BASIC_CHECKS],[
AC_REQUIRE([AC_PROG_YACC])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_CC_C_O])
AC_REQUIRE([AC_HEADER_STDC])
LIBZEND_BISON_CHECK
AC_CHECK_HEADERS([cpuid.h])
dnl Ugly hack to get around a problem with gcc on AIX.
if test "$CC" = "gcc" -a "$ac_cv_prog_cc_g" = "yes" -a \
"`uname -sv`" = "AIX 4"; then
CFLAGS=`echo $CFLAGS | sed -e 's/-g//'`
fi
dnl Hack to work around a Mac OS X cpp problem
dnl Known versions needing this workaround are 5.3 and 5.4
if test "$ac_cv_prog_gcc" = "yes" -a "`uname -s`" = "Rhapsody"; then
CPPFLAGS="$CPPFLAGS -traditional-cpp"
fi
AC_CHECK_HEADERS(
inttypes.h \
stdint.h \
limits.h \
malloc.h \
string.h \
unistd.h \
stdarg.h \
sys/types.h \
sys/time.h \
signal.h \
unix.h \
stdlib.h \
cpuid.h \
dlfcn.h)
AC_TYPE_SIZE_T
AC_DEFUN([LIBZEND_LIBDL_CHECKS],[
AC_CHECK_LIB(dl, dlopen, [LIBS="-ldl $LIBS"])
AC_CHECK_FUNC(dlopen,[AC_DEFINE(HAVE_LIBDL, 1,[ ])])
])
AC_DEFUN([LIBZEND_DLSYM_CHECK],[
dnl
dnl LIBZEND_DLSYM_CHECK
dnl
dnl Ugly hack to check if dlsym() requires a leading underscore in symbol name.
dnl
AC_DEFUN([LIBZEND_DLSYM_CHECK],[
AC_MSG_CHECKING([whether dlsym() requires a leading underscore in symbol names])
_LT_AC_TRY_DLOPEN_SELF([
AC_MSG_RESULT(no)
@@ -83,28 +145,14 @@ _LT_AC_TRY_DLOPEN_SELF([
], [])
])
dnl This is required for QNX and may be some BSD derived systems
AC_CHECK_TYPE( uint, unsigned int )
AC_CHECK_TYPE( ulong, unsigned long )
dnl Check if int32_t and uint32_t are defined
LIBZEND_CHECK_INT_TYPE(int32_t)
LIBZEND_CHECK_INT_TYPE(uint32_t)
dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MEMCMP
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp)
AC_ZEND_BROKEN_SPRINTF
AC_CHECK_FUNCS(getpid kill finite sigsetjmp)
AC_CHECK_DECLS([isfinite, isnan, isinf], [], [], [[#include <math.h>]])
ZEND_FP_EXCEPT
ZEND_CHECK_FLOAT_PRECISION
dnl test whether double cast to long preserves least significant bits
dnl Test whether double cast to long preserves least significant bits.
AC_MSG_CHECKING(whether double cast to long preserves least significant bits)
AC_RUN_IFELSE([AC_LANG_SOURCE([[
@@ -138,33 +186,22 @@ int main()
])
AC_DEFUN([LIBZEND_ENABLE_DEBUG],[
AC_ARG_ENABLE(debug,
[ --enable-debug Compile with debugging symbols],[
ZEND_DEBUG=$enableval
],[
ZEND_DEBUG=no
])
])
dnl
dnl LIBZEND_OTHER_CHECKS
dnl
AC_DEFUN([LIBZEND_OTHER_CHECKS],[
AC_ARG_ENABLE(maintainer-zts,
[ --enable-maintainer-zts Enable thread safety - for code maintainers only!!],[
ZEND_MAINTAINER_ZTS=$enableval
],[
ZEND_MAINTAINER_ZTS=no
])
AC_ARG_ENABLE([maintainer-zts],
[AS_HELP_STRING([--enable-maintainer-zts],
[Enable thread safety - for code maintainers only!!])],
[ZEND_MAINTAINER_ZTS=$enableval],
[ZEND_MAINTAINER_ZTS=no])
AC_ARG_ENABLE(inline-optimization,
[ --disable-inline-optimization
If building zend_execute.lo fails, try this switch],[
ZEND_INLINE_OPTIMIZATION=$enableval
],[
ZEND_INLINE_OPTIMIZATION=yes
])
AC_ARG_ENABLE([inline-optimization],
[AS_HELP_STRING([--disable-inline-optimization],
[If building zend_execute.lo fails, try this switch])],
[ZEND_INLINE_OPTIMIZATION=$enableval],
[ZEND_INLINE_OPTIMIZATION=yes])
AC_MSG_CHECKING(whether to enable thread-safety)
AC_MSG_RESULT($ZEND_MAINTAINER_ZTS)
@@ -181,13 +218,11 @@ if test "$ZEND_DEBUG" = "yes"; then
if test "$CFLAGS" = "-g -O2"; then
CFLAGS=-g
fi
test -n "$GCC" && DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall"
test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
DEBUG_CFLAGS="$DEBUG_CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
else
AC_DEFINE(ZEND_DEBUG,0,[ ])
fi
test -n "$GCC" && CFLAGS="$CFLAGS -Wall -Wno-strict-aliasing"
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
@@ -215,8 +250,8 @@ else
AC_MSG_RESULT(no)
fi
dnl test and set the alignment define for ZEND_MM
dnl this also does the logarithmic test for ZEND_MM.
dnl Test and set the alignment define for ZEND_MM. This also does the
dnl logarithmic test for ZEND_MM.
AC_MSG_CHECKING(for MM alignment and log values)
AC_RUN_IFELSE([AC_LANG_SOURCE([[
@@ -257,126 +292,22 @@ int main()
AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT, $LIBZEND_MM_ALIGN, [ ])
AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT_LOG2, $LIBZEND_MM_ALIGN_LOG2, [ ])
], [], [
dnl cross-compile needs something here
dnl Cross compilation needs something here.
LIBZEND_MM_ALIGN=8
])
AC_MSG_RESULT(done)
dnl test for memory allocation using mmap(MAP_ANON)
AC_MSG_CHECKING(for memory allocation using mmap(MAP_ANON))
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <stdlib.h>
#include <stdio.h>
#ifndef MAP_ANON
# ifdef MAP_ANONYMOUS
# define MAP_ANON MAP_ANONYMOUS
# endif
#endif
#ifndef MREMAP_MAYMOVE
# define MREMAP_MAYMOVE 0
#endif
#ifndef MAP_FAILED
# define MAP_FAILED ((void*)-1)
#endif
#define SEG_SIZE (256*1024)
int main()
{
void *seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
if (seg == MAP_FAILED) {
return 1;
}
if (munmap(seg, SEG_SIZE) != 0) {
return 2;
}
return 0;
}
]])], [
AC_DEFINE([HAVE_MEM_MMAP_ANON], 1, [Define if the target system has support for memory allocation using mmap(MAP_ANON)])
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
], [
dnl cross-compile needs something here
AC_MSG_RESULT(no)
])
dnl test for memory allocation using mmap("/dev/zero")
AC_MSG_CHECKING(for memory allocation using mmap("/dev/zero"))
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <stdlib.h>
#include <stdio.h>
#ifndef MAP_ANON
# ifdef MAP_ANONYMOUS
# define MAP_ANON MAP_ANONYMOUS
# endif
#endif
#ifndef MREMAP_MAYMOVE
# define MREMAP_MAYMOVE 0
#endif
#ifndef MAP_FAILED
# define MAP_FAILED ((void*)-1)
#endif
#define SEG_SIZE (256*1024)
int main()
{
int fd;
void *seg;
fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR);
if (fd < 0) {
return 1;
}
seg = mmap(NULL, SEG_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
if (seg == MAP_FAILED) {
return 2;
}
if (munmap(seg, SEG_SIZE) != 0) {
return 3;
}
if (close(fd) != 0) {
return 4;
}
return 0;
}
]])], [
AC_DEFINE([HAVE_MEM_MMAP_ZERO], 1, [Define if the target system has support for memory allocation using mmap("/dev/zero")])
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
], [
dnl cross-compile needs something here
AC_MSG_RESULT(no)
])
AC_CHECK_FUNCS(mremap)
AC_ARG_ENABLE([zend-signals],
[AS_HELP_STRING([--disable-zend-signals],
[whether to enable zend signal handling])],
[ZEND_SIGNALS=$enableval],
[ZEND_SIGNALS=yes])
AC_ARG_ENABLE(zend-signals,
[ --disable-zend-signals whether to enable zend signal handling],[
ZEND_SIGNALS=$enableval
],[
ZEND_SIGNALS=yes
])
AC_CHECK_FUNC(sigaction, [
AC_DEFINE(HAVE_SIGACTION, 1, [Whether sigaction() is available])
], [
ZEND_SIGNALS=no
AC_CHECK_FUNCS([sigaction], [], [
ZEND_SIGNALS=no
])
if test "$ZEND_SIGNALS" = "yes"; then
AC_DEFINE(ZEND_SIGNALS, 1, [Use zend signal handling])
@@ -396,21 +327,12 @@ else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(whether /dev/arandom exists)
if test -r "/dev/arandom" && test -c "/dev/arandom"; then
AC_DEFINE([HAVE_DEV_ARANDOM], 1, [Define if the target system has /dev/arandom device])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_ARG_ENABLE([gcc-global-regs],
[AS_HELP_STRING([--disable-gcc-global-regs],
[whether to enable GCC global register variables])],
[ZEND_GCC_GLOBAL_REGS=$enableval],
[ZEND_GCC_GLOBAL_REGS=yes])
AC_ARG_ENABLE(gcc-global-regs,
[ --disable-gcc-global-regs
whether to enable GCC global register variables],[
ZEND_GCC_GLOBAL_REGS=$enableval
],[
ZEND_GCC_GLOBAL_REGS=yes
])
AC_MSG_CHECKING(for global register variables support)
if test "$ZEND_GCC_GLOBAL_REGS" != "no"; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@@ -431,6 +353,9 @@ if test "$ZEND_GCC_GLOBAL_REGS" != "no"; then
#elif defined(__IBMC__) && ZEND_GCC_VERSION >= 4002 && defined(__powerpc64__)
# define ZEND_VM_FP_GLOBAL_REG "r28"
# define ZEND_VM_IP_GLOBAL_REG "r29"
#elif defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(__aarch64__)
# define ZEND_VM_FP_GLOBAL_REG "x27"
# define ZEND_VM_IP_GLOBAL_REG "x28"
#else
# error "global register variables are not supported"
#endif
@@ -460,9 +385,7 @@ else
fi
AC_MSG_RESULT($ZEND_GCC_GLOBAL_REGS)
dnl
dnl Check if atof() accepts NAN
dnl
dnl Check if atof() accepts NAN.
AC_CACHE_CHECK(whether atof() accepts NAN, ac_cv_atof_accept_nan,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <math.h>
@@ -491,9 +414,7 @@ if test "$ac_cv_atof_accept_nan" = "yes"; then
AC_DEFINE([HAVE_ATOF_ACCEPTS_NAN], 1, [whether atof() accepts NAN])
fi
dnl
dnl Check if atof() accepts INF
dnl
dnl Check if atof() accepts INF.
AC_CACHE_CHECK(whether atof() accepts INF, ac_cv_atof_accept_inf,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <math.h>
@@ -525,9 +446,7 @@ if test "$ac_cv_atof_accept_inf" = "yes"; then
AC_DEFINE([HAVE_ATOF_ACCEPTS_INF], 1, [whether atof() accepts INF])
fi
dnl
dnl Check if HUGE_VAL == INF
dnl
dnl Check if HUGE_VAL == INF.
AC_CACHE_CHECK(whether HUGE_VAL == INF, ac_cv_huge_val_inf,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <math.h>
@@ -560,9 +479,7 @@ if test "$ac_cv_huge_val_inf" = "yes"; then
AC_DEFINE([HAVE_HUGE_VAL_INF], 1, [whether HUGE_VAL == INF])
fi
dnl
dnl Check if HUGE_VAL + -HUGEVAL == NAN
dnl
dnl Check if HUGE_VAL + -HUGEVAL == NAN.
AC_CACHE_CHECK(whether HUGE_VAL + -HUGEVAL == NAN, ac_cv_huge_val_nan,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <math.h>
@@ -597,9 +514,7 @@ if test "$ac_cv_huge_val_nan" = "yes"; then
AC_DEFINE([HAVE_HUGE_VAL_NAN], 1, [whether HUGE_VAL + -HUGEVAL == NAN])
fi
dnl
dnl Check whether __cpuid_count is available
dnl
dnl Check whether __cpuid_count is available.
AC_CACHE_CHECK(whether __cpuid_count is available, ac_cv_cpuid_count_available, [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <cpuid.h>
-225
View File
@@ -1,225 +0,0 @@
dnl This file contains local autoconf functions.
AC_DEFUN([LIBZEND_BISON_CHECK],[
# we only support certain bison versions;
# min: 2.4 (i.e. 204, major * 100 + minor for easier comparison)
bison_version_min="204"
# non-working versions, e.g. "3.0 3.2";
# remove "none" when introducing the first incompatible bison version an
# separate any following additions by spaces
bison_version_exclude=""
# for standalone build of Zend Engine
test -z "$SED" && SED=sed
bison_version=none
if test "$YACC"; then
AC_CACHE_CHECK([for bison version], php_cv_bison_version, [
bison_version_vars=`$YACC --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /g' | tr -d a-z`
php_cv_bison_version=invalid
if test -n "$bison_version_vars"; then
set $bison_version_vars
bison_version="${1}.${2}"
bison_version_num="`expr ${1} \* 100 + ${2}`"
if test $bison_version_num -ge $bison_version_min; then
php_cv_bison_version="$bison_version (ok)"
for bison_check_version in $bison_version_exclude; do
if test "$bison_version" = "$bison_check_version"; then
php_cv_bison_version=invalid
break
fi
done
fi
fi
])
fi
case $php_cv_bison_version in
""|invalid[)]
bison_msg="This bison version is not supported for regeneration of the Zend/PHP parsers (found: $bison_version, min: $bison_version_min, excluded: $bison_version_exclude)."
AC_MSG_WARN([$bison_msg])
YACC="exit 0;"
;;
esac
])
AC_DEFUN([ZEND_FP_EXCEPT],[
AC_CACHE_CHECK(whether fp_except is defined, ac_cv_type_fp_except,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <floatingpoint.h>
]],[[
fp_except x = (fp_except) 0;
]])],[
ac_cv_type_fp_except=yes
],[
ac_cv_type_fp_except=no
])])
if test "$ac_cv_type_fp_except" = "yes"; then
AC_DEFINE(HAVE_FP_EXCEPT, 1, [whether floatingpoint.h defines fp_except])
fi
])
dnl
dnl Check for broken sprintf()
dnl
AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[
AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }]])],[
ac_cv_broken_sprintf=no
],[
ac_cv_broken_sprintf=yes
],[
ac_cv_broken_sprintf=no
])
])
if test "$ac_cv_broken_sprintf" = "yes"; then
ac_result=1
else
ac_result=0
fi
AC_DEFINE_UNQUOTED(ZEND_BROKEN_SPRINTF, $ac_result, [Whether sprintf is broken])
])
dnl
dnl AC_ZEND_C_BIGENDIAN
dnl Replacement macro for AC_C_BIGENDIAN
dnl
AC_DEFUN([AC_ZEND_C_BIGENDIAN],
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
[
ac_cv_c_bigendian_php=unknown
AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main(void)
{
short one = 1;
char *cp = (char *)&one;
if (*cp == 0) {
return(0);
} else {
return(1);
}
}
]])], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
])
if test $ac_cv_c_bigendian_php = yes; then
AC_DEFINE(WORDS_BIGENDIAN, 1, [Define if processor uses big-endian word])
fi
])
AC_DEFUN([AM_SET_LIBTOOL_VARIABLE],[
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
])
dnl x87 floating point internal precision control checks
dnl See: http://wiki.php.net/rfc/rounding
AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
AC_MSG_CHECKING([for usable _FPU_SETCW])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <fpu_control.h>
]],[[
fpu_control_t fpu_oldcw, fpu_cw;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
_FPU_GETCW(fpu_oldcw);
fpu_cw = (fpu_oldcw & ~_FPU_EXTENDED & ~_FPU_SINGLE) | _FPU_DOUBLE;
_FPU_SETCW(fpu_cw);
result = a / b;
_FPU_SETCW(fpu_oldcw);
]])],[ac_cfp_have__fpu_setcw=yes],[ac_cfp_have__fpu_setcw=no])
if test "$ac_cfp_have__fpu_setcw" = "yes" ; then
AC_DEFINE(HAVE__FPU_SETCW, 1, [whether _FPU_SETCW is present and usable])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([for usable fpsetprec])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <machine/ieeefp.h>
]],[[
fp_prec_t fpu_oldprec;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
fpu_oldprec = fpgetprec();
fpsetprec(FP_PD);
result = a / b;
fpsetprec(fpu_oldprec);
]])], [ac_cfp_have_fpsetprec=yes], [ac_cfp_have_fpsetprec=no])
if test "$ac_cfp_have_fpsetprec" = "yes" ; then
AC_DEFINE(HAVE_FPSETPREC, 1, [whether fpsetprec is present and usable])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([for usable _controlfp])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <float.h>
]],[[
unsigned int fpu_oldcw;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
fpu_oldcw = _controlfp(0, 0);
_controlfp(_PC_53, _MCW_PC);
result = a / b;
_controlfp(fpu_oldcw, _MCW_PC);
]])], [ac_cfp_have__controlfp=yes], [ac_cfp_have__controlfp=no])
if test "$ac_cfp_have__controlfp" = "yes" ; then
AC_DEFINE(HAVE__CONTROLFP, 1, [whether _controlfp is present usable])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([for usable _controlfp_s])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <float.h>
]],[[
unsigned int fpu_oldcw, fpu_cw;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
_controlfp_s(&fpu_cw, 0, 0);
fpu_oldcw = fpu_cw;
_controlfp_s(&fpu_cw, _PC_53, _MCW_PC);
result = a / b;
_controlfp_s(&fpu_cw, fpu_oldcw, _MCW_PC);
]])], [ac_cfp_have__controlfp_s=yes], [ac_cfp_have__controlfp_s=no])
if test "$ac_cfp_have__controlfp_s" = "yes" ; then
AC_DEFINE(HAVE__CONTROLFP_S, 1, [whether _controlfp_s is present and usable])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([whether FPU control word can be manipulated by inline assembler])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
/* nothing */
]],[[
unsigned int oldcw, cw;
volatile double result;
double a = 2877.0;
volatile double b = 1000000.0;
__asm__ __volatile__ ("fnstcw %0" : "=m" (*&oldcw));
cw = (oldcw & ~0x0 & ~0x300) | 0x200;
__asm__ __volatile__ ("fldcw %0" : : "m" (*&cw));
result = a / b;
__asm__ __volatile__ ("fldcw %0" : : "m" (*&oldcw));
]])], [ac_cfp_have_fpu_inline_asm_x86=yes], [ac_cfp_have_fpu_inline_asm_x86=no])
if test "$ac_cfp_have_fpu_inline_asm_x86" = "yes" ; then
AC_DEFINE(HAVE_FPU_INLINE_ASM_X86, 1, [whether FPU control word can be manipulated by inline assembler])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
])
-41
View File
@@ -1,41 +0,0 @@
# Makefile to generate build tools
#
# Standard usage:
# make -f build.mk
#
# Written by Sascha Schumann
LT_TARGETS = ltmain.sh ltconfig
config_h_in = zend_config.h.in
makefile_am_files = Makefile.am
makefile_in_files = $(makefile_am_files:.am=.in)
makefile_files = $(makefile_am_files:e.am=e)
targets = $(makefile_in_files) $(LT_TARGETS) configure $(config_h_in)
all: $(targets)
clean:
rm -f $(targets)
$(LT_TARGETS):
rm -f $(LT_TARGETS)
libtoolize --automake $(AMFLAGS) -f
$(makefile_in_files): $(makefile_am_files)
automake -a -i $(AMFLAGS) $(makefile_files)
aclocal.m4: configure.ac acinclude.m4
aclocal
$(config_h_in): configure.ac
# explicitly remove target since autoheader does not seem to work
# correctly otherwise (timestamps are not updated)
@rm -f $@
autoheader
configure: aclocal.m4 configure.ac
autoconf
-32
View File
@@ -1,32 +0,0 @@
#!/bin/sh
case "$1" in
--copy)
automake_flags=--copy
shift
;;
esac
libtoolize --force --automake $automake_flags
mv aclocal.m4 aclocal.m4.old 2>/dev/null
aclocal
if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
echo "buildconf: keeping ${1}aclocal.m4"
mv aclocal.m4.old aclocal.m4
else
echo "buildconf: created or modified ${1}aclocal.m4"
fi
autoheader
automake --add-missing --include-deps $automake_flags
mv configure configure.old 2>/dev/null
autoconf
if cmp configure.old configure > /dev/null 2>&1; then
echo "buildconf: keeping ${1}configure"
mv configure.old configure
else
echo "buildconf: created or modified ${1}configure"
fi
-133
View File
@@ -1,133 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(zend.c)
AM_INIT_AUTOMAKE(zend, 0.80A, nodefine)
AM_CONFIG_HEADER(zend_config.h)
AM_SANITY_CHECK
AM_MAINTAINER_MODE
AC_PROG_CC
AM_PROG_CC_STDC
ZEND_VERSION=$VERSION
AC_ZEND_C_BIGENDIAN
AH_TOP([
#if defined(__GNUC__) && __GNUC__ >= 4
# define ZEND_API __attribute__ ((visibility("default")))
# define ZEND_DLEXPORT __attribute__ ((visibility("default")))
#else
# define ZEND_API
# define ZEND_DLEXPORT
#endif
#define ZEND_DLIMPORT
#undef uint
#undef ulong
])
AH_BOTTOM([
#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#if ZEND_BROKEN_SPRINTF
int zend_sprintf(char *buffer, const char *format, ...);
#else
# define zend_sprintf sprintf
#endif
#include <math.h>
#ifndef zend_isnan
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
#else
#define zend_isnan(a) ((a) != (a))
#endif
#endif
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
#else
#define zend_isinf(a) 0
#endif
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
#elif defined(fpclassify)
#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
#else
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
#endif
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
])
dnl We want this one before the checks, so the checks can modify CFLAGS.
test -z "$CFLAGS" && auto_cflags=1
AC_CHECK_SIZEOF(long, 8)
AC_CHECK_SIZEOF(int, 4)
sinclude(Zend.m4)
LIBZEND_BASIC_CHECKS
LIBZEND_LIBDL_CHECKS
LIBZEND_DLSYM_CHECK
AM_PROG_LIBTOOL
if test "$enable_debug" != "yes"; then
AM_SET_LIBTOOL_VARIABLE([--silent])
fi
dnl
dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary
dnl and source packages. This should be harmless on other OSs.
dnl
if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
CFLAGS="$CFLAGS -I/usr/pkg/include"
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
fi
LIBZEND_ENABLE_DEBUG
LIBZEND_OTHER_CHECKS
ZEND_EXTRA_LIBS="$LIBS"
LIBS=""
AC_SUBST(ZEND_EXTRA_LIBS)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
# Local Variables:
# tab-width: 4
# End:
-17
View File
@@ -1,17 +0,0 @@
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2010 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: |
+----------------------------------------------------------------------+
*/
+3 -3
View File
@@ -5,17 +5,17 @@ get_included_files() tests
var_dump(get_included_files());
include(dirname(__FILE__)."/014.inc");
include(__DIR__."/014.inc");
var_dump(get_included_files());
var_dump(get_included_files(1,1));
include_once(dirname(__FILE__)."/014.inc");
include_once(__DIR__."/014.inc");
var_dump(get_included_files());
var_dump(get_included_files(1));
include(dirname(__FILE__)."/014.inc");
include(__DIR__."/014.inc");
var_dump(get_included_files());
echo "Done\n";
+3 -3
View File
@@ -149,9 +149,9 @@ foreach ($array_variables as $array_var) {
var_dump( empty($array_var) ); // expected: bool(true)
}
echo "\n*** Testing unset(), emtpy() & isset() with resource variables ***\n";
echo "\n*** Testing unset(), empty() & isset() with resource variables ***\n";
$fp = fopen(__FILE__, "r");
$dfp = opendir( dirname(__FILE__) );
$dfp = opendir( __DIR__ );
$resources = array (
$fp,
$dfp
@@ -1184,7 +1184,7 @@ bool(false)
bool(false)
bool(true)
*** Testing unset(), emtpy() & isset() with resource variables ***
*** Testing unset(), empty() & isset() with resource variables ***
-- Iteration 1 --
resource(%d) of type (stream)
bool(true)
+10 -4
View File
@@ -16,19 +16,23 @@ var_dump($a->$b->{$c[1]});
?>
--EXPECTF--
Notice: Undefined variable: a in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
NULL
Notice: Undefined variable: %s in %s on line %d
Notice: Undefined variable: a in %s on line %d
Notice: Undefined variable: %s in %s on line %d
Notice: Undefined variable: c in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
NULL
Notice: Undefined variable: a in %s on line %d
int(1)
Notice: Undefined variable: %s in %s on line %d
Notice: Undefined variable: a in %s on line %d
Notice: Undefined variable: %s in %s on line %d
Notice: Undefined variable: b in %s on line %d
int(0)
Notice: Undefined variable: a in %s on line %d
@@ -45,6 +49,8 @@ NULL
Notice: Undefined variable: c in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to get property '1' of non-object in %s on line %d
Notice: Trying to get property '' of non-object in %s on line %d
+31 -1
View File
@@ -19,10 +19,40 @@ $arr[][]->bar = 2;
--EXPECTF--
Notice: Undefined variable: arr in %s on line %d
Notice: Undefined variable: arr in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Undefined variable: arr in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Undefined variable: arr in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to access array offset on value of type null in %s on line %d
Notice: Trying to get property 'foo' of non-object in %s on line %d
Warning: Creating default object from empty value in %s on line %d
+3
View File
@@ -8,6 +8,9 @@ $a{function() { }} = 1;
?>
--EXPECTF--
Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d
Warning: Illegal offset type in %s on line %d
Warning: Illegal offset type in %s on line %d
-2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #67468 (Segfault in highlight_file()/highlight_string())
--SKIPIF--
<?php if(!function_exists("leak")) print "skip only for debug builds"; ?>
--FILE--
<?php
highlight_string("<?php __CLASS__;", true);
+2 -2
View File
@@ -3,12 +3,12 @@ Argument unpacking with many arguments
--FILE--
<?php
function fn(...$args) {
function f(...$args) {
var_dump(count($args));
}
$array = array_fill(0, 10000, 42);
fn(...$array, ...$array);
f(...$array, ...$array);
?>
--EXPECT--
@@ -0,0 +1,41 @@
--TEST--
Appending to an array via unpack may fail
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) die("skip 64bit only"); ?>
--FILE--
<?php
$arr = [1, 2, 3];
var_dump([PHP_INT_MAX-1 => 0, ...$arr]);
var_dump([PHP_INT_MAX-1 => 0, ...[1, 2, 3]]);
const ARR = [1, 2, 3];
const ARR2 = [PHP_INT_MAX-1 => 0, ...ARR];
var_dump(ARR2);
?>
--EXPECTF--
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
array(2) {
[9223372036854775806]=>
int(0)
[9223372036854775807]=>
int(1)
}
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
array(2) {
[9223372036854775806]=>
int(0)
[9223372036854775807]=>
int(1)
}
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
array(2) {
[9223372036854775806]=>
int(0)
[9223372036854775807]=>
int(1)
}
+119
View File
@@ -0,0 +1,119 @@
--TEST--
Basic array unpacking
--FILE--
<?php
$array = [1, 2, 3];
function getArr() {
return [4, 5];
}
function arrGen() {
for($i = 11; $i < 15; $i++) {
yield $i;
}
}
var_dump([...[]]);
var_dump([...[1, 2, 3]]);
var_dump([...$array]);
var_dump([...getArr()]);
var_dump([...arrGen()]);
var_dump([...new ArrayIterator(['a', 'b', 'c'])]);
var_dump([0, ...$array, ...getArr(), 6, 7, 8, 9, 10, ...arrGen()]);
var_dump([0, ...$array, ...$array, 'end']);
--EXPECT--
array(0) {
}
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
array(2) {
[0]=>
int(4)
[1]=>
int(5)
}
array(4) {
[0]=>
int(11)
[1]=>
int(12)
[2]=>
int(13)
[3]=>
int(14)
}
array(3) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(1) "c"
}
array(15) {
[0]=>
int(0)
[1]=>
int(1)
[2]=>
int(2)
[3]=>
int(3)
[4]=>
int(4)
[5]=>
int(5)
[6]=>
int(6)
[7]=>
int(7)
[8]=>
int(8)
[9]=>
int(9)
[10]=>
int(10)
[11]=>
int(11)
[12]=>
int(12)
[13]=>
int(13)
[14]=>
int(14)
}
array(8) {
[0]=>
int(0)
[1]=>
int(1)
[2]=>
int(2)
[3]=>
int(3)
[4]=>
int(1)
[5]=>
int(2)
[6]=>
int(3)
[7]=>
string(3) "end"
}
+46
View File
@@ -0,0 +1,46 @@
--TEST--
Array unpacking with classes
--FILE--
<?php
class C {
public const FOO = [0, ...self::ARR, 4];
public const ARR = [1, 2, 3];
public static $bar = [...self::ARR];
}
class D {
public const A = [...self::B];
public const B = [...self::A];
}
var_dump(C::FOO);
var_dump(C::$bar);
try {
var_dump(D::A);
} catch (Error $ex) {
echo "Exception: " . $ex->getMessage() . "\n";
}
--EXPECT--
array(5) {
[0]=>
int(0)
[1]=>
int(1)
[2]=>
int(2)
[3]=>
int(3)
[4]=>
int(4)
}
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
Exception: Cannot declare self-referencing constant 'self::B'
@@ -0,0 +1,10 @@
--TEST--
Spread operator is not supported in destructuring assignments
--FILE--
<?php
[$head, ...$tail] = [1, 2, 3];
?>
--EXPECTF--
Fatal error: Spread operator is not supported in assignments in %s on line %d
@@ -0,0 +1,17 @@
--TEST--
Array unpacking does not work with non-integer keys
--FILE--
<?php
function gen() {
yield [] => 1;
yield 1.23 => 123;
}
try {
[...gen()];
} catch (Error $ex) {
echo "Exception: " . $ex->getMessage() . "\n";
}
--EXPECT--
Exception: Cannot unpack Traversable with non-integer keys
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Array unpacking with element rc=1
--FILE--
<?php
$a = 1;
$b = [&$a]; //array (0 => (refcount=2, is_ref=1)=1)
unset($a); //array (0 => (refcount=1, is_ref=1)=1)
var_dump([...$b]); //array (0 => (refcount=0, is_ref=0)=1)
--EXPECT--
array(1) {
[0]=>
int(1)
}
+21
View File
@@ -0,0 +1,21 @@
--TEST--
array unpacking with string keys (not supported)
--FILE--
<?php
try {
$array = [1, 2, "foo" => 3, 4];
var_dump([...$array]);
} catch (Error $ex) {
var_dump($ex->getMessage());
}
try {
$iterator = new ArrayIterator([1, 2, "foo" => 3, 4]);
var_dump([...$iterator]);
} catch (Error $ex) {
var_dump($ex->getMessage());
}
--EXPECT--
string(36) "Cannot unpack array with string keys"
string(42) "Cannot unpack Traversable with string keys"
+14
View File
@@ -0,0 +1,14 @@
--TEST--
array unpacking with undefinded variable
--FILE--
<?php
var_dump([...$arr]);
--EXPECTF--
Notice: Undefined variable: arr in %s on line %d
Fatal error: Uncaught Error: Only arrays and Traversables can be unpacked in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
@@ -0,0 +1,10 @@
--TEST--
Unpacking non-array/Traversable detected at compile-time
--FILE--
<?php
var_dump([...42]);
?>
--EXPECTF--
Fatal error: Only arrays and Traversables can be unpacked in %s on line %d
@@ -0,0 +1,10 @@
--TEST--
Unpacking of string keys detected at compile-time
--FILE--
<?php
var_dump([...['a' => 'b']]);
?>
--EXPECTF--
Fatal error: Cannot unpack array with string keys in %s on line %d
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Using array unpacking in an array literal that also has string keys (OSS-Fuzz #17965)
--FILE--
<?php
$y = [1, 2, 3];
$z = "bar";
$x = [...$y, "foo" => $z];
var_dump($x);
?>
--EXPECT--
array(4) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
["foo"]=>
string(3) "bar"
}
+45
View File
@@ -0,0 +1,45 @@
--TEST--
Basic arrow function functionality check
--FILE--
<?php
$foo = fn() => 1;
var_dump($foo());
$foo = fn($x) => $x;
var_dump($foo(2));
$foo = fn($x, $y) => $x + $y;
var_dump($foo(1, 2));
// Closing over $var
$var = 4;
$foo = fn() => $var;
var_dump($foo());
// Not closing over $var, it's a parameter
$foo = fn($var) => $var;
var_dump($foo(5));
// Close over $var by-value, not by-reference
$var = 5;
$foo = fn() => ++$var;
var_dump($foo());
var_dump($var);
// Nested arrow functions closing over variable
$var = 6;
var_dump((fn() => fn() => $var)()());
var_dump((fn() => function() use($var) { return $var; })()());
?>
--EXPECT--
int(1)
int(2)
int(3)
int(4)
int(5)
int(6)
int(5)
int(6)
int(6)
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Arrow functions implicit use must be throwing notices only upon actual use
--FILE--
<?php
$b = 1;
var_dump((fn() => $b + $c)());
?>
--EXPECTF--
Notice: Undefined variable: c in %s on line %d
int(1)
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Variable-variables inside arrow functions
--FILE--
<?php
$a = 1;
$var = "a";
$fn = fn() => $$var;
var_dump($fn());
${5} = 2;
$fn = fn() => ${5};
var_dump($fn());
?>
--EXPECTF--
Notice: Undefined variable: a in %s on line %d
NULL
Notice: Undefined variable: 5 in %s on line %d
NULL
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Auto-globals in arrow functions
--FILE--
<?php
// This should work, but *not* generate a binding for $GLOBALS
$a = 123;
$fn = fn() => $GLOBALS['a'];
var_dump($fn());
?>
--EXPECT--
int(123)
+54
View File
@@ -0,0 +1,54 @@
--TEST--
Arrow function $this binding
--FILE--
<?php
class Test {
public function method() {
// It would be okay if this is NULL, but the rest should work
$fn = fn() => 42;
$r = new ReflectionFunction($fn);
var_dump($r->getClosureThis());
$fn = fn() => $this;
var_dump($fn());
$fn = fn() => Test::method2();
$fn();
$fn = fn() => call_user_func('Test::method2');
$fn();
$thisName = "this";
$fn = fn() => $$thisName;
var_dump($fn());
$fn = fn() => self::class;
var_dump($fn());
// static can be used to unbind $this
$fn = static fn() => isset($this);
var_dump($fn());
}
public function method2() {
var_dump($this);
}
}
(new Test)->method();
?>
--EXPECT--
object(Test)#1 (0) {
}
object(Test)#1 (0) {
}
object(Test)#1 (0) {
}
object(Test)#1 (0) {
}
object(Test)#1 (0) {
}
string(4) "Test"
bool(false)
+44
View File
@@ -0,0 +1,44 @@
--TEST--
Arrow functions syntax variations
--FILE--
<?php
// By-reference argument and return
$var = 1;
$id = fn&(&$x) => $x;
$ref =& $id($var);
$ref++;
var_dump($var);
// int argument and return type
$var = 10;
$int_fn = fn(int $x): int => $x;
var_dump($int_fn($var));
try {
$int_fn("foo");
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
$varargs = fn(?int... $args): array => $args;
var_dump($varargs(20, null, 30));
try {
$varargs(40, "foo");
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECTF--
int(2)
int(10)
Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d
array(3) {
[0]=>
int(20)
[1]=>
NULL
[2]=>
int(30)
}
Argument 2 passed to {closure}() must be of the type int or null, string given, called in %s on line %d
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Pretty printing for arrow functions
--FILE--
<?php
// TODO We're missing parentheses for the direct call
assert((fn() => false)());
assert((fn&(int... $args): ?bool => $args[0])(false));
?>
--EXPECTF--
Warning: assert(): assert(fn() => false()) failed in %s on line %d
Warning: assert(): assert(fn&(int ...$args): ?bool => $args[0](false)) failed in %s on line %d
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Yield inside arrow functions
--FILE--
<?php
// This doesn't make terribly much sense, but it works...
$fn = fn() => yield 123;
foreach ($fn() as $val) {
var_dump($val);
}
$fn = fn() => yield from [456, 789];
foreach ($fn() as $val) {
var_dump($val);
}
$fn = fn() => fn() => yield 987;
foreach ($fn()() as $val) {
var_dump($val);
}
?>
--EXPECT--
int(123)
int(456)
int(789)
int(987)
+2 -2
View File
@@ -94,7 +94,7 @@ L0:
}
}));
assert(0 && ($a = function &(?array &$a, X $b = null) use ($c,&$d) : X {
assert(0 && ($a = function &(array &$a, X $b = null) use ($c,&$d) : X {
class A {
use T1, T2 {
T1::foo insteadof foo;
@@ -244,7 +244,7 @@ Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c,
})) failed in %sexpect_015.php on line %d
Warning: assert(): assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c, &$d): X {
class A {
use T1, T2 {
T1::foo insteadof foo;
+127
View File
@@ -0,0 +1,127 @@
--TEST--
Coalesce assign (??=): Basic behavior
--FILE--
<?php
// Refcounted values
$foo = "fo";
$foo .= "o";
$bar = "ba";
$bar .= "r";
// Identity function used to track single-evaluation
function id($arg) {
echo "id($arg)\n";
return $arg;
}
echo "Simple variables:\n";
$a = 123;
$a ??= 456;
var_dump($a);
$b = null;
$b ??= $foo;
var_dump($b);
$c = $foo;
$c ??= $bar;
var_dump($c);
$d ??= $foo;
var_dump($c);
echo "\nArrays:\n";
$ary = [];
$ary["foo"] ??= 123;
$ary[$foo] ??= $bar;
$ary[$bar] ??= $foo;
var_dump($ary);
$ary = [];
$ary[id($foo)] ??= 123;
$ary[id($foo)] ??= $bar;
$ary[id($bar)] ??= $foo;
var_dump($ary);
echo "\nObjects:\n";
$obj = new stdClass;
$obj->foo ??= 123;
$obj->$foo ??= $bar;
$obj->$bar ??= $foo;
var_dump($obj);
$obj = new stdClass;
$obj->{id($foo)} ??= 123;
$obj->{id($foo)} ??= $bar;
$obj->{id($bar)} ??= $foo;
var_dump($obj);
class Test {
public static $foo;
public static $bar;
}
echo "\nStatic props:\n";
Test::$foo ??= 123;
Test::$$foo ??= $bar;
Test::$$bar ??= $foo;
var_dump(Test::$foo, Test::$bar);
Test::$foo = null;
Test::$bar = null;
Test::${id($foo)} ??= 123;
Test::${id($foo)} ??= $bar;
Test::${id($bar)} ??= $foo;
var_dump(Test::$foo, Test::$bar);
?>
--EXPECT--
Simple variables:
int(123)
string(3) "foo"
string(3) "foo"
string(3) "foo"
Arrays:
array(2) {
["foo"]=>
int(123)
["bar"]=>
string(3) "foo"
}
id(foo)
id(foo)
id(bar)
array(2) {
["foo"]=>
int(123)
["bar"]=>
string(3) "foo"
}
Objects:
object(stdClass)#1 (2) {
["foo"]=>
int(123)
["bar"]=>
string(3) "foo"
}
id(foo)
id(foo)
id(bar)
object(stdClass)#2 (2) {
["foo"]=>
int(123)
["bar"]=>
string(3) "foo"
}
Static props:
int(123)
string(3) "foo"
id(foo)
id(foo)
id(bar)
int(123)
string(3) "foo"
+84
View File
@@ -0,0 +1,84 @@
--TEST--
Coalesce assign (??=): Exception handling
--FILE--
<?php
$foo = "fo";
$foo .= "o";
$bar = "ba";
$bar .= "r";
function id($arg) {
echo "id($arg)\n";
return $arg;
}
function do_throw($msg) {
throw new Exception($msg);
}
$ary = [];
try {
$ary[id($foo)] ??= do_throw("ex1");
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
var_dump($ary);
class AA implements ArrayAccess {
public function offsetExists($k) {
return true;
}
public function &offsetGet($k) {
$var = ["foo" => "bar"];
return $var;
}
public function offsetSet($k,$v) {}
public function offsetUnset($k) {}
}
class Dtor {
public function __destruct() {
throw new Exception("dtor");
}
}
$ary = new AA;
try {
$ary[new Dtor][id($foo)] ??= $bar;
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
var_dump($foo);
class AA2 implements ArrayAccess {
public function offsetExists($k) {
return false;
}
public function offsetGet($k) {
return null;
}
public function offsetSet($k,$v) {}
public function offsetUnset($k) {}
}
$ary = ["foo" => new AA2];
try {
$ary[id($foo)][new Dtor] ??= $bar;
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
var_dump($foo);
?>
--EXPECT--
id(foo)
ex1
array(0) {
}
id(foo)
dtor
string(3) "foo"
id(foo)
dtor
string(3) "foo"
+70
View File
@@ -0,0 +1,70 @@
--TEST--
Coalesce assign (??=): ArrayAccess handling
--FILE--
<?php
function id($arg) {
echo "id($arg)\n";
return $arg;
}
class AA implements ArrayAccess {
public $data;
public function __construct($data = []) {
$this->data = $data;
}
public function &offsetGet($k) {
echo "offsetGet($k)\n";
return $this->data[$k];
}
public function offsetExists($k) {
echo "offsetExists($k)\n";
return array_key_exists($k, $this->data);
}
public function offsetSet($k,$v) {
echo "offsetSet($k,$v)\n";
$this->data[$k] = $v;
}
public function offsetUnset($k) { }
}
$ary = new AA(["foo" => new AA, "null" => null]);
echo "[foo]\n";
$ary["foo"] ??= "bar";
echo "[bar]\n";
$ary["bar"] ??= "foo";
echo "[null]\n";
$ary["null"] ??= "baz";
echo "[foo][bar]\n";
$ary["foo"]["bar"] ??= "abc";
echo "[foo][bar]\n";
$ary["foo"]["bar"] ??= "def";
?>
--EXPECT--
[foo]
offsetExists(foo)
offsetGet(foo)
[bar]
offsetExists(bar)
offsetSet(bar,foo)
[null]
offsetExists(null)
offsetGet(null)
offsetSet(null,baz)
[foo][bar]
offsetExists(foo)
offsetGet(foo)
offsetExists(bar)
offsetGet(foo)
offsetSet(bar,abc)
[foo][bar]
offsetExists(foo)
offsetGet(foo)
offsetExists(bar)
offsetGet(bar)
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Coalesce assign (??=): Non-writable variable
--FILE--
<?php
function foo() { return 123; }
foo() ??= 456;
?>
--EXPECTF--
Fatal error: Can't use function return value in write context in %s on line %d
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Coalesce assign (??=): Cannot reassign $this
--FILE--
<?php
class Test {
public function foobar() {
$this ??= 123;
}
}
?>
--EXPECTF--
Fatal error: Cannot re-assign $this in %s on line %d
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Null coalesce assign with memoized constant operand that is later interned (OSS-Fuzz #17903)
--FILE--
<?php
$foo[__DIR__] ??= 42;
var_dump($foo);
?>
--EXPECTF--
array(1) {
["%s"]=>
int(42)
}
@@ -0,0 +1,20 @@
--TEST--
Assign result of by-value function to object property by-reference
--FILE--
<?php
function notRef() {
return null;
}
$obj = new stdClass;
$obj->prop =& notRef();
var_dump($obj);
?>
--EXPECTF--
Notice: Only variables should be assigned by reference in %s on line %d
object(stdClass)#1 (1) {
["prop"]=>
NULL
}
@@ -1,5 +1,5 @@
--TEST--
If the LHS of ref-assign ERRORs, that takes precendence over the "only variables" notice
If the LHS of ref-assign ERRORs, that takes precedence over the "only variables" notice
--FILE--
<?php
+1 -1
View File
@@ -1,5 +1,5 @@
--TEST--
assgin to object leaks with ref
assign to object leaks with ref
--FILE--
<?php
function &a($i) {
+2 -1
View File
@@ -12,7 +12,8 @@ var_dump($var1);
echo "Done\n";
?>
--EXPECT--
--EXPECTF--
Notice: Trying to access array offset on value of type float in %s on line %d
NULL
NULL
Done
+3 -3
View File
@@ -15,7 +15,7 @@ class debugfilter extends php_user_filter {
stream_filter_register("myfilter","debugfilter");
$fp = fopen(dirname(__FILE__)."/test.txt","w");
$fp = fopen(__DIR__."/test.txt","w");
stream_filter_append($fp, "myfilter");
stream_filter_append($fp, "myfilter");
stream_filter_append($fp, "myfilter");
@@ -24,8 +24,8 @@ print "Done.\n";
fclose($fp);
// Uncommenting the following 'print' line causes the segfault to stop occurring
// print "2\n";
readfile(dirname(__FILE__)."/test.txt");
unlink(dirname(__FILE__)."/test.txt");
readfile(__DIR__."/test.txt");
unlink(__DIR__."/test.txt");
?>
--EXPECT--
Done.
+11 -14
View File
@@ -31,12 +31,6 @@ echo $o;
echo "===NONE===\n";
function my_error_handler($errno, $errstr, $errfile, $errline) {
var_dump($errstr);
}
set_error_handler('my_error_handler');
class NoneTest
{
function __toString() {
@@ -44,7 +38,11 @@ class NoneTest
}
$o = new NoneTest;
echo $o;
try {
echo $o;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
echo "===THROW===\n";
@@ -58,17 +56,16 @@ class ErrorTest
$o = new ErrorTest;
try {
echo $o;
}
catch (Exception $e) {
echo "Got the exception\n";
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
?>
===DONE===
--EXPECTF--
--EXPECT--
Hello World!
===NONE===
string(%d) "Method NoneTest::__toString() must return a string value"
Method NoneTest::__toString() must return a string value
===THROW===
Fatal error: Method ErrorTest::__toString() must not throw an exception, caught Exception: This is an error! in %sbug26166.php on line %d
This is an error!
===DONE===
Loaded 100 of 8122 files, more files were not shown because too many files have changed in this diff. Show more