Skip to content
forked from php/php-src

Commit ee22aa4

Browse files
authored
Merge pull request #6 from php/master
sync master
2 parents ee2ba03 + 550a4f2 commit ee22aa4

File tree

646 files changed

+14826
-22318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

646 files changed

+14826
-22318
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
arch: amd64
7575
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 ARM64=1
7676
arch: arm64
77+
if: type = cron
7778
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 S390X=1
7879
arch: s390x
7980
if: type = cron

NEWS

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
?? ??? ????, PHP 8.0.0RC1
3+
?? ??? ????, PHP 8.0.0rc2
4+
5+
6+
01 Oct 2020, PHP 8.0.0rc1
47

58
- CLI:
69
. Allow debug server binding to an ephemeral port via `-S localhost:0`. (Sara)
10+
711
- Core:
812
. Fixed bug #80109 (Cannot skip arguments when extended debug is enabled).
913
(Nikita)
1014

15+
- ODBC:
16+
. Fixed bug #22986 (odbc_connect() may reuse persistent connection). (cmb)
17+
18+
- PDO_Firebird:
19+
. Fixed bug #64937 (Firebird PDO preprocessing sql). (Simonov Denis)
20+
21+
- SPL:
22+
. SplFixedArray is now IteratorAggregate rather than Iterator. (alexdowad)
23+
24+
- Zlib:
25+
. Fixed bug #78792 (zlib.output_compression disabled by Content-Type: image/).
26+
(cmb)
27+
1128
17 Sep 2020, PHP 8.0.0beta4
1229

1330
- Core:

UPGRADING

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ PHP 8.0 UPGRADE NOTES
254254
__wakeup(): void
255255

256256
RFC: https://wiki.php.net/rfc/magic-methods-signature
257+
. call_user_func_array() array keys will now be interpreted as parameter names,
258+
instead of being silently ignored.
257259

258260
- COM:
259261
. Removed the ability to import case-insensitive constants from type
@@ -325,6 +327,10 @@ PHP 8.0 UPGRADE NOTES
325327
. iconv() implementations which do not properly set errno in case of errors
326328
are no longer supported.
327329

330+
- IMAP:
331+
. The unused default_host argument of imap_headerinfo() has been removed.
332+
. The imap_header() function which is an alias of imap_headerinfo() has been removed.
333+
328334
- Intl:
329335
. The deprecated constant INTL_IDNA_VARIANT_2003 has been removed.
330336
RFC: https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003
@@ -335,6 +341,8 @@ PHP 8.0 UPGRADE NOTES
335341

336342
- LDAP:
337343
. The deprecated function ldap_sort has been removed.
344+
. The deprecated function ldap_control_paged_result has been removed.
345+
. The deprecated function ldap_control_paged_result_response has been removed.
338346
. The interface of ldap_set_rebind_proc has changed; the $callback parameter
339347
does not accept empty string anymore; null value shall be used instead.
340348

@@ -387,6 +395,10 @@ PHP 8.0 UPGRADE NOTES
387395
. Several alias functions have been marked as deprecated.
388396
. oci_internal_debug() and its alias ociinternaldebug() have been removed.
389397

398+
- ODBC:
399+
. odbc_connect() no longer reuses persistent connections.
400+
. The unused flags parameter of odbc_exec() has been removed.
401+
390402
- OpenSSL:
391403
. openssl_x509_read() and openssl_csr_sign() will now return an
392404
OpenSSLCertificate object rather than a resource. Return value checks using
@@ -431,6 +443,8 @@ PHP 8.0 UPGRADE NOTES
431443
. The deprecated pg_lo_import() and pg_lo_export() signature that passes the
432444
connection as the last argument is no longer supported. The connection
433445
should be passed as first argument instead.
446+
. pg_fetch_all() will now return an empty array instead of false for result
447+
sets with zero rows.
434448

435449
- Phar:
436450
. Metadata associated with a phar will no longer be automatically unserialized,
@@ -496,6 +510,12 @@ PHP 8.0 UPGRADE NOTES
496510
. spl_autoload_register() will now always throw a TypeError on invalid
497511
arguments, therefore the second argument $do_throw is ignored and a
498512
notice will be emitted if it is set to false.
513+
. SplFixedArray is now an IteratorAggregate and not an Iterator.
514+
SplFixedArray::rewind(), ::current(), ::key(), ::next(), and ::valid()
515+
have been removed. In their place, SplFixedArray::getIterator() has been
516+
added. Any code which uses explicit iteration over SplFixedArray must now
517+
obtain an Iterator through SplFixedArray::getIterator(). This means that
518+
SplFixedArray is now safe to use in nested loops.
499519

500520
- Standard:
501521
. assert() will no longer evaluate string arguments, instead they will be
@@ -644,6 +664,8 @@ PHP 8.0 UPGRADE NOTES
644664
. deflate_init() will now return a DeflateContext object rather than a
645665
resource. Return value checks using is_resource() should be replaced with
646666
checks for `false`.
667+
. zlib.output_compression is no longer automatically disabled for
668+
Content-Type: image/*.
647669

648670
========================================
649671
2. New Features
@@ -792,7 +814,7 @@ PHP 8.0 UPGRADE NOTES
792814
values rather than int.
793815

794816
- Zip:
795-
. Extension updated to version 1.19.0
817+
. Extension updated to version 1.19.1
796818
. New ZipArchive::lastId property to get index value of last added entry.
797819
. Error can be checked after an archive is closed using ZipArchive::status,
798820
ZipArchive::statusSys properties or ZipArchive::getStatusString() method.
@@ -844,6 +866,7 @@ PHP 8.0 UPGRADE NOTES
844866
- PGSQL / PDO PGSQL:
845867
. The constant PG_VERSION_STR has now the same value as PG_VERSION, and thus
846868
is deprecated.
869+
. Function aliases in the pgsql extension have been deprecated.
847870

848871
- Zip:
849872
. Using empty file as ZipArchive is deprecated. Libzip 1.6.0

UPGRADING.INTERNALS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,10 @@ PHP 8.0 INTERNALS UPGRADE NOTES
373373
- zend_get_op_array_extension_handle()
374374
10. Argument zend_extension to const char* in Zend Engine 4.0:
375375
- zend_get_resource_handle()
376+
11. Argument const char * to HMODULE in Zend Engine 4.0:
377+
- php_win32_image_compatible()
378+
12. const char * argument dropped in Zend Engine 4.0:
379+
- php_win32_crt_compatible()
376380

377381
u. Instead of overwriting zend_error_cb extensions with debugging, monitoring
378382
use-cases catching Errors/Exceptions are strongly encouraged to use
@@ -436,6 +440,14 @@ PHP 8.0 INTERNALS UPGRADE NOTES
436440
2. The PHP_CHECK_GCC_ARG() m4 macro has been removed in favor of
437441
AX_CHECK_COMPILE_FLAG().
438442

443+
3. The 6th argument of PHP_ADD_SOURCES_X has been removed.
444+
445+
4. The 'special-flags' (3rd) argument of PHP_ADD_SOURCES_X are
446+
now appended instead of prepended to previous compiler flags.
447+
This means compiler flags passed to PHP_NEW_EXTENSION and PHP_ADD_SOURCES
448+
are now appended, this allows to disable compiler flags set by Zend/Zend.m4
449+
(e.g. disable certain compiler flags enabled by -Wextra)
450+
439451
c. Windows build system changes
440452

441453
- The configuration option --enable-crt-debug has been removed. The VC

Zend/tests/008.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ echo "Done\n";
3232
--EXPECTF--
3333
TypeError: define(): Argument #1 ($constant_name) must be of type string, array given
3434

35-
Notice: Constant TRUE already defined in %s on line %d
35+
Warning: Constant TRUE already defined in %s on line %d
3636
bool(false)
3737
bool(true)
3838
bool(true)
3939
bool(true)
4040

41-
Notice: Constant test const already defined in %s on line %d
41+
Warning: Constant test const already defined in %s on line %d
4242
bool(false)
4343
bool(true)
4444
bool(true)

Zend/tests/009.phpt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ $f2 = new foo2;
2626
$f1->bar();
2727
$f2->bar();
2828

29-
var_dump(get_class());
29+
try {
30+
var_dump(get_class());
31+
} catch (Error $e) {
32+
echo $e->getMessage(), "\n";
33+
}
3034
try {
3135
var_dump(get_class("qwerty"));
3236
} catch (TypeError $e) {
@@ -40,12 +44,10 @@ $f1->testNull();
4044

4145
echo "Done\n";
4246
?>
43-
--EXPECTF--
47+
--EXPECT--
4448
string(3) "foo"
4549
string(3) "foo"
46-
47-
Warning: get_class() called without object from outside a class in %s on line %d
48-
bool(false)
50+
get_class() without arguments must be called from within a class
4951
get_class(): Argument #1 ($object) must be of type object, string given
5052
string(3) "foo"
5153
string(4) "foo2"

Zend/tests/015.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ var_dump(trigger_error("error", E_USER_DEPRECATED));
2323
--EXPECTF--
2424
Notice: error in %s on line %d
2525
bool(true)
26-
trigger_error(): Argument #2 ($error_type) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
27-
trigger_error(): Argument #2 ($error_type) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
26+
trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
27+
trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
2828

2929
Warning: error in %s on line %d
3030
bool(true)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
--TEST--
2+
Test default value handling of ErrorException::__construct()
3+
--FILE--
4+
<?php
5+
6+
$e = new ErrorException();
7+
var_dump($e->getMessage());
8+
var_dump($e->getFile());
9+
var_dump($e->getLine());
10+
11+
$e = new ErrorException("Second", 0, E_ERROR, null);
12+
var_dump($e->getMessage());
13+
var_dump($e->getFile());
14+
var_dump($e->getLine());
15+
16+
$e = new ErrorException("Third", 0, E_ERROR, null, null);
17+
var_dump($e->getMessage());
18+
var_dump($e->getFile());
19+
var_dump($e->getLine());
20+
21+
$e = new ErrorException("Forth", 0, E_ERROR, null, 123);
22+
var_dump($e->getMessage());
23+
var_dump($e->getFile());
24+
var_dump($e->getLine());
25+
26+
$e = new ErrorException("Fifth", 0, E_ERROR, "abc.php");
27+
var_dump($e->getMessage());
28+
var_dump($e->getFile());
29+
var_dump($e->getLine());
30+
31+
$e = new ErrorException("Sixth", 0, E_ERROR, "abc.php", null);
32+
var_dump($e->getMessage());
33+
var_dump($e->getFile());
34+
var_dump($e->getLine());
35+
36+
$e = new ErrorException("Seventh", 0, E_ERROR, "abc.php", 123);
37+
var_dump($e->getMessage());
38+
var_dump($e->getFile());
39+
var_dump($e->getLine());
40+
41+
?>
42+
--EXPECTF--
43+
string(0) ""
44+
string(%d) "%sErrorException_construct.php"
45+
int(3)
46+
string(6) "Second"
47+
string(%d) "%sErrorException_construct.php"
48+
int(8)
49+
string(5) "Third"
50+
string(%d) "%sErrorException_construct.php"
51+
int(13)
52+
string(5) "Forth"
53+
string(%d) "%sErrorException_construct.php"
54+
int(123)
55+
string(5) "Fifth"
56+
string(7) "abc.php"
57+
int(0)
58+
string(5) "Sixth"
59+
string(7) "abc.php"
60+
int(0)
61+
string(7) "Seventh"
62+
string(7) "abc.php"
63+
int(123)

Zend/tests/attributes/004_name_resolution.phpt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
Resolve attribute names
33
--FILE--
44
<?php
5-
function dump_attributes($attributes) {
6-
$arr = [];
7-
foreach ($attributes as $attribute) {
8-
$arr[] = ['name' => $attribute->getName(), 'args' => $attribute->getArguments()];
5+
6+
namespace {
7+
function dump_attributes($attributes) {
8+
$arr = [];
9+
foreach ($attributes as $attribute) {
10+
$arr[] = ['name' => $attribute->getName(), 'args' => $attribute->getArguments()];
11+
}
12+
var_dump($arr);
913
}
10-
var_dump($arr);
1114
}
1215

1316
namespace Doctrine\ORM\Mapping {

Zend/tests/attributes/005_objects.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,16 @@ try {
9696
}
9797

9898
?>
99-
--EXPECT--
99+
--EXPECTF--
100100
string(2) "A1"
101101
string(4) "test"
102102
int(50)
103103

104104
string(7) "ERROR 1"
105-
string(81) "Too few arguments to function A1::__construct(), 0 passed and at least 1 expected"
105+
string(%d) "Too few arguments to function A1::__construct(), 0 passed in %s005_objects.php on line 26 and at least 1 expected"
106106

107107
string(7) "ERROR 2"
108-
string(74) "A1::__construct(): Argument #1 ($name) must be of type string, array given"
108+
string(%d) "A1::__construct(): Argument #1 ($name) must be of type string, array given, called in %s005_objects.php on line 36"
109109

110110
string(7) "ERROR 3"
111111
string(30) "Attribute class "A2" not found"
Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
11
--TEST--
2-
Attributes cannot be applied to groups of class constants.
2+
Attributes can be applied to groups of class constants
33
--FILE--
44
<?php
55

6-
class C1
6+
class C
77
{
8-
#[A1]
8+
#[A(1, X)]
99
public const A = 1, B = 2;
1010
}
1111

12+
const X = 2;
13+
14+
$rp1 = new ReflectionClassConstant('C', 'A');
15+
$ra1 = $rp1->getAttributes()[0];
16+
var_dump($ra1->getName(), $ra1->getArguments());
17+
$rp2 = new ReflectionClassConstant('C', 'B');
18+
$ra2 = $rp2->getAttributes()[0];
19+
var_dump($ra2->getName(), $ra2->getArguments());
20+
1221
?>
13-
--EXPECTF--
14-
Fatal error: Cannot apply attributes to a group of constants in %s
22+
--EXPECT--
23+
string(1) "A"
24+
array(2) {
25+
[0]=>
26+
int(1)
27+
[1]=>
28+
int(2)
29+
}
30+
string(1) "A"
31+
array(2) {
32+
[0]=>
33+
int(1)
34+
[1]=>
35+
int(2)
36+
}
Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
11
--TEST--
2-
Attributes cannot be applied to groups of properties.
2+
Attributes can be applied to groups of properties
33
--FILE--
44
<?php
55

6-
class C1
6+
class C
77
{
8-
#[A1]
8+
#[A(1, X)]
99
public $x, $y;
1010
}
1111

12+
const X = 2;
13+
14+
$rp1 = new ReflectionProperty('C', 'x');
15+
$ra1 = $rp1->getAttributes()[0];
16+
var_dump($ra1->getName(), $ra1->getArguments());
17+
$rp2 = new ReflectionProperty('C', 'y');
18+
$ra2 = $rp2->getAttributes()[0];
19+
var_dump($ra2->getName(), $ra2->getArguments());
20+
1221
?>
13-
--EXPECTF--
14-
Fatal error: Cannot apply attributes to a group of properties in %s
22+
--EXPECT--
23+
string(1) "A"
24+
array(2) {
25+
[0]=>
26+
int(1)
27+
[1]=>
28+
int(2)
29+
}
30+
string(1) "A"
31+
array(2) {
32+
[0]=>
33+
int(1)
34+
[1]=>
35+
int(2)
36+
}

0 commit comments

Comments
 (0)