Compare commits

..
173 Commits
Author SHA1 Message Date
Anatol Belski f79b879c38 set versions 2017-08-01 11:14:27 +02:00
Anatol Belski 355e1831c3 fix typo 2017-07-18 12:02:02 +02:00
Anatol Belski 554db3159d set versions 2017-07-18 10:30:46 +02:00
Anatol Belski 4ef9f536ba fix missing var for phpize
(cherry picked from commit 36c3d71407)
2017-07-17 19:38:50 +02:00
Peter Kokot 4d08b9dac0 Fixed bug #74906 redirecting incorrect include <sys/errno.h> 2017-07-17 06:54:27 +01:00
Peter Kokot 0db20a7cb1 Fixed bug 74913 redirecting incorrect include <sys/poll.h> 2017-07-17 06:50:59 +01:00
Christopher Jones c1504b81d3 Bump OCI8 version for recent patch 2017-07-14 14:13:08 +10:00
Anatol Belski 2f606dc5e8 Guard against AppVeyor losing deps issue
Possibly due to concurrent build cache updates or some changes in
the remote image. Some locking mechanism still could be required.
2017-07-12 15:37:40 +02:00
Anatol Belski 04cc2f6473 increase poll timeout as false positives mitigation 2017-07-12 14:38:12 +02:00
Anatol Belski 3bcab31749 update NEWS 2017-07-10 22:49:55 +02:00
Anatol Belski b47cff48de switch to next binary tools sdk version 2017-07-10 21:44:43 +02:00
Anatol Belski a797421e98 Revert "Add more constants, improve comments, and add tests"
This reverts commit 0c4f11ecaa.
2017-07-10 16:53:56 +02:00
Pedro Magalhães 2689917b17 #73594 tests only check the extra params if dns_get_record is successful 2017-07-10 06:55:31 +01:00
jhdxr 5cf54f6073 Fixed bug #74852 (property_exists returns true on unknown DateInterval property) 2017-07-10 06:53:22 +01:00
Anatol Belski 62700f76cb [ci skip] update NEWS 2017-07-09 15:01:37 +02:00
Anatol Belski b5338c0b7d Fixed bug #74883 SQLite3::__construct() produces "out of memory" exception with invalid flags 2017-07-08 23:52:22 +02:00
Anatol Belski 0fdceb6cd5 update libs versions 2017-07-08 13:41:50 +02:00
Christopher Jones 5ca02ca494 Fix NEWS entry location 2017-07-07 12:13:21 +10:00
Ferenc Kovacs af07b76ccf Merge branch 'PHP-5.6' into PHP-7.0 2017-07-06 00:12:05 +02:00
Ferenc Kovacs 390f64701d add missing NEWS entry for #74087 and also fix the formatting 2017-07-06 00:10:07 +02:00
Ferenc Kovacs 7991a88675 move NEWS entry to the correct place, also bump the version 2017-07-06 00:05:14 +02:00
Anatol Belski aa3fceeaad [ci skip] sync NEWS 2017-07-05 12:31:21 +02:00
Remi Collet 8b1559b9f4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  NEWS for oniguruma
  Patch from the upstream git https://github.com/kkos/oniguruma/issues/60 (CVE-2017-9228)
  Patch from the upstream git https://github.com/kkos/oniguruma/issues/59 (CVE-2017-9229) b690371bbf97794b4a1d3f295d4fb9a8b05d402d Modified for onig 5.9.6
  Patch from the upstream git https://github.com/kkos/oniguruma/issues/58 (CVE-2017-9227)
  Patch from the upstream git https://github.com/kkos/oniguruma/issues/57 (CVE-2017-9224)
  Patch from the upstream git https://github.com/kkos/oniguruma/issues/55 (CVE-2017-9226) b4bf968ad52afe14e60a2dc8a95d3555c543353a Modified for onig 5.9.6 f015fbdd95f76438cd86366467bb2b39870dd7c6 Modified for onig 5.9.6
2017-07-05 10:02:21 +02:00
Remi Collet 55b880070c NEWS for oniguruma 2017-07-05 09:26:55 +02:00
Remi Collet 703be4f77e Patch from the upstream git
https://github.com/kkos/oniguruma/issues/60 (CVE-2017-9228)

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-07-05 09:26:06 +02:00
Remi Collet 27a743b82b Patch from the upstream git
https://github.com/kkos/oniguruma/issues/59 (CVE-2017-9229)
b690371bbf97794b4a1d3f295d4fb9a8b05d402d Modified for onig 5.9.6

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-07-05 09:25:57 +02:00
Remi Collet bdf7393ddb Patch from the upstream git
https://github.com/kkos/oniguruma/issues/58 (CVE-2017-9227)

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-07-05 09:25:49 +02:00
Remi Collet 2693e52113 Patch from the upstream git
https://github.com/kkos/oniguruma/issues/57 (CVE-2017-9224)

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-07-05 09:25:39 +02:00
Remi Collet 4e68b2c52b Patch from the upstream git
https://github.com/kkos/oniguruma/issues/55 (CVE-2017-9226)
b4bf968ad52afe14e60a2dc8a95d3555c543353a Modified for onig 5.9.6
f015fbdd95f76438cd86366467bb2b39870dd7c6 Modified for onig 5.9.6

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-07-05 09:25:27 +02:00
Stanislav Malyshev 54840f9c8f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Improve fix for #74145
2017-07-04 21:11:15 -07:00
Stanislav Malyshev f269cdcd4f Improve fix for #74145 2017-07-04 21:10:08 -07:00
Stanislav Malyshev f76a6cd023 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix tests
2017-07-04 21:05:06 -07:00
Stanislav Malyshev 6b18d956de Fix wddx 2017-07-04 20:19:34 -07:00
Stanislav Malyshev e46d589624 Fix tests 2017-07-04 20:12:57 -07:00
Stanislav Malyshev 0496f5407f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Update NEWS
  Fix bug #74087
  Fixed parsing of strange formats with mixed month/day and time strings
  Fix bug #74145 - wddx parsing empty boolean tag leads to SIGSEGV
  Fixed bug #74111
  Fix #74435: Buffer over-read into uninitialized memory
  Fix bug #74603 - use correct buffer size
  Fix bug #74651 - check EVP_SealInit as it can return -1
  Update NEWS
  Fix bug #73807
2017-07-04 19:44:51 -07:00
Nikita Popov 3a25a56a92 Fixed bug #74111 2017-07-04 19:38:42 -07:00
Stanislav Malyshev 0525574913 Fix bug #74603 - use correct buffer size 2017-07-04 19:35:56 -07:00
Stanislav Malyshev 73cabfedf5 Fix bug #74651 - check EVP_SealInit as it can return -1 2017-07-04 19:30:56 -07:00
Stanislav Malyshev 12107d619b Update NEWS 2017-07-04 19:30:29 -07:00
Stanislav Malyshev f7f4fd4706 Fix bug #74087
Ported from https://vcs.pcre.org/pcre/code/trunk/pcre_jit_compile.c?r1=1676&r2=1680&view=patch
2017-07-04 19:21:28 -07:00
Derick Rethans e8b7698f5e Fixed parsing of strange formats with mixed month/day and time strings 2017-07-04 19:19:30 -07:00
Stanislav Malyshev 2aae60461c Fix bug #74145 - wddx parsing empty boolean tag leads to SIGSEGV 2017-07-04 19:06:42 -07:00
Nikita Popov f8c514ba6b Fixed bug #74111 2017-07-04 19:06:16 -07:00
Christoph M. Becker 8dc4f4dc9e Fix #74435: Buffer over-read into uninitialized memory
The stack allocated color map buffers were not zeroed before usage, and
so undefined palette indexes could cause information leakage.
2017-07-04 19:00:57 -07:00
Stanislav Malyshev 5f8380d33e Fix bug #74603 - use correct buffer size 2017-07-04 19:00:03 -07:00
Stanislav Malyshev 89637c6b41 Fix bug #74651 - check EVP_SealInit as it can return -1 2017-07-04 12:32:06 -07:00
Remi Collet 4b38feabe7 Adapt for 32-bits which fails at different offset (49 vs 38) 2017-07-04 20:25:59 +02:00
Anatol Belski a29264eb8c fix datatype 2017-07-04 16:37:17 +02:00
Anatol Belski 4903f044d3 [ci skip] sync NEWS 2017-07-04 12:12:51 +02:00
Anatol Belski ce64b82ebb update NEWS 2017-07-04 11:29:00 +02:00
Nikita Popov d02f953faf Fixed bug #74101 and bug #74614 2017-07-04 10:39:41 +02:00
Anatol Belski d0b7eed0c9 yet one C++ compat fix 2017-07-01 20:05:11 +02:00
Anatol Belski c71b773a62 fix C++ compat 2017-07-01 18:36:43 +02:00
Bob Weinand e3cc15daf2 Fixed bug #74840 (Opcache overwrites argument of GENERATOR_RETURN within finally) 2017-07-01 11:52:03 +02:00
Julien Pauli 2a1ad88538 Updated NEWS 2017-06-29 20:23:37 +02:00
Julien Pauli 3f4340a796 Fix bug #74832, crash in extension loading 2017-06-29 20:22:21 +02:00
Adam Baratz 08089f014c Fixed #69356: PDOStatement::debugDumpParams() truncates query 2017-06-29 11:39:50 +02:00
George Wang 751d19f698 [BUGFIX] fixes the issue that a value from .user.ini displays in phpinfo(), but not applies.
[BUGFIX] when lsapi used the php_value has higher priority then ini_set when called from the script by itself .
2017-06-27 23:14:36 -04:00
Nikita Popov 604827b694 Fixed bug #73173
Patch by tloi at fortinet dot com.
2017-06-25 20:17:06 +02:00
Bob Weinand cfee5116dd Expose inflate_get_status() and inflate_get_read_len() functions 2017-06-25 20:12:45 +02:00
Matthew Trescott 0c4f11ecaa Add more constants, improve comments, and add tests 2017-06-25 20:12:45 +02:00
Nikita Popov 2fddc4a7f1 Fixed bug #73900 2017-06-25 19:48:17 +02:00
Nikita Popov de66e80d75 Don't leave holes in func_get_args() and backtraces
Argument lists should always be continuous and hole-free, even if
local variables are unset. Replace UNDEF values with NULLs.
2017-06-25 15:27:45 +02:00
Bob Weinand fda0a8b735 Fixed bug #73944 (inflate_init() dictionary option) - add NEWS entry 2017-06-25 10:57:36 +02:00
wapmorgan cd1869bcf2 Remove invalid check of dictionary content and add initialization of dictionary if raw compression used 2017-06-25 10:53:28 +02:00
Stanislav Malyshev 3eecee16d1 Update NEWS 2017-06-24 23:32:59 -07:00
ideal 4d6100569b Fix error if compiled without -fpermissive flag. 2017-06-23 13:31:23 +02:00
danchukas b255b97e43 fix method "eof"
replace "eof" with  "feof"
because:
1) http://php.net/manual/ru/function.feof.php
2) Error: Call to undefined function eof()
2017-06-23 07:53:00 +01:00
Thomas Punt b1301a0686 Remove superfluous branch 2017-06-23 07:51:32 +01:00
Peter Kokot 660250f4da Fix configure error
This patch fixes configure error on some systems such as Alpine.

```
 line 3472: test: =: unary operator expected
```

One of the fixes has been suggested also here already:
https://bugs.php.net/bug.php?id=39835

Thank you for considering merging this.
2017-06-22 14:01:18 +01:00
jhdxr 81c2a4b9ba fix bug #73471 PHP freezes with AppendIterator 2017-06-22 11:56:49 +01:00
jhdxr db287b2303 fix bug #74780 parse_url() borken when query string contains colon 2017-06-22 11:52:06 +01:00
Christopher Jones b3bd379198 Merge branch 'pull-request/2532' into PHP-7.0
* pull-request/2532:
  Add bug #74625 to package.xml
  Add IN bind case to bug74625.phpt
  Fixed bug #74625 (Integer overflow in oci_bind_array_by_name).
2017-06-21 15:55:28 +10:00
Christopher Jones cda87977a5 Add bug #74625 to package.xml 2017-06-21 15:50:51 +10:00
Christopher Jones b4c5f20c46 Add IN bind case to bug74625.phpt 2017-06-21 15:47:32 +10:00
Ingmar Runge fa3615f14e Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). 2017-06-21 15:44:55 +10:00
Christopher Jones 3fbbcf7f93 Remove use of obsolete create_function() 2017-06-21 15:02:58 +10:00
Christopher Jones 1bdc290017 Update OCI8 version test and package.xml 2017-06-21 14:29:30 +10:00
Stanislav Malyshev 18b6de7a91 Fix bug #73634 - grapheme_strpos illegal memory access 2017-06-20 13:29:57 -07:00
Stanislav Malyshev 14c422a32f Fix bug #73648 - integer overflow in substr 2017-06-20 13:29:48 -07:00
Anatol Belski 6a854e2740 Split requested size as expected by CreateFileMapping.
Thus fixing ext\opcache\tests\log_verbosity_bug.phpt fails on 64-bit.
2017-06-20 15:40:25 +02:00
Anatol Belski b4fa2ba295 move next 2017-06-20 14:05:50 +02:00
Nikita Popov 0f8cf3b849 Fix bug #73807 2017-06-20 00:23:44 -07:00
Christopher Jones 27d6814351 PDO_OCI: support IC 12.2 in configure option 2017-06-20 16:00:22 +10:00
Christopher Jones 64447030bb Bump OCI8 version 2017-06-20 14:54:45 +10:00
Christopher Jones 073ac50374 Merge branch 'pull-request/1569' into PHP-7.0
* pull-request/1569:
  add test for bug #70700
2017-06-20 14:43:50 +10:00
Chuck Burgess 98bcc0bd43 add test for bug #70700 2017-06-20 14:43:20 +10:00
Christopher Jones 135265ef69 Update NEWS 2017-06-20 14:37:16 +10:00
Christopher Jones ec6ac50812 Merge branch 'pull-request/2459' into PHP-7.0
* pull-request/2459:
  oci8 - Implementation of Oracle TAF Callback
2017-06-20 14:33:06 +10:00
KoenigsKind 1b797f7ad3 oci8 - Implementation of Oracle TAF Callback
Adds support for the Transparent Application Failover Callback.
The php_oci_connection struct got a char* added which will contain the
callback function, it should be set to PHP_OCI_TAF_DISABLE_CALLBACK at
the end of a php request for permanent connections so that, if a TAF
callback occurs, no userspace function will be called.
Maybe add support for registering object functions (via array),
currently the register function only accepts a string. I didn't know how
to implement it correctly. As a failover occurs very rarely it might be
better to not keep the cache when saving the zend_fcall_info.

Things to do
[ ] config.m4 needs to compile oci8_failover.c
[ ] Check if correctly implemented (especially for multithreading)
[ ] Add support for registering callback function via array
2017-06-20 14:32:52 +10:00
Christopher Jones a6c67a088a Merge branch 'pull-request/1566' into PHP-7.0
* pull-request/1566:
  add test for bug #60994
2017-06-20 14:23:20 +10:00
Chuck Burgess 51a7e35c24 add test for bug #60994 2017-06-20 14:22:28 +10:00
Jelle van der Waa 509f5097ab openssl: Add openssl_pkcs12_(read, export) tests
Add basic tests for openssl_pkcs12_read and openssl_pkcs12_export.
openssl_pkcs12_export has two tests disable which currently do not work
as intended and should be fixed.
2017-06-18 19:02:51 +01:00
Jakub Zelenka 887fabe78f Regenerate and bump re2c version to 0.16
It also matches the re2c version for Zend language scanner
2017-06-18 18:26:48 +01:00
Anatol Belski 4a39d33ee5 Next round on AppVeyor reliability. 2017-06-17 01:57:47 +02:00
Jelle van der Waa f19dfac830 openssl: Fix spkstr and spki leak in openssl_spki_new
spkstr is not free'd when running the test and valgrind reports a leak
of 32,318 bytes. The free condition is not met since keyresource is not
NULL, apart from that OPENSSL_free actually free's the allocated memory
by OPENSSL_malloc inside OpenSSL.

Valgrind reports 768 bytes leaked in openssl_spki_new when running the
testsuite. Remove the keyresource check to always free spki.
2017-06-16 16:51:50 +01:00
Dmitry Stogov 648be8600f Fixed bug #74679 (Incorrect conversion array with WSDL_CACHE_MEMORY) 2017-06-13 17:15:47 +03:00
Remi Collet c4d7cfa536 NEWS 2017-06-13 08:50:02 +02:00
Remi Collet 78970d5338 Fix bug #74705 for collator_get_sort_key 2017-06-13 08:48:17 +02:00
Tyson Andre 5f07a895cc Fixes bug #74705 Wrong ReflectionInfo for Collator::getSortKey()
https://secure.php.net/manual/en/collator.getsortkey.php
2017-06-13 08:46:47 +02:00
Remi Collet aea8c6ddc1 NEWS 2017-06-13 08:14:34 +02:00
Tyson Andre 81b2533a68 Fixes bug #74708 reflection signatures for random_bytes+random_int
They have 1 and 2 required parameters, respectively
See https://secure.php.net/manual/en/function.random-int.php
2017-06-13 08:11:25 +02:00
Xinchen Hui 3968ffe7b3 Forgotten NEWs update 2017-06-13 12:20:42 +08:00
Xinchen Hui e05f79c3de Merge branch 'bug74600' of https://github.com/manuelm/php-src into PHP-7.0
* 'bug74600' of https://github.com/manuelm/php-src:
  Add simple cli test for PATH/HOST ini sections
  Fixed bug #74600
2017-06-12 17:12:15 +08:00
Manuel Mausz 91f129ebf7 Add simple cli test for PATH/HOST ini sections 2017-06-09 23:28:19 +02:00
Christoph M. Becker c3b910370c Use reasonable SQLite3 module version
Since PECL/sqlite3 has been moved to ext/sqlite3 in 2008, the SQLite3
module version is hardcoded to `0.7-dev`. It doesn't appear to make
much sense to have an own module version for a bundled extensions, but
as other code might rely on it, we don't remove the constant but rather
make it an alias of the PHP version.
2017-06-09 13:49:32 +02:00
Manuel Mausz ee0e6963f3 Fixed bug #74600
Make sure the hash entry is an array.

The origin fix broke support for HOST/PATH ini sections. Only the
beginning of the string has to match. Revert this check but use
zend_binary_strncasecmp instead of strncasecmp.
2017-06-09 01:43:08 +02:00
Anatol Belski 9997767dc3 enforce exit status propagation and up the sdk version 2017-06-08 17:14:52 +02:00
Jakub Zelenka 3704947696 Replace ASN1_STRING_data with ASN1_STRING_get0_data
This is a slightly modified version of the patch from Jelle van der Waa
( @jelly ) so full credit to him.
2017-06-04 18:08:51 +01:00
Nikita Popov 585c9f3c4b Fix leak in WDDX serialization 2017-06-03 15:08:42 +02:00
Tim Toohey d027bc2add Fixed bug #69373
xmlNodeSetContentLen() calls xmlFreeNode() on node->children. This
causes problems if there are other references around to those children.
2017-06-03 00:40:58 +02:00
libnex 95c4564f93 Fixed bug #73473: Stack Buffer Overflow in msgfmt_parse_message 2017-06-03 00:05:16 +02:00
Xinchen Hui 9c5717d0de Fixed bug #74673 (Segfault when cast Reflection object to string with undefined constant) 2017-05-31 12:39:26 +08:00
Dmitry Stogov 77cbf8a657 Fixed wrong condition 2017-05-31 00:40:33 +03:00
Côme Bernigaud dc7e53690f Merge branch 'pull-request/2536' into PHP-7.0
* pull-request/2536:
  ext/ldap/test: Test that ldap_connect() uses defaults from ldap.conf (openldap)
  ext/ldap: Allow default host from ldap.conf to work.
2017-05-30 16:45:27 +02:00
Remi Collet 46bb35a853 NEWS 2017-05-30 15:45:09 +02:00
Remi Collet 1c845d2950 Patch from the upstream git
https://github.com/kkos/oniguruma/issues/60 (CVE-2017-9228)

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-05-30 15:40:32 +02:00
Remi Collet 5416deec66 Patch from the upstream git
https://github.com/kkos/oniguruma/issues/59 (CVE-2017-9229)
b690371bbf97794b4a1d3f295d4fb9a8b05d402d Modified for onig 5.9.6

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-05-30 15:39:21 +02:00
Remi Collet 6a8ae7cf8d Patch from the upstream git
https://github.com/kkos/oniguruma/issues/58 (CVE-2017-9227)

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-05-30 15:38:17 +02:00
Remi Collet 60b1829e1c Patch from the upstream git
https://github.com/kkos/oniguruma/issues/57 (CVE-2017-9224)

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-05-30 15:37:11 +02:00
Remi Collet 1e0c4386ab Patch from the upstream git
https://github.com/kkos/oniguruma/issues/55 (CVE-2017-9226)
b4bf968ad52afe14e60a2dc8a95d3555c543353a Modified for onig 5.9.6
f015fbdd95f76438cd86366467bb2b39870dd7c6 Modified for onig 5.9.6

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-05-30 15:35:42 +02:00
Fabien Villepinte 2dee44c74c Fix Bug #74386 Phar::__construct(): wrong number of parameters by reflection 2017-05-29 08:29:30 +01:00
Sara Golemon 8dcfec9789 Bugfix #74556 stream_socket_get_name() returns empty string
The original bug report had it returning '\0',
but with a fix to abstract name handling (6d2d0bbda7)
it now actually returns ''.

Neither of these are good, as per unix(7)
an empty socket name indicates an unbound name
and "should not be inspected".
2017-05-28 08:48:18 -07:00
Sara Golemon 6d2d0bbda7 Fix abstract name handling to be binary safe
Per unix(7):
abstract: an abstract socket address is distinguished (from a
pathname socket) by the fact that sun_path[0] is a null byte
('\0').  The socket's address in this namespace is given by the
additional bytes in sun_path that are covered by the specified
length of the address structure.  (Null bytes in the name have no
special significance.)  The name has no connection with filesystem
pathnames.  When the address of an abstract socket is returned,
the returned addrlen is greater than sizeof(sa_family_t) (i.e.,
greater than 2), and the name of the socket is contained in the
first (addrlen - sizeof(sa_family_t)) bytes of sun_path.

The existing implementation was assuming significance in null bytes
contained in the abstract address identifier.
2017-05-28 08:45:44 -07:00
Sara Golemon 05849a242a Bugfix #74598 ftp:// ignores context 2017-05-27 21:12:49 -07:00
Xinchen Hui 60912e66c8 Fixed bug #74663 (Segfault with opcache.memory_protect and validate_timestamp) 2017-05-27 22:42:27 +08:00
Xinchen Hui ece7d223e8 Correct the location 2017-05-27 12:11:53 +08:00
Xinchen Hui 5269c4cacb Fixed bug #74657 (Undefined constants in array properties result in broken properties) 2017-05-27 12:06:43 +08:00
David Caldwell 49d1cdc393 ext/ldap/test: Test that ldap_connect() uses defaults from ldap.conf (openldap) 2017-05-25 21:27:11 +00:00
David Caldwell d51b8f915f ext/ldap: Allow default host from ldap.conf to work.
This fixes an regression introduced in
e7af0fe1eb. Previously, calling
ldap_connect() with no parameters would pass NULL to ldap_init(),
which causes it to use the default host specified in
/etc/ldap/ldap.conf (on Ubuntu).

When the code changed to use ldap_initialize(), it initialized a uri,
even if there were no parameters passed to ldap_connect(). Because of
this, there's no way to pass a NULL into ldap_initialize(), making it
impossible to use the default uri from ldap.conf.

This commit bypasses the uri creation when there is no host argument,
passing on a NULL to ldap_initialize() which restores the old PHP 5.5
behavior.
2017-05-25 00:47:11 +00:00
jhdxr 872e43d6e5 Fixed bug #74478 2017-05-24 18:01:41 +02:00
Anatol Belski fff1cab367 time to move next 2017-05-23 12:31:03 +02:00
Anatol Belski c4ae856912 move to the next sdk version for AppVeyor 2017-05-20 13:48:35 +02:00
Anatol Belski 464c1639ae follow up fix on bug #74022 2017-05-18 12:03:13 +02:00
Xinchen Hui 0954ea8d6d Added cleanup 2017-05-17 23:24:58 +08:00
Xinchen Hui ef09bc0645 Added test for bug #74600 2017-05-17 23:21:18 +08:00
Xinchen Hui e347b2ded6 Added test for bug #74596 2017-05-17 22:42:18 +08:00
Xinchen Hui 8a1713e39c Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  variation of icu libraries causes failure
2017-05-16 19:32:33 +08:00
Xinchen Hui 9f49ebb5ba Fixed bug #74600 (crash (SIGSEGV) in _zend_hash_add_or_update_i) 2017-05-16 19:32:13 +08:00
Steve Walk d74fbfb38f variation of icu libraries causes failure 2017-05-16 12:46:27 +02:00
Xinchen Hui 89dd7fb328 Fixed bug #74596 (SIGSEGV with opcache.revalidate_path enabled)
Yeah, no test script is provided.. I got some troubles to make a one
2017-05-16 13:22:08 +08:00
Anatol Belski 777929b1ae switch to Postgres 9.6 for appveyor 2017-05-15 17:47:41 +02:00
Sara Golemon b8e0351978 Remove typo from test header 2017-05-10 16:50:19 -07:00
Xinchen Hui 1b22e9dc2e Fixed tests when using cumstom php.ini(session.save_handler) 2017-05-09 11:13:41 +08:00
Xinchen Hui d40a852919 Merge branch 'fix_74541' of https://github.com/villfa/php-src into PHP-7.0
* 'fix_74541' of https://github.com/villfa/php-src:
  Fix Bug #74541 Wrong reflection on session_start()
2017-05-09 11:04:39 +08:00
Xinchen Hui 99549ce79c Merge branch 'patch-1' of https://github.com/ifdattic/php-src into PHP-7.0
* 'patch-1' of https://github.com/ifdattic/php-src:
  Fix typo: exectute => execute
2017-05-09 11:01:33 +08:00
Fabien Villepinte b39c70b4a7 Fix Bug #74541 Wrong reflection on session_start() 2017-05-08 22:42:09 +02:00
Anatol Belski 1a06fae543 sync bin sdk version 2017-05-08 19:38:48 +02:00
Anatol Belski ca870dfee7 [ci skip] update libs versions file 2017-05-08 13:10:13 +02:00
Andrew Marcinkevičius abad134681 Fix typo: exectute => execute 2017-05-08 13:59:05 +03:00
Xinchen Hui b966a8b5fa Fixed another potential dangling pointer 2017-05-08 11:36:07 +08:00
Xinchen Hui 87d56a3d07 Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER()) 2017-05-08 11:32:08 +08:00
Anatol Belski 5c957b502e [ci skip] update NEWS 2017-05-07 13:04:21 +02:00
Anatol Belski 561f1afe6e Fixed bug #74547 mysqli::change_user() doesn't accept null as $database argument w/strict_types 2017-05-06 15:06:34 +02:00
Anatol Belski 622dc2a611 [ci skip] update NEWS 2017-05-02 14:53:32 +02:00
Christian Weiske c0c0871911 Fixed bug #51918 Phar::webPhar() does not handle requests sent through PUT and DELETE method
phar: Support DELETE, HEAD and PUT HTTP methods in Phar::webPhar

Up to now only GET and POST requests could be handled with Phar::webPhar(),
which is insufficient for today's REST APIs.
This patch expands the list of supported HTTP methods.
2017-05-02 14:44:47 +02:00
Anatol Belski 36c53036e7 [ci skip] update NEWS 2017-05-02 12:38:04 +02:00
Anatol Belski 20a608d9da Fixed bug #74510 win32/sendmail.c anchors CC header but not BCC 2017-05-02 12:31:00 +02:00
Fabien Villepinte 4c0e50c88a Fix bug #74457 Wrong reflection on XMLReader::expand 2017-05-02 06:24:46 +01:00
Fabien Villepinte f50df1d0e3 Fix bug #74468 wrong reflection on Collator::sortWithSortKeys 2017-05-02 06:20:40 +01:00
Anatol Belski a581e64199 Tests to ensure BC with undocumented behavior used in hacks
Should become obsolete, once behaviors change.
2017-05-01 18:01:05 +02:00
Nikita Popov 1967950dc3 Fix typo in SplFixedArray has_dimension implementation 2017-05-01 12:15:26 +02:00
Michael Heimpold d9dfac90bf Fix compiler warnings when compiled against musl libc
musl libc is complaining when <sys/poll.h> is used instead of <poll.h>
so change this.

This issue was reported for OpenWrt/LEDE where musl libc is the standard
C library instead of e.g. glibc, see the following link for the original PR:
https://github.com/openwrt/packages/pull/4263

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Michael Heimpold <mhei@heimpold.de>

--

v3: refined checks/fallback paths as suggested by @bukka

v2: rebased to resolve merge conflict in main/php_network.h

v1: initial PR
2017-04-30 20:24:56 +01:00
Jakub Zelenka a0b9554f94 Fix possible memory leak in openssl_encrypt and openssl_decrypt 2017-04-27 15:44:26 +01:00
Jakub Zelenka 7b392c7154 Prefer using DIRECTORY_SEPARATOR in OpenSSL config path 2017-04-27 15:10:55 +01:00
Jakub Zelenka e7166ea9be Add oid_section to the testing openssl.cnf
It tests repeated OID addition
2017-04-27 15:09:58 +01:00
Anatol Belski e67096dbbb [ci skip] update NEWS 2017-04-27 11:35:00 +02:00
Anatol Belski 09ef61e3ca Revert "Detect invalid port in xp_socket parse ip address"
This reverts commit bab0b99f37.
2017-04-27 02:49:12 +02:00
Anatol Belski bf3e2dce7b Revert "Follow up patch regarding bug #74216, see bug #74429"
This reverts commit cda7dcf4ca.
2017-04-27 02:49:01 +02:00
Anatol Belski 36301bd615 sync bin sdk version 2017-04-26 17:04:29 +02:00
Jakub Zelenka c0203c0ceb Do not add already added object to the internal OpenSSL table
This fixes OpenSSL 1.1 where adding object with OID that has been
already added causes an error - preventing of duplication.
2017-04-26 14:59:15 +01:00
Remi Collet f639b64dca rely on bundle config, instead of system one 2017-04-26 14:41:40 +02:00
Anatol Belski 8cfaea656c skip the test on OpenSSL < 1.1 for now 2017-04-26 14:39:03 +02:00
1872 changed files with 53958 additions and 1150874 deletions

No files matched your search

+2 -2
View File
@@ -24,7 +24,7 @@ environment:
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
PHP_BUILD_OBJ_DIR: c:\obj
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.1
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.7
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
#MYSQL_TEST_USER: root
@@ -43,7 +43,7 @@ environment:
services:
# the setup scripts have to be touched, once some other db version is used
- mysql
- postgresql95
- postgresql96
platform:
- x64
+1 -1
View File
@@ -165,7 +165,7 @@ User Functions/Methods Naming Conventions
'foobar'
'foo_bar'
Internal Function Naming Conventions
Internal Function Naming Convensions
----------------------
1. Functions that are part of the external API should be named
+245 -794
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -79,7 +79,7 @@ The next few rules are more of a technical nature::
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
3. Do not commit multiple file 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.
+6 -6
View File
@@ -17,7 +17,7 @@ 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
ongoing bases 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
@@ -31,7 +31,7 @@ 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.
7. Moving extensions from/to PECL requires write acces to the destination.
Most developers should have this.
Moving extensions from php-src to PECL
@@ -274,8 +274,8 @@ to upgrade.
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@
Please make sure that the mail to php-announce@ is its own completely seperate email.
This is to make sure that repiles to the announcement on php-general@ or internals@
will not accidentally hit the php-announce@ mailinglist.
Re-releasing the same version (or -pl)
@@ -312,6 +312,6 @@ to upgrade.
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@
Please make sure that the mail to php-announce@ is its own completely seperate email.
This is to make sure that repiles to the announcement on php-general@ or internals@
will not accidentally hit the php-announce@ mailinglist.
+1 -1
View File
@@ -11,7 +11,7 @@ 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.
mailinglist internals@lists.php.net.
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
+1 -4
View File
@@ -42,10 +42,7 @@ char *alloca ();
#endif
#ifndef MAXPATHLEN
# if _WIN32
# include "win32/ioutil.h"
# define MAXPATHLEN PHP_WIN32_IOUTIL_MAXPATHLEN
# elif PATH_MAX
# ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
# elif defined(MAX_PATH)
# define MAXPATHLEN MAX_PATH
+22 -76
View File
@@ -33,7 +33,6 @@
#include <Sddl.h>
#include "tsrm_win32.h"
#include "zend_virtual_cwd.h"
#include "win32/ioutil.h"
#ifdef ZTS
static ts_rsrc_id win32_globals_id;
@@ -208,42 +207,29 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
DWORD sec_desc_length = 0, desired_access = 0, granted_access = 0;
BYTE * psec_desc = NULL;
BOOL fAccess = FALSE;
realpath_cache_bucket * bucket = NULL;
char * real_path = NULL;
PHP_WIN32_IOUTIL_INIT_W(pathname)
if (!pathw) {
return -1;
}
if (mode == 1 /*X_OK*/) {
DWORD type;
int ret;
ret = GetBinaryTypeW(pathw, &type) ? 0 : -1;
PHP_WIN32_IOUTIL_CLEANUP_W()
return ret;
return GetBinaryType(pathname, &type) ? 0 : -1;
} else {
if(!IS_ABSOLUTE_PATH(pathname, strlen(pathname)+1)) {
real_path = (char *)malloc(MAXPATHLEN);
real_path = (char *)malloc(MAX_PATH);
if(tsrm_realpath(pathname, real_path) == NULL) {
goto Finished;
}
pathname = real_path;
PHP_WIN32_IOUTIL_REINIT_W(pathname);
}
if(php_win32_ioutil_access(pathname, mode)) {
PHP_WIN32_IOUTIL_CLEANUP_W()
if(access(pathname, mode)) {
free(real_path);
return errno;
}
/* If only existence check is made, return now */
if (mode == 0) {
PHP_WIN32_IOUTIL_CLEANUP_W()
free(real_path);
return 0;
}
@@ -299,11 +285,10 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
if(bucket == NULL && real_path == NULL) {
/* We used the pathname directly. Call tsrm_realpath */
/* so that entry is created in realpath cache */
real_path = (char *)malloc(MAXPATHLEN);
real_path = (char *)malloc(MAX_PATH);
if(tsrm_realpath(pathname, real_path) != NULL) {
pathname = real_path;
bucket = realpath_cache_lookup(pathname, (int)strlen(pathname), t);
PHP_WIN32_IOUTIL_REINIT_W(pathname);
}
}
}
@@ -340,13 +325,13 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
}
/* Get size of security buffer. Call is expected to fail */
if(GetFileSecurityW(pathw, sec_info, NULL, 0, &sec_desc_length)) {
if(GetFileSecurity(pathname, sec_info, NULL, 0, &sec_desc_length)) {
goto Finished;
}
psec_desc = (BYTE *)malloc(sec_desc_length);
if(psec_desc == NULL ||
!GetFileSecurityW(pathw, sec_info, (PSECURITY_DESCRIPTOR)psec_desc, sec_desc_length, &sec_desc_length)) {
!GetFileSecurity(pathname, sec_info, (PSECURITY_DESCRIPTOR)psec_desc, sec_desc_length, &sec_desc_length)) {
goto Finished;
}
@@ -388,7 +373,6 @@ Finished:
real_path = NULL;
}
PHP_WIN32_IOUTIL_CLEANUP_W()
if(fAccess == FALSE) {
errno = EACCES;
return errno;
@@ -475,15 +459,14 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
{
FILE *stream = NULL;
int fno, type_len, read, mode;
STARTUPINFOW startup;
STARTUPINFO startup;
PROCESS_INFORMATION process;
SECURITY_ATTRIBUTES security;
HANDLE in, out;
DWORD dwCreateFlags = 0;
BOOL res;
process_pair *proc;
char *cmd = NULL;
wchar_t *cmdw = NULL, *cwdw = NULL, *envw = NULL;
char *cmd;
int i;
char *ptype = (char *)type;
HANDLE thread_token = NULL;
@@ -507,42 +490,18 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
ptype++;
}
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
if (!cmd) {
return NULL;
}
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
cmdw = php_win32_cp_any_to_w(cmd);
if (!cmdw) {
free(cmd);
return NULL;
}
if (cwd) {
cwdw = php_win32_ioutil_any_to_w(cwd);
if (!cwdw) {
free(cmd);
free(cmdw);
return NULL;
}
}
security.nLength = sizeof(SECURITY_ATTRIBUTES);
security.bInheritHandle = TRUE;
security.lpSecurityDescriptor = NULL;
if (!type_len || !CreatePipe(&in, &out, &security, 2048L)) {
free(cmdw);
free(cwdw);
free(cmd);
return NULL;
}
memset(&startup, 0, sizeof(STARTUPINFOW));
memset(&startup, 0, sizeof(STARTUPINFO));
memset(&process, 0, sizeof(PROCESS_INFORMATION));
startup.cb = sizeof(STARTUPINFOW);
startup.cb = sizeof(STARTUPINFO);
startup.dwFlags = STARTF_USESTDHANDLES;
startup.hStdError = GetStdHandle(STD_ERROR_HANDLE);
@@ -574,28 +533,19 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
}
}
envw = php_win32_cp_env_any_to_w(env);
if (envw) {
dwCreateFlags |= CREATE_UNICODE_ENVIRONMENT;
} else {
if (env) {
free(cmd);
free(cmdw);
free(cwdw);
return NULL;
}
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
if (!cmd) {
return NULL;
}
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
if (asuser) {
res = CreateProcessAsUserW(token_user, NULL, cmdw, &security, &security, security.bInheritHandle, dwCreateFlags, envw, cwdw, &startup, &process);
res = CreateProcessAsUser(token_user, NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
CloseHandle(token_user);
} else {
res = CreateProcessW(NULL, cmdw, &security, &security, security.bInheritHandle, dwCreateFlags, envw, cwdw, &startup, &process);
res = CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
}
free(cmd);
free(cmdw);
free(cwdw);
free(envw);
if (!res) {
return NULL;
@@ -730,7 +680,10 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
if (NULL == shm->addr) {
int err = GetLastError();
SET_ERRNO_FROM_WIN32_CODE(err);
/* Catch more errors */
if (ERROR_NOT_ENOUGH_MEMORY == err) {
_set_errno(ENOMEM);
}
return (void*)-1;
}
@@ -811,17 +764,10 @@ TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
{
FILETIME mtime, atime;
HANDLE hFile;
PHP_WIN32_IOUTIL_INIT_W(filename)
if (!pathw) {
return -1;
}
hFile = CreateFileW(pathw, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);
PHP_WIN32_IOUTIL_CLEANUP_W()
/* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but
the CreateFile operation succeeds */
if (GetLastError() == ERROR_ALREADY_EXISTS) {
+747 -423
View File
File diff suppressed because it is too large. Load diff
+281 -48
View File
@@ -1,10 +1,25 @@
PHP 7.1 INTERNALS UPGRADE NOTES
PHP 7.0 INTERNALS UPGRADE NOTES
0. Wiki Examples
1. Internal API changes
e. Codepage handling on Windows
f. Path handling on Windows
g. SAPI logging
e. New data types
f. zend_parse_parameters() specs
g. sprintf() formats
h. HashTable API
i. New portable macros for large file support
j. New portable macros for integers
k. get_class_entry object handler info
l. get_class_name object handler info
m. Other portable macros info
n. ZEND_ENGINE_2 removal
o. Updated final class modifier
p. TSRM changes
q. gc_collect_cycles() is now hookable
r. PDO uses size_t for lengths
s. Resource API changes
t. Optimized strings concatenation.
u. Streams changes
v. Sort algorithm changes
2. Build system changes
a. Unix build system changes
@@ -24,56 +39,218 @@ changes. See: https://wiki.php.net/phpng-upgrading
1. Internal API changes
========================
e. Codepage handling on Windows
e. New data types
String
Besides the old way of accepting the strings with 's', the new 'S' ZPP spec
was introduced. It expects an argument of the type zend_string *. String lengths
in it are bound to the size_t datatype.
Integer types
Integers do no more depend on the firm 'long' type. Instead a platform
dependent integer type is used, it is called zend_long. That datatype is
defined dynamically to guarantee the consistent 64 bit support. The zval
field representing user land integer it bound to zend_long.
Signed integer is defined as zend_long, unsigned integer as zend_ulong
inside Zend.
Other datatypes
zend_off_t - portable off_t analogue
zend_stat_t - portable 'struct stat' analogue
These datatypes are declared to be portable across platforms. Thus, direct
usage of the functions like fseek, stat, etc. as well as direct usage of
off_t and struct stat is strongly not recommended. Instead the portable
macros should be used.
zend_fseek - portable fseek equivalent
zend_ftell - portable ftell equivalent
zend_lseek - portable lseek equivalent
zend_fstat - portable fstat equivalent
zend_stat - portable stat equivalent
f. zend_parse_parameters() specs
The new spec 'S' introduced, which expects an argument of type zend_string *.
The 'l' spec expects a parameter of the type zend_long, not long anymore.
The 's' spec expects parameters of the type char * and size_t, no int anymore.
g. sprintf() formats
New printf modifier 'p' was implemented to platform independently output zend_long,
zend_ulong and php_size_t datatypes. That modifier can be used with 'd', 'u', 'x' and 'o'
printf format specs with spprintf, snprintf and the wrapping printf implementations.
%pu is sufficient for both zend_ulong and php_size_t. the code using %p spec to output
pointer address might need to be enclosed into #ifdef when it unlickily followed by 'd',
'u', 'x' or 'o'.
The only exceptions are the snprintf and zend_sprintf functions yet, because in some cases
they can use the implemenations available on the system, not the PHP one. With snprintf the
macros ZEND_LONG_FMT and ZEND_ULONG_FMT should be used.
h. HashTable API
Datatype for array indexes was changed to zend_ulong, for string keys to zend_string *.
i. New portable macros for large file support
Function(s) Alias Comment
stat, _stat64 zend_stat for use with zend_stat_t
fstat, _fstat64 zend_fstat for use with zend_stat_t
lseek, _lseeki64 zend_lseek for use with zend_off_t
ftell, _ftelli64 zend_ftell for use with zend_off_t
fseek, _fseeki64 zend_fseek for use with zend_off_t
j. New portable macros for integers
Function(s) Alias Comment
snprintf with "%ld" or "%lld", _ltoa_s, _i64toa_s ZEND_LTOA for use with zend_long
atol, atoll, _atoi64 ZEND_ATOL for use with zend_long
strtol, strtoll, _strtoi64 ZEND_STRTOL for use with zend_long
strtoul, strtoull, _strtoui64 ZEND_STRTOUL for use with zend_long
abs, llabs, _abs64 ZEND_ABS for use with zend_long
- ZEND_LONG_MAX replaces LONG_MAX where appropriate
- ZEND_LONG_MIN replaces LONG_MIN where appropriate
- ZEND_ULONG_MAX replaces ULONG_MAX where appropriate
- SIZEOF_ZEND_LONG reworked SIZEOF_ZEND_LONG representing the size of zend_long datatype
- ZEND_SIZE_MAX Max value of size_t
- Z_L casts an integral constant to zend_long
- Z_UL casts an integral constant to zend_ulong
The macro ZEND_ENABLE_ZVAL_LONG64 reveals whether zval operates on 64 or 32 bit integer.
k. The get_class_entry object handler is no longer available. Instead
zend_object.ce is always used.
l. The get_class_name object handler is now only used for displaying class
names in debugging functions like var_dump(). It is no longer used in
get_class(), get_parent_class() or similar.
The handler is now obligatory, no longer accepts a `parent` argument and
must return a non-NULL zend_string*, which will be released by the caller.
m. Other portable macros info
ZEND_SECURE_ZERO - zeroes chunk of memory
ZEND_VALID_SOCKET - validates a php_socket_t variable
ZEND_FASTCALL is defined to use __vectorcall convention on VS2013 and above
ZEND_NORETURN is defined as __declspec(noreturn) on VS
n. The ZEND_ENGINE_2 macro has been removed. A ZEND_ENGINE_3 macro has been added.
o. Removed ZEND_ACC_FINAL_CLASS in favour of ZEND_ACC_FINAL, turning final class
modifier now a different class entry flag. Update your extensions.
p. TSRM changes
The TSRM layer undergone significant changes. It is not necessary anymore to
pass the tsrm_ls pointer explicitly. The TSRMLS_* macros should not be used
in any new developments.
The recommended way accessing globals in TS builds is by implementing it
to use a local thread unique pointer to the corresponding data pool. These
are the new macros that serve to achieve this goal:
- ZEND_TSRMG - based on TSRMG and if static pointer for data pool access is
implemented, will use it
- ZEND_TSRMLS_CACHE_EXTERN - to be used in a header shared across multiple
C/C++ files
- ZEND_TSRMLS_CACHE_DEFINE - to be used in the main extension C/C++ file
- ZEND_TSRMLS_CACHE_UPDATE - to be integrated at the top of the globals
ctor or RINIT function
- ZEND_ENABLE_STATIC_TSRMLS_CACHE - to be used in the config.[m4|w32] for
enabling the globals access per thread unique pointer
- TSRMLS_CACHE - expands to the variable name which links to the thread
unique data pool
Note that usually it will work without implementing the globals access per
a thread unique pointer, however it might cause a slowdown. The reason is
that the access model to the extension/SAPI own globals as well as the
access to the core globals is determined in the compilation phase depending
on whether ZEND_ENABLE_STATIC_TSRMLS_CACHE macro is defined.
Due to the current compiler evolution state, the TSRMLS_CACHE pointer
(when implemented) has to be present and updated in every binary unit which
is not compiled statically into PHP. So any DLL, DSO, EXE, etc. has to take
care about defining and updating it's TSRMLS cache. An update should happen
before any globals was accessed.
Porting an extension or SAPI is usually as easy as removing all the TSRMLS_*
occurrences and integrating the macros mentioned above. However if tsrm_ls
is used explicitly, its usage can be considered obsolete in most cases.
Additionally, if an extension triggers its own threads, TSRMLS_CACHE shouldn't
be passed to that threads directly.
When working with CTOR/DTOR for the extension globals, only the data passed
as parameters should be touched. For example, don't use code like
free(MYEXT_G(vars)); inside globals destructor, as it possibly can destroy
the data from a wrong thread. Instead use the pointer to the data delivered
into the destructor. So the previous example could look like
free(my_struct->vars); given the income was casted to (struct my_struct *).
A new macro was introduced to simplify the declaration to the extension
globals. A simplified declaration looks as follows
#define MYEXT_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(myext, v)
Another new macro ZEND_MODULE_GLOBALS_BULK(myext) delivers the corresponding
globals struct as a whole.
Two new storage specifiers was introduced.
ZEND_EXT_TLS - expand to an appropriate thread specific storage specifier in
the thread safe build, expands to empty in a non thread safe
build.
ZEND_TLS - expands to an appropriate thread specific storage specifier
with static visibility in the thread safe build, expands to
static specifier in a non thread safe build.
A set of new APIs was introduced, which allows to handle codepage
conversions. The corresponding prototypes and macros are contained
in win32/codepage.h.
Variables declared with these storage specifiers can not be shared across
threads. While ZEND_TLS enforces the local scope visibility, ZEND_EXT_TLS
pertains to the visiblity across several compilation units. In both cases,
there's no portable way to achieve the visibility across shared objects.
Thus, these specifiers are not compatible with ZEND_API and PHPAPI specifiers.
Functions with php_win32_cp_* signatures provide handling for various
codepage aspects. Primarily they are in use at various places in the
I/O utils code and directly in the core where necessary, providing
conversions to/from UTF-16. Arbitrary conversions between codepages
are possible as well, whereby UTF-16 will be always an intermediate
state in this case.
q. gc_collect_cycles() is now a function pointer, and can be replaced in the
same manner as zend_execute_ex() if needed (for example, to include the
time spent in the garbage collector in a profiler). The default
implementation has been renamed to zend_gc_collect_cycles(), and is
exported with ZEND_API.
For input length arguments, the macro PHP_WIN32_CP_IGNORE_LEN can be
passed, then the API will calculate the length. For output length
arguments, the macro PHP_WIN32_CP_IGNORE_LEN_P can be passed, then
the API won't set the output length.
r. In accordance with general use of size_t as string length, all PDO API
functions now use size_t for string length.
The mapping between encodings and codepages is provided by the predefined
array of data contained in win32/cp_enc_map.c. To change the data,
a generator win32/cp_enc_map_gen.c needs to be edited and run.
s. Removed ZEND_REGISTER/FETCH_RESOURCE, use zend_fetch_resource and
and zend_register_resource instead, zend_fetch_resource accepts a zend_resource *
as first argument, if you still need to fetch a resource from zval, use
zend_fetch_resource_ex. More details can be found in Zend/zend_list.c.
f. Path handling on Windows
t. Optimized strings concatenation.
ZEND_ADD_STRING/VAR/CHAR are replaced with ZEND_ROPE_INIT, ZEND_ROPE_ADD,
ZEND_ROPE_END.
Instead of reallocation and copying string on each ZEND_ADD_STRING/VAR/CAHR,
collect all the strings and then allocate and construct the resulting string once.
A set of new APIs was introduced, which allows to handle UTF-8 paths. The
corresponding prototypes and macros are contained in win32/ioutil.h.
u. Streams changes
- It is possible to do blocking reads on Windows pipes. It can be done either
using context stream option PHP_STREAM_OPTION_PIPE_BLOCKING or
adding STREAM_USE_BLOCKING_PIPE when opening the stream.
Functions with php_win32_ioutil_* signatures provide POSIX I/O analogues.
These functions are integrated in various places across the code base to
support Unicode filenames. While accepting char * arguments, internally
the conversion to wchar_t * happens. Internally almost no ANSI APIs are
used, but directly their wide equivalents. The string conversion rules
correspond to those already present in the core and depend on the current
encoding settings. Doing so allows to move away from the ANSI Windows API
with its dependency on the system OEM/ANSI codepage.
Thanks to the wide API usage, the long paths are now supported as well. The
PHP_WIN32_IOUTIL_MAXPATHLEN macro is defined to 2048 bytes and will override
the MAXPATHLEN in files where the header is included.
The most optimal use case for scripts is utilizing UTF-8 for any I/O
related functions. UTF-8 filenames are supported on any system disregarding
the system OEM/ANSI codepage.
g. SAPI logging
The log_message callback in the SAPI struct was extended with the severity
argument. This allows SAPI modules to implement mapping between PHP and
corresponding server error levels. A reference mapping implementation
can be found in apache2handler.
v. Sort algorithm changes
- Improved zend_qsort(using hybrid sorting algo) for better performance,
and also renamed zend_qsort to zend_sort.
- Added stable sorting algo zend_insert_sort.
w. Tick functions internal API change
Tick functions have different declaration now. They expect a single
parameter while before they were parameterless. When registering the
tick function a value for this parameter must be passed. This value will be
provided to the tick function on every execution.
========================
2. Build system changes
@@ -82,10 +259,66 @@ changes. See: https://wiki.php.net/phpng-upgrading
a. Unix build system changes
b. Windows build system changes
Static analysis with clang and Cppcheck is supported by passing "clang" or
"cppcheck" keyword to the --with-analyzer configure option.
- Besides Visual Studio, building with Clang or Intel Composer is now
possible. To enable an alternative toolset, add the option
--with-toolset=[vs,clang,icc] to the configure line. The default
toolset is vs. Still clang or icc need the correct environment
which involves many tools from the vs toolset.
The toolset option is supported by phpize as well.
AWARENESS The only recommended and supported toolset to produce production
ready binaries is Visual Studio. Still other compilers can be used now for
testing and analyzing purposes.
- configure.js now produces response files which are passed to the linker
and library manager. This solves the issues with the long command lines
which can exceed the OS limit.
- with clang toolset, an option --with-uncritical-warn-choke is available,
which suppresses the most frequent false positive warnings
- the --with-mp option will by default utilize all the available cores. It's
enabled by default for release builds and can be disabled with the special
"disable" keyword.
========================
3. Module changes
========================
Session:
- PS_MOD_UPDATE_TIMESTAMP() session save handler definition is added. New
save handler should use PS_MOD_UPDATE_TIMESTAMP() definition. Save handler
must not refer/change PS() variables directly from save handler. Use
parameters.
- PS_MOD()/PS_MOD_SID() macro exist only for transition. Beware these
save handlers are less secure and slower than PS_MOD_UPDATE_TIMESTAMP().
- PS(invalid_session_id) was removed. It was never worked as it supposed.
To report invalid session ID, use PS_VALIDATE_SID() handler.
- PS_VALIDATE_SID() defines session ID validation handler. This handler
must validate if requested session ID exists in session data storage or not.
Do not access PS(id) directly, but use this handler and it's parameter.
- PS_UPDATE_TIMESTAMP() defines timestamp updating handler. This handler
must update session data timestamp for GC if it is needed. e.g. Memcache
updates timestamp on read, so it does not need to update timestamp. Return
SUCCESS simply for this case.
- PS_CREATE_SID() should check session ID collision. Return NULL for failure.
- More documentation can be found in ext/session/mod_files.c as comments.
mod_files.c may be used as reference implementation.
Openssl:
- several ext/openssl functions require the inclusion of the applink shim
as documented in the OpenSSL FAQ https://www.openssl.org/support/faq.html#PROG2
to properly work on Windows. While this primarily affects the OpenSSL
functionality, the shim needs to be included into the executable file
which loads the extension DLL, not into the extension DLL itself. Alternatively
it can be compiled and linked with the main program as a separate object file.
More information and explanation in the linked OpenSSL FAQ.
Thus, this primarily affects any WAMP or other redistributions bundling the
official PHP release zipballs or building from sources. The applink shim is
already integrated with all the PHP executables from the official distribution
starting with 7.0.0beta1.
+2 -2
View File
@@ -370,10 +370,10 @@ AC_CHECK_FUNCS(mremap)
AC_ARG_ENABLE(zend-signals,
[ --disable-zend-signals whether to enable zend signal handling],[
[ --enable-zend-signals Use zend signal handling],[
ZEND_SIGNALS=$enableval
],[
ZEND_SIGNALS=yes
ZEND_SIGNALS=no
])
AC_CHECK_FUNC(sigaction, [
+8 -13
View File
@@ -17,20 +17,11 @@ function test3($a, $b) {
test1();
test2(1);
try {
test2();
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
test2();
test3(1,2);
call_user_func("test1");
try {
call_user_func("test3", 1);
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
call_user_func("test3", 1);
call_user_func("test3", 1, 2);
class test {
@@ -47,10 +38,14 @@ echo "Done\n";
--EXPECTF--
int(0)
int(1)
Exception: Too few arguments to function test2(), 0 passed in %s001.php on line 18 and exactly 1 expected
Warning: Missing argument 1 for test2(), called in %s on line %d
int(0)
int(2)
int(0)
Exception: Too few arguments to function test3(), 1 passed in %s001.php on line 27 and exactly 2 expected
Warning: Missing argument 2 for test3()%s
int(1)
int(2)
int(1)
+19 -12
View File
@@ -23,19 +23,11 @@ function test3($a, $b) {
test1();
test1(10);
test2(1);
try {
test2();
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
test2();
test3(1,2);
call_user_func("test1");
try {
call_user_func("test3", 1);
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
call_user_func("test3", 1);
call_user_func("test3", 1, 2);
class test {
@@ -70,7 +62,14 @@ int(1)
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
bool(false)
Exception: Too few arguments to function test2(), 0 passed in %s002.php on line %d and exactly 1 expected
Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
Warning: func_get_arg(): Argument 0 not passed to function in %s on line %d
bool(false)
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
bool(false)
int(1)
int(2)
@@ -85,7 +84,15 @@ bool(false)
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
bool(false)
Exception: Too few arguments to function test3(), 1 passed in %s002.php on line %d and exactly 2 expected
Warning: Missing argument 2 for test3()%s
int(1)
Warning: func_get_arg(): Argument 1 not passed to function in %s on line %d
bool(false)
Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
bool(false)
int(1)
int(2)
+12 -12
View File
@@ -18,19 +18,11 @@ function test3($a, $b) {
test1();
test1(10);
test2(1);
try {
test2();
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
test2();
test3(1,2);
call_user_func("test1");
try {
call_user_func("test3", 1);
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
call_user_func("test3", 1);
call_user_func("test3", 1, 2);
class test {
@@ -55,7 +47,10 @@ array(1) {
[0]=>
int(1)
}
Exception: Too few arguments to function test2(), 0 passed in %s003.php on line %d and exactly 1 expected
Warning: Missing argument 1 for test2(), called in %s on line %d and defined in %s on line %d
array(0) {
}
array(2) {
[0]=>
int(1)
@@ -64,7 +59,12 @@ array(2) {
}
array(0) {
}
Exception: Too few arguments to function test3(), 1 passed in %s003.php on line %d and exactly 2 expected
Warning: Missing argument 2 for test3()%s
array(1) {
[0]=>
int(1)
}
array(2) {
[0]=>
int(1)
+37 -1
View File
@@ -31,4 +31,40 @@ $test->bar();
?>
--EXPECTF--
Fatal error: Cannot re-assign $this in %s030.php on line 11
object(Exception)#%d (7) {
["message":protected]=>
string(3) "foo"
["string":"Exception":private]=>
string(0) ""
["code":protected]=>
int(0)
["file":protected]=>
string(%d) "%s030.php"
["line":protected]=>
int(%d)
["trace":"Exception":private]=>
array(1) {
[0]=>
array(6) {
["file"]=>
string(%d) "%s030.php"
["line"]=>
int(%d)
["function"]=>
string(3) "bar"
["class"]=>
string(3) "foo"
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
}
["previous":"Exception":private]=>
NULL
}
'test' => '0'
'test_2' => '1'
'test_3' => '2'
ok
-8
View File
@@ -38,19 +38,11 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
Warning: A non-numeric value encountered in %s on line %d
int(75636)
Notice: A non well formed numeric value encountered in %s on line %d
int(951858)
int(48550510)
float(75661.68)
Warning: A non-numeric value encountered in %s on line %d
int(75636)
Notice: A non well formed numeric value encountered in %s on line %d
int(951858)
int(48550510)
float(75661.68)
-5
View File
@@ -19,13 +19,8 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
Warning: A non-numeric value encountered in %s on line %d
Exception: Unsupported operand types
Warning: A non-numeric value encountered in %s on line %d
Fatal error: Uncaught Error: Unsupported operand types in %s:%d
Stack trace:
#0 {main}
-15
View File
@@ -1,15 +0,0 @@
--TEST--
closure binding to anonymous class
--FILE--
<?php
$class = new class {};
$foo = function() {
return $this;
};
$closure = Closure::bind($foo, $class, $class);
var_dump($closure());
?>
--EXPECTF--
object(class@anonymous)#1 (0) {
}
-16
View File
@@ -1,16 +0,0 @@
--TEST--
anonymous class trait binding
--FILE--
<?php
trait TaskTrait {
function run() {
return 'Running...';
}
}
$class = new class() {
use TaskTrait;
};
var_dump($class->run());
?>
--EXPECTF--
string(10) "Running..."
+1 -1
View File
@@ -154,7 +154,7 @@ Warning: assert(): assert(0 && ($a = function () {
$x = $a ? $b : $c;
$x = $a ?: $c;
$x = $a ?? $b;
[$a, $b, $c] = [1, 2 => 'x', 'z' => 'c'];
list($a, $b, $c) = [1, 2 => 'x', 'z' => 'c'];
@foo();
$y = clone $x;
yield 1 => 2;
@@ -1,19 +0,0 @@
--TEST--
Misoptimization when variable is modified by assert()
--INI--
zend.assertions=1
--FILE--
<?php
function test() {
$i = 0;
assert('$i = new stdClass');
$i += 1;
var_dump($i);
}
test();
?>
--EXPECTF--
Notice: Object of class stdClass could not be converted to int in %s on line %d
int(2)
@@ -1,56 +0,0 @@
--TEST--
Various null return conditions of dim/obj assignments
--FILE--
<?php
function test() {
$array = [PHP_INT_MAX => 42];
$true = true;
var_dump($array[] = 123);
var_dump($array[[]] = 123);
var_dump($array[new stdClass] = 123);
var_dump($true[123] = 456);
var_dump($array[] += 123);
var_dump($array[[]] += 123);
var_dump($array[new stdClass] += 123);
var_dump($true[123] += 456);
var_dump($true->foo = 123);
var_dump($true->foo += 123);
}
test();
?>
--EXPECTF--
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
NULL
Warning: Illegal offset type in %s on line %d
NULL
Warning: Illegal offset type in %s on line %d
NULL
Warning: Cannot use a scalar value as an array in %s on line %d
NULL
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
NULL
Warning: Illegal offset type in %s on line %d
NULL
Warning: Illegal offset type in %s on line %d
NULL
Warning: Cannot use a scalar value as an array in %s on line %d
NULL
Warning: Attempt to assign property of non-object in %s on line %d
NULL
Warning: Attempt to assign property of non-object in %s on line %d
NULL
+2 -9
View File
@@ -6,16 +6,9 @@ $a = new stdClass();
$x = "";
$a->$x = "string('')";
var_dump($a);
$a->{"\0"} = 42;
var_dump($a);
?>
--EXPECTF--
object(stdClass)#1 (1) {
[""]=>
string(10) "string('')"
}
Fatal error: Uncaught Error: Cannot access property started with '\0' in %s:%d
Fatal error: Uncaught Error: Cannot access empty property in %sbug29015.php:4
Stack trace:
#0 {main}
thrown in %s on line %d
thrown in %sbug29015.php on line 4
-29
View File
@@ -1,29 +0,0 @@
--TEST--
Bug #29368.1 (The destructor is called when an exception is thrown from the constructor).
--FILE--
<?php
function throwme($arg)
{
throw new Exception;
}
class foo {
function __construct() {
echo "Inside constructor\n";
throwme($this);
}
function __destruct() {
echo "Inside destructor\n";
}
}
try {
$bar = new foo;
} catch(Exception $exc) {
echo "Caught exception!\n";
}
?>
--EXPECT--
Inside constructor
Caught exception!
+1 -1
View File
@@ -3,7 +3,7 @@ Bug #29883 (isset gives invalid values on strings)
--FILE--
<?php
$x = "bug";
var_dump(isset($x[-10]));
var_dump(isset($x[-1]));
var_dump(isset($x["1"]));
echo $x["1"]."\n";
?>
+1 -1
View File
@@ -18,7 +18,7 @@ var_dump(isset($a['b']));
$simpleString = "Bogus String Text";
echo isset($simpleString->wrong)?"bug\n":"ok\n";
echo isset($simpleString["wrong"])?"bug\n":"ok\n";
echo isset($simpleString[-20])?"bug\n":"ok\n";
echo isset($simpleString[-1])?"bug\n":"ok\n";
echo isset($simpleString[0])?"ok\n":"bug\n";
echo isset($simpleString["0"])?"ok\n":"bug\n";
echo isset($simpleString["16"])?"ok\n":"bug\n";
+9 -13
View File
@@ -19,19 +19,15 @@ function NormalTest($a)
echo "Hi!";
}
try {
NormalTest();
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
try {
FooTest();
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
NormalTest();
FooTest();
FooTest(new Foo());
?>
--EXPECTF--
Exception: Too few arguments to function NormalTest(), 0 passed in %sbug33996.php on line 18 and exactly 1 expected
Exception: Too few arguments to function FooTest(), 0 passed in %sbug33996.php on line 23 and exactly 1 expected
Hello!
Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line %d and defined in %sbug33996.php on line %d
Hi!
Fatal error: Uncaught TypeError: Argument 1 passed to FooTest() must be an instance of Foo, none given, called in %sbug33996.php on line %d and defined in %sbug33996.php:%d
Stack trace:
#0 %s(%d): FooTest()
#1 {main}
thrown in %sbug33996.php on line %d
+4 -6
View File
@@ -43,9 +43,7 @@ Non-static method A::A_ftk() should not be called statically
1 %sbug38047.php:13 get_error_context()
2 %sbug38047.php:36 kalus_error_handler()
Fatal error: Uncaught ArgumentCountError: Too few arguments to function A::A_ftk(), 0 passed in %sbug38047.php on line 36 and exactly 1 expected in %sbug38047.php:7
Stack trace:
#0 %sbug38047.php(36): A::A_ftk()
#1 {main}
thrown in %sbug38047.php on line 7
Missing argument 1 for A::A_ftk(), called in %sbug38047.php on line 36 and defined
1 %sbug38047.php:13 get_error_context()
2 %sbug38047.php:7 kalus_error_handler()
3 %sbug38047.php:36 A_ftk()
+1 -1
View File
@@ -9,7 +9,7 @@ $foo[0]->bar = "xyz";
echo "Done\n";
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot use string offset as an object in %s:%d
Fatal error: Uncaught Error: Cannot use string offset as an array in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d
+1 -1
View File
@@ -7,7 +7,7 @@ $b = &$a[1];
$b = "f";
echo $a;
--EXPECTF--
Fatal error: Uncaught Error: Cannot create references to/from string offsets in %sbug49866.php:3
Fatal error: Uncaught Error: Cannot create references to/from string offsets nor overloaded objects in %sbug49866.php:3
Stack trace:
#0 {main}
thrown in %sbug49866.php on line 3
+3 -3
View File
@@ -10,14 +10,14 @@ class A {
}
$a = new A();
$prop = "\0";
$prop = null;
unset($a->$prop);
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot access property started with '\0' in %s:%d
Fatal error: Uncaught Error: Cannot access empty property in %s:%d
Stack trace:
#0 %s(%d): A->__unset('\x00')
#0 %s(%d): A->__unset('')
#1 {main}
thrown in %s on line %d
+3 -3
View File
@@ -10,14 +10,14 @@ class A {
}
$a = new A();
$prop = "\0";
$prop = null;
$a->$prop = 2;
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot access property started with '\0' in %s:%d
Fatal error: Uncaught Error: Cannot access empty property in %s:%d
Stack trace:
#0 %s(%d): A->__set('\x00', 2)
#0 %s(%d): A->__set('', 2)
#1 {main}
thrown in %s on line %d
+3 -3
View File
@@ -10,14 +10,14 @@ class A {
}
$a = new A();
$prop = "\0";
$prop = null;
var_dump($a->$prop);
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot access property started with '\0' in %s:%d
Fatal error: Uncaught Error: Cannot access empty property in %s:%d
Stack trace:
#0 %s(%d): A->__get('\x00')
#0 %s(%d): A->__get('')
#1 {main}
thrown in %s on line %d
+1 -1
View File
@@ -8,7 +8,7 @@ class MyClass {
$this->myRef = $value;
}
}
$myGlobal=new MyClass();
$myGlobal=new MyClass($myGlobal);
$myGlobal->myRef=&$myGlobal;
$myGlobal->myNonExistentProperty="ok\n";
echo $myGlobal;
-65
View File
@@ -1,65 +0,0 @@
--TEST--
Bug #53432: Assignment via string index access on an empty string converts to array
--FILE--
<?php
$str = '';
var_dump($str[0] = 'a');
var_dump($str);
$str = '';
var_dump($str[5] = 'a');
var_dump($str);
$str = '';
var_dump($str[-1] = 'a');
var_dump($str);
$str = '';
var_dump($str['foo'] = 'a');
var_dump($str);
$str = '';
try {
var_dump($str[] = 'a');
} catch (Error $e) {
echo "Error: {$e->getMessage()}\n";
}
var_dump($str);
$str = '';
try {
var_dump($str[0] += 1);
} catch (Error $e) {
echo "Error: {$e->getMessage()}\n";
}
var_dump($str);
$str = '';
try {
var_dump($str[0][0] = 'a');
} catch (Error $e) {
echo "Error: {$e->getMessage()}\n";
}
var_dump($str);
?>
--EXPECTF--
string(1) "a"
string(1) "a"
string(1) "a"
string(6) " a"
Warning: Illegal string offset: -1 in %s on line %d
NULL
string(0) ""
Warning: Illegal string offset 'foo' in %s on line %d
string(1) "a"
string(1) "a"
Error: [] operator not supported for strings
string(0) ""
Error: Cannot use assign-op operators with string offsets
string(0) ""
Error: Cannot use string offset as an array
string(0) ""
+1 -1
View File
@@ -6,7 +6,7 @@ function f(callable $c) {}
f();
?>
--EXPECTF--
Fatal error: Uncaught ArgumentCountError: Too few arguments to function f(), 0 passed in %s on line 3 and exactly 1 expected in %s:2
Fatal error: Uncaught TypeError: Argument 1 passed to f() must be callable, none given, called in %s on line 3 and defined in %s:%d
Stack trace:
#0 %s(%d): f()
#1 {main}
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #62814: It is possible to stiffen child class members visibility
--FILE--
<?php
class A {
private function test() { }
}
class B extends A {
protected function test() { }
}
class C extends B {
private function test() { }
}
?>
--EXPECTF--
Fatal error: Access level to C::test() must be protected (as in class B) or weaker in %s on line %d
-2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #63734 (Garbage collector can free zvals that are still referenced)
--INI--
zend.enable_gc = 1
--FILE--
<?php
class C {
+3 -8
View File
@@ -57,13 +57,8 @@ $bar = foo3();
string(9) "not catch"
NULL
Fatal error: Uncaught Exception: not catched in %sbug65784.php:42
Fatal error: Uncaught Error: Class 'NotExists' not found in %sbug65784.php:%d
Stack trace:
#0 %sbug65784.php(52): foo3()
#0 %s(%d): foo3()
#1 {main}
Next Error: Class 'NotExists' not found in %sbug65784.php:46
Stack trace:
#0 %sbug65784.php(52): foo3()
#1 {main}
thrown in %sbug65784.php on line 46
thrown in %sbug65784.php on line %d
+3 -1
View File
@@ -13,4 +13,6 @@ $x = $c->test();
print_r($x);
unset($c, $x);
--EXPECTF--
Fatal error: Cannot unset $this in %sbug68370.php on line 4
Array
(
)
-1
View File
@@ -28,7 +28,6 @@ class Bar {
}
public function __destruct() {
if (!isset(self::$instance)) return;
Foo::getInstance();
}
}
-2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #69446 (GC leak relating to removal of nested data after dtors run)
--INI--
zend.enable_gc = 1
--FILE--
<?php
$bar = NULL;
-2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #69446 (GC leak relating to removal of nested data after dtors run)
--INI--
zend.enable_gc = 1
--FILE--
<?php
$bar = NULL;
-2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #69534 (Cycle leaks through declared properties on internal classes)
--INI--
zend.enable_gc = 1
--FILE--
<?php
class Node extends SplObjectStorage {
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Bug #69676: Resolution of self::FOO in class constants not correct (variation)
--FILE--
<?php
class Foo {
const A = 'Foo::A';
const B = self::A . ' and ' . self::C;
const C = 'Foo::C';
}
class Bar extends Foo {
const A = 'Bar::A';
const C = 'Bar::C';
}
var_dump(Bar::B);
?>
--EXPECT--
string(17) "Foo::A and Foo::C"
-69
View File
@@ -1,69 +0,0 @@
--TEST--
Bug #69676: Resolution of self::FOO in class constants not correct (variation)
--FILE--
<?php
class P {
const N = 'P';
}
class A extends P {
const selfN = self::N;
const parentN = parent::N;
const N = 'A';
}
class B extends A {
const N = 'B';
}
var_dump(B::selfN); // A
var_dump(B::parentN); // P
class A2 {
const selfN = self::N;
const N = 'A2';
}
class B2 extends A2 {
const indSelfN = self::selfN;
const N = 'B2';
}
class C2 extends B2 {
const N = 'C2';
}
var_dump(C2::indSelfN); // A2
class A3 {
const selfN = self::N;
const N = 'A3';
}
class B3 extends A3 {
const exprSelfN = "expr" . self::selfN;
const N = 'B3';
}
class C3 extends B3 {
const N = 'C3';
}
var_dump(C3::exprSelfN); // exprA3
class A4 {
const selfN = self::N;
const N = 'A4';
}
class B4 extends A4 {
const N = 'B4';
public $prop = self::selfN;
}
class C4 extends B4 {
const N = 'C4';
}
var_dump((new C4)->prop); // A4
?>
--EXPECT--
string(1) "A"
string(1) "P"
string(2) "A2"
string(6) "exprA3"
string(2) "A4"
+1 -1
View File
@@ -7,7 +7,7 @@ $r = new ReflectionMethod($f, '__invoke');
var_dump($r->getParameters()[0]->getName());
var_dump($r->getParameters()[0]->getClass());
echo $r->getParameters()[0], "\n";
echo $r->getReturnType()->getName(), "\n";
echo $r->getReturnType(),"\n";
echo $r,"\n";
?>
--EXPECT--
-42
View File
@@ -1,42 +0,0 @@
--TEST--
Collection of some cycles on unfinished generators
--FILE--
<?php
// CV
function gen1() {
$gen = yield;
yield;
}
$gen = gen1();
$gen->send($gen);
// This
class Test {
public $gen;
public function gen2() {
yield;
}
}
$test = new Test;
$test->gen = $test->gen2();
// Closure object
$gen3 = (function() use (&$gen3) {
yield;
})();
// Yield from array
function gen4() {
yield from [yield];
}
$gen = gen4();
$gen->send($gen);
?>
===DONE===
--EXPECT--
===DONE===
-44
View File
@@ -1,44 +0,0 @@
--TEST--
Generator cycle collection edge cases
--FILE--
<?php
// Extra args
function gen1() {
yield;
}
$obj = new stdClass;
$obj->gen = gen1($obj);
// Symtable
function gen2() {
$varName = 'a';
$$varName = yield;
yield;
}
$gen = gen2();
$gen->send($gen);
// Symtable indirect
function gen3() {
$varName = 'a';
$$varName = 42;
$var = yield;
yield;
}
$gen = gen3();
$gen->send($gen);
// Yield from root
function gen4() {
yield from yield;
}
$gen = gen4();
$gen2 = gen4($gen);
$gen2->send([1, 2, 3]);
$gen->send($gen2);
?>
===DONE===
--EXPECT--
===DONE===
+1 -1
View File
@@ -34,4 +34,4 @@ try {
string(36) "Cannot use string offset as an array"
string(27) "Cannot unset string offsets"
string(41) "Only variables can be passed by reference"
string(41) "Cannot increment/decrement string offsets"
string(64) "Cannot increment/decrement overloaded objects nor string offsets"
+20 -4
View File
@@ -53,27 +53,43 @@ string(3) "1st"
string(3) "2nd"
NULL
string(3) "4th"
array(3) {
array(4) {
[0]=>
string(3) "1st"
[1]=>
&string(3) "2nd"
[2]=>
NULL
[3]=>
string(3) "4th"
}
array(2) {
array(4) {
[0]=>
NULL
[1]=>
string(3) "2nd"
[2]=>
NULL
[3]=>
string(3) "4th"
}
array(2) {
array(4) {
[0]=>
NULL
[1]=>
&string(3) "2nd"
[2]=>
NULL
[3]=>
string(3) "4th"
}
array(1) {
array(4) {
[0]=>
NULL
[1]=>
NULL
[2]=>
NULL
[3]=>
string(3) "4th"
}
+1 -1
View File
@@ -15,7 +15,7 @@ var_dump($c);
?>
--EXPECTF--
Warning: Cannot bind method SplDoublyLinkedList::count() to object of class cls in %s on line %d
Warning: Cannot bind internal method SplDoublyLinkedList::count() to object of class cls in %s on line %d
NULL
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
+1 -5
View File
@@ -19,8 +19,4 @@ try {
?>
--EXPECTF--
Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 0 passed in %sbug70689.php on line 12 and exactly 1 expected in %sbug70689.php:3
Stack trace:
#0 %sbug70689.php(12): foo()
#1 {main}
thrown in %sbug70689.php on line 3
Missing argument 1 for foo(), called in %sbug70689.php on line %d and defined
-2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Crash)
--INI--
zend.enable_gc = 1
--FILE--
<?php
class A {
-2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Memleak)
--INI--
zend.enable_gc = 1
--FILE--
<?php
class A {
-47
View File
@@ -1,47 +0,0 @@
--TEST--
Bug #70918 (Segfault using static outside of class scope)
--FILE--
<?php
try {
static::x;
} catch (Error $e) {
var_dump($e->getMessage());
}
try {
parent::x;
} catch (Error $e) {
var_dump($e->getMessage());
}
try {
self::x;
} catch (Error $e) {
var_dump($e->getMessage());
}
try {
new static;
} catch (Error $e) {
var_dump($e->getMessage());
}
try {
static::x();
} catch (Error $e) {
var_dump($e->getMessage());
}
try {
static::$i;
} catch (Error $e) {
var_dump($e->getMessage());
}
?>
--EXPECT--
string(52) "Cannot access static:: when no class scope is active"
string(52) "Cannot access parent:: when no class scope is active"
string(50) "Cannot access self:: when no class scope is active"
string(52) "Cannot access static:: when no class scope is active"
string(52) "Cannot access static:: when no class scope is active"
string(52) "Cannot access static:: when no class scope is active"
-13
View File
@@ -1,13 +0,0 @@
--TEST--
Bug #71196 (Memory leak with out-of-order live ranges)
--FILE--
<?php
try {
$a = "1";
[1, (y().$a.$a) . ($a.$a)];
} catch (Error $e) {
var_dump($e->getMessage());
}
?>
--EXPECT--
string(30) "Call to undefined function y()"
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Bug #71266 (Missing separation of properties HT in foreach etc)
--FILE--
<?php
$one = 1;
$two = 2;
$arr = ['foo' => $one, 'bar' => $two];
$obj = (object) $arr;
foreach ($obj as $val) {
var_dump($val);
$obj->bar = 42;
}
$arr = ['foo' => $one, 'bar' => $two];
$obj = (object) $arr;
next($obj);
var_dump(current($arr));
?>
--EXPECT--
int(1)
int(42)
int(1)
+3 -1
View File
@@ -1,5 +1,7 @@
--TEST--
bug #71428.1: inheritance with null default values
--XFAIL--
This is a BC break
--FILE--
<?php
class A {
@@ -9,5 +11,5 @@ class B extends A {
public function m(array $a = []) {}
}
--EXPECTF--
Warning: Declaration of B::m(array $a = Array) should be compatible with A::m(?array $a = NULL) in %sbug71428.1.php on line 7
Warning: Declaration of B::m(array $a = Array) should be compatible with A::m(array $a = NULL) in %sbug71428.1.php on line 7
+3 -1
View File
@@ -1,5 +1,7 @@
--TEST--
bug #71428: Validation type inheritance with = NULL
--XFAIL--
This is a BC break
--FILE--
<?php
class A { }
@@ -7,5 +9,5 @@ class B { public function m(A $a = NULL, $n) { echo "B.m";} };
class C extends B { public function m(A $a , $n) { echo "C.m";} };
?>
--EXPECTF--
Warning: Declaration of C::m(A $a, $n) should be compatible with B::m(?A $a, $n) in %sbug71428.3.php on line 4
Warning: Declaration of C::m(A $a, $n) should be compatible with B::m(A $a = NULL, $n) in %sbug71428.3.php on line 4
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Bug #71539 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$array = [];
$array[0] =& $array[''];
$array[0] = 42;
var_dump($array);
?>
--EXPECT--
array(2) {
[""]=>
&int(42)
[0]=>
&int(42)
}
-30
View File
@@ -1,30 +0,0 @@
--TEST--
Bug #71539.1 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$x = (object)['a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5,'f'=>6,'g'=>7];
$x->h =& $x->i;
$x->h = 42;
var_dump($x);
?>
--EXPECT--
object(stdClass)#1 (9) {
["a"]=>
int(1)
["b"]=>
int(2)
["c"]=>
int(3)
["d"]=>
int(4)
["e"]=>
int(5)
["f"]=>
int(6)
["g"]=>
int(7)
["i"]=>
&int(42)
["h"]=>
&int(42)
}
-30
View File
@@ -1,30 +0,0 @@
--TEST--
Bug #71539.2 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$a = [0,1,2,3,4,5,6];
$a[200] =& $a[100];
$a[100] =42;
var_dump($a);
?>
--EXPECT--
array(9) {
[0]=>
int(0)
[1]=>
int(1)
[2]=>
int(2)
[3]=>
int(3)
[4]=>
int(4)
[5]=>
int(5)
[6]=>
int(6)
[100]=>
&int(42)
[200]=>
&int(42)
}
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Bug #71539.3 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$array = [];
$array[0][0] =& $array[''];
$array[0][0] = 42;
var_dump($array);
?>
--EXPECT--
array(2) {
[""]=>
&int(42)
[0]=>
array(1) {
[0]=>
&int(42)
}
}
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Bug #71539.4 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$array = [0=>[]];
$array[0][0] =& $array[0][''];
$array[0][0] = 42;
var_dump($array);
?>
--EXPECT--
array(1) {
[0]=>
array(2) {
[""]=>
&int(42)
[0]=>
&int(42)
}
}
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Bug #71539.5 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$array = [];
$array['']->prop =& $array[0];
$array[0] = 42;
var_dump($array);
?>
--EXPECT--
array(2) {
[0]=>
&int(42)
[""]=>
object(stdClass)#1 (1) {
["prop"]=>
&int(42)
}
}
-15
View File
@@ -1,15 +0,0 @@
--TEST--
Bug #71539.5 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$name = 'a';
for ($i = 0; $i < 100000; $i++) {
if ($name != 'i') {
$$name =& $GLOBALS;
}
$name++;
}
?>
OK
--EXPECT--
OK
-27
View File
@@ -1,27 +0,0 @@
--TEST--
Bug #71572: String offset assignment from an empty string inserts null byte
--FILE--
<?php
$str = "abc";
var_dump($str{0} = "");
var_dump($str{1} = "");
var_dump($str{3} = "");
var_dump($str{10} = "");
var_dump($str);
?>
==DONE==
--EXPECTF--
Warning: Cannot assign an empty string to a string offset in %s on line %d
NULL
Warning: Cannot assign an empty string to a string offset in %s on line %d
NULL
Warning: Cannot assign an empty string to a string offset in %s on line %d
NULL
Warning: Cannot assign an empty string to a string offset in %s on line %d
NULL
string(3) "abc"
==DONE==
-30
View File
@@ -1,30 +0,0 @@
--TEST--
Bug #71818 (Memory leak when array altered in destructor)
--INI--
zend.enable_gc = 1
--FILE--
<?php
class MemoryLeak
{
public function __construct()
{
$this->things[] = $this;
}
public function __destruct()
{
$this->things[] = null;
}
private $things = [];
}
ini_set('memory_limit', '10M');
for ($i = 0; $i < 100000; ++$i) {
$obj = new MemoryLeak();
}
echo "OK\n";
?>
--EXPECT--
OK
-14
View File
@@ -1,14 +0,0 @@
--TEST--
Bug #72107: Segfault when using func_get_args as error handler
--FILE--
<?php
set_error_handler('func_get_args');
function test($a) {
echo $undef;
}
test(1);
?>
--EXPECTF--
Warning: Cannot call func_get_args() dynamically in %s on line %d
Notice: Undefined variable: undef in %s on line %d
+2 -3
View File
@@ -14,6 +14,5 @@ class Hello implements Foo {
}
echo "OK\n";
?>
--EXPECTF--
Fatal error: Declaration of Hello::bar(array $baz = Array) must be compatible with Foo::bar(?array $baz = NULL) in %s on line %d
--EXPECT--
OK
+1 -1
View File
@@ -7,4 +7,4 @@ $var11 = new StdClass();
$var16 = error_reporting($var11);
?>
--EXPECTF--
Recoverable fatal error: Object of class stdClass could not be converted to string in %sbug72162.php on line %d
Catchable fatal error: Object of class stdClass could not be converted to string in %sbug72162.php on line %d
-35
View File
@@ -1,35 +0,0 @@
--TEST--
Bug #72177 Scope issue in __destruct after ReflectionProperty::setValue()
--FILE--
<?php
class Child
{
protected $bar;
public function __destruct()
{
$this->bar = null;
}
}
class Parnt
{
protected $child;
public function doSomething()
{
$this->child = new Child();
$prop = new \ReflectionProperty($this, 'child');
$prop->setAccessible(true);
$prop->setValue($this, null);
}
}
$p = new Parnt();
$p->doSomething();
echo "OK\n";
?>
--EXPECT--
OK
-34
View File
@@ -1,34 +0,0 @@
--TEST--
Bug #72177 Scope issue in __destruct after ReflectionProperty::setValue()
--FILE--
<?php
class Foo
{
private $bar = 'bar';
public function __construct()
{
unset($this->bar);
}
}
class Bar extends Foo
{
private $baz = 'baz';
private static $tab = 'tab';
public function __get(string $name)
{
var_dump($this->baz);
var_dump(self::$tab);
return $name;
}
}
$r = new ReflectionProperty(Foo::class, 'bar');
$r->setAccessible(true);
echo "OK\n";
?>
--EXPECT--
OK
-27
View File
@@ -1,27 +0,0 @@
--TEST--
Bug #72188 (Nested try/finally blocks losing return value)
--FILE--
<?php
function test() {
try {
return 5;
} finally {
try {
echo 1;
} finally {
echo 2;
}
}
}
$a = test();
if($a !== 5) {
echo "FAILED: expected 5, received ", var_export($a), PHP_EOL;
} else {
echo "Passed", PHP_EOL;
}
?>
--EXPECT--
12Passed
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Bug #72215 (Wrong return value if var modified in finally)
--FILE--
<?php
function test() {
$a = 1;
try {
return $a;
} finally {
$a = 2;
}
}
var_dump(test());
?>
--EXPECT--
int(1)
-21
View File
@@ -1,21 +0,0 @@
--TEST--
Bug #72215.1 (Wrong return value if var modified in finally)
--FILE--
<?php
function &test(&$b) {
$a =& $b;
try {
return $a;
} finally {
$a = 2;
}
}
$x = 1;
$y =& test($x);
var_dump($y);
$x = 3;
var_dump($y);
?>
--EXPECT--
int(2)
int(3)
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Bug #72215.1 (Wrong return value if var modified in finally)
--FILE--
<?php
function &test(&$b) {
$a =& $b;
try {
return $a;
} finally {
$a =& $c;
$a = 2;
}
}
$x = 1;
$y =& test($x);
var_dump($y);
$x = 3;
var_dump($y);
?>
--EXPECT--
int(1)
int(3)
-15
View File
@@ -1,15 +0,0 @@
--TEST--
Bug #72215.3 (Wrong return value if var modified in finally)
--FILE--
<?php
function &test() {
try {
return $a;
} finally {
$a = 2;
}
}
var_dump(test());
?>
--EXPECT--
int(2)
-16
View File
@@ -1,16 +0,0 @@
--TEST--
Bug #72216 (Return by reference with finally is not memory safe)
--FILE--
<?php
function &test() {
$a = ["ok"];
try {
return $a[0];
} finally {
$a[""] = 42;
}
}
var_dump(test());
?>
--EXPECT--
string(2) "ok"
-11
View File
@@ -1,11 +0,0 @@
--TEST--
Bug #72221 (Segmentation fault in stream_get_line / zend_memnstr_ex)
--FILE--
<?php
$fp = fopen("php://memory", "r+");
fwrite($fp, str_repeat("baad", 1024*1024));
rewind($fp);
stream_get_line($fp, 1024*1024*2, "aaaa");
echo "Done\n";
--EXPECT--
Done
-18
View File
@@ -1,18 +0,0 @@
--TEST--
Misoptimize due to type narrowing
--FILE--
<?php
function test() {
$b = false;
$x = (1<<53)+1;
do {
$x = 1.0 * ($x - (1<<53));
} while ($b);
return $x;
}
var_dump(test());
?>
--EXPECT--
float(1)
-17
View File
@@ -1,17 +0,0 @@
--TEST--
Bug #72347 (VERIFY_RETURN type casts visible in finally)
--FILE--
<?php
function test() : int {
$d = 1.5;
try {
return $d;
} finally {
var_dump($d);
}
}
var_dump(test());
?>
--EXPECT--
float(1.5)
int(1)
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #72373: TypeError after Generator function w/declared return type finishes
--FILE--
<?php
function foo() : Generator {
yield 1;
yield 2;
yield 3;
}
foreach (foo() as $bar) {
echo $bar . "\n";
}
?>
--EXPECT--
1
2
3
-10
View File
@@ -1,10 +0,0 @@
--TEST--
Bug #72395 (list() regression)
--FILE--
<?php
list(,,$a,,$b,) = array(1, 2, 3, 4, 5, 6);
var_dump($a, $b);
?>
--EXPECT--
int(3)
int(5)
-14
View File
@@ -1,14 +0,0 @@
--TEST--
Bug #72441 (Segmentation fault: RFC list_keys)
--FILE--
<?php
$array = [];
list(
'' => $foo,
$bar
) = $array;
?>
--EXPECTF--
Fatal error: Cannot mix keyed and unkeyed array entries in assignments in %sbug72441.php on line %d
-39
View File
@@ -1,39 +0,0 @@
--TEST--
Bug #72543 (different references behavior comparing to PHP 5)
--FILE--
<?php
function create_references(&$array) {
foreach ($array as $key => $value) {
create_references($array[$key]);
}
}
function change_copy($copy) {
$copy['b']['z']['z'] = $copy['b'];
}
$data = [
'a' => [
'b' => [],
],
];
create_references($data);
$copy = $data['a'];
var_dump($copy);
change_copy($copy);
var_dump($copy); //RECURSION
?>
--EXPECT--
array(1) {
["b"]=>
array(0) {
}
}
array(1) {
["b"]=>
array(0) {
}
}
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Bug #72543.1 (different references behavior comparing to PHP 5)
--FILE--
<?php
$arr = [];
$arr[0] = null;
$ref =& $arr[0];
unset($ref);
$arr[0][0] = $arr[0];
var_dump($arr);
?>
--EXPECT--
array(1) {
[0]=>
array(1) {
[0]=>
NULL
}
}
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Bug #72543.2 (different references behavior comparing to PHP 5)
--FILE--
<?php
$arr = [];
$arr[0] = null;
$ref =& $arr[0];
unset($ref);
$arr[0][$arr[0]] = null;
var_dump($arr);
?>
--EXPECT--
array(1) {
[0]=>
array(1) {
[""]=>
NULL
}
}
-12
View File
@@ -1,12 +0,0 @@
--TEST--
Bug #72543.3 (different references behavior comparing to PHP 5)
--FILE--
<?php
$x = new stdClass;
$x->a = 1;
$ref =& $x->a;
unset($ref);
var_dump($x->a + ($x->a = 2));
?>
--EXPECT--
int(3)
-11
View File
@@ -1,11 +0,0 @@
--TEST--
Bug #72543.4 (different references behavior comparing to PHP 5)
--FILE--
<?php
$arr = [1];
$ref =& $arr[0];
unset($ref);
var_dump($arr[0] + ($arr[0] = 2));
?>
--EXPECT--
int(3)
-10
View File
@@ -1,10 +0,0 @@
--TEST--
Bug #72543.5 (different references behavior comparing to PHP 5)
--FILE--
<?php
$arr = [1];
$ref =& $arr[0];
var_dump($arr[0] + ($arr[0] = 2));
?>
--EXPECT--
int(4)
-26
View File
@@ -1,26 +0,0 @@
--TEST--
Bug #72598 (Reference is lost after array_slice())
--FILE--
<?php
function ref(&$ref) {
var_dump($ref);
}
new class {
function __construct() {
$args = [&$this];
for ($i = 0; $i < 2; $i++) {
$a = array_slice($args, 0, 1);
call_user_func_array('ref', $a);
}
}
};
?>
--EXPECTF--
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11
object(class@anonymous)#1 (0) {
}
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11
object(class@anonymous)#1 (0) {
}
-27
View File
@@ -1,27 +0,0 @@
--TEST--
Bug #72598.2 (Reference is lost after array_slice())
--FILE--
<?php
function ref(&$ref) {
var_dump($ref);
$ref = 1;
}
new class {
function __construct() {
$b = 0;
$args = [&$b];
unset($b);
for ($i = 0; $i < 2; $i++) {
$a = array_slice($args, 0, 1);
call_user_func_array('ref', $a);
}
}
};
?>
--EXPECTF--
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598_2.php on line 14
int(0)
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598_2.php on line 14
int(0)
-22
View File
@@ -1,22 +0,0 @@
--TEST--
Bug #72918 (negative offset inside a quoted string leads to parse error)
--FILE--
<?php
$array = [-3 => 'foo'];
$string = 'abcde';
echo "$array[-3]\n";
echo "$string[-3]\n";
echo <<<EOT
$array[-3]
$string[-3]
EOT;
?>
===DONE===
--EXPECT--
foo
c
foo
c
===DONE===
-34
View File
@@ -1,34 +0,0 @@
--TEST--
Bug #73288 (Segfault in __clone > Exception.toString > __get)
--INI--
opcache.enable=1
opcache.enable_cli=1
--FILE--
<?php
class NoClone {
public function __clone() {
throw new Exception("No Cloneable");
}
}
class C {
public function __get($name) {
return new NoClone;
}
}
function test_clone() {
$c = new C;
$b = clone $c->x;
}
test_clone();
?>
--EXPECTF--
Fatal error: Uncaught Exception: No Cloneable in %sbug73288.php:%d
Stack trace:
#0 %s(%d): NoClone->__clone()
#1 %s(%d): test_clone()
#2 {main}
thrown in %sbug73288.php on line %d
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #73900: Use After Free in unserialize() SplFixedArray
--FILE--
<?php
$a = new stdClass;
$b = new SplFixedArray(1);
$b[0] = $a;
$c = &$b[0];
var_dump($c);
?>
--EXPECT--
object(stdClass)#1 (0) {
}
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_log)
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
if (PHP_ZTS) die("skip only for no-zts build");
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip not for Windows");
?>
--INI--
memory_limit=1G
max_execution_time=1
hard_timeout=1
--FILE--
<?php
$a1 = range(1, 1000000);
$a2 = range(100000, 1999999);
array_intersect($a1, $a2);
?>
--EXPECTF--
Fatal error: Maximum execution time of 1+1 seconds exceeded %s
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #74164 (PHP hangs when an invalid value is dynamically passed to typehinted by-ref arg)
--FILE--
<?php
namespace Foo;
set_error_handler(function ($type, $msg) {
throw new \Exception($msg);
});
call_user_func(function (array &$ref) {var_dump("xxx");}, 'not_an_array_variable');
?>
--EXPECTF--
Fatal error: Uncaught Exception: Parameter 1 to Foo\{closure}() expected to be a reference, value given in %sbug74164.php:%d
Stack trace:
#0 [internal function]: Foo\{closure}(%s)
#1 %sbug74164.php(%d): call_user_func(%s)
#2 {main}
thrown in %sbug74164.php on line %d
-30
View File
@@ -1,30 +0,0 @@
--TEST--
Bug #74340: Magic function __get has different behavior in php 7.1.x
--FILE--
<?php
class Test
{
public function __get($var)
{
static $first = true;
echo '__get '.$var.PHP_EOL;
if ($first) {
$first = false;
$this->$var;
$this->{$var.'2'};
$this->$var;
}
}
}
$test = new Test;
$test->test;
?>
--EXPECTF--
__get test
Notice: Undefined property: Test::$test in %s on line %d
__get test2
Notice: Undefined property: Test::$test in %s on line %d
Loaded 100 of 1872 files, more files were not shown because too many files have changed in this diff. Show more