Skip to content

Commit 7cb78d6

Browse files
committed
2 parents 9d50990 + 3f52368 commit 7cb78d6

File tree

1,732 files changed

+14411
-23272
lines changed

Some content is hidden

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

1,732 files changed

+14411
-23272
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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.0.0RC1
44

5+
- CLI:
6+
. Allow debug server binding to an ephemeral port via `-S localhost:0`. (Sara)
7+
- Core:
8+
. Fixed bug #80109 (Cannot skip arguments when extended debug is enabled).
9+
(Nikita)
10+
- SPL:
11+
. SplFixedArray is now IteratorAggregate rather than Iterator. (alexdowad)
512

613
17 Sep 2020, PHP 8.0.0beta4
714

UPGRADING

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ PHP 8.0 UPGRADE NOTES
325325
. iconv() implementations which do not properly set errno in case of errors
326326
are no longer supported.
327327

328+
- IMAP:
329+
. The unused default_host argument of imap_headerinfo() has been removed.
330+
. The imap_header() function which is an alias of imap_headerinfo() has been removed.
331+
328332
- Intl:
329333
. The deprecated constant INTL_IDNA_VARIANT_2003 has been removed.
330334
RFC: https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003
@@ -431,6 +435,8 @@ PHP 8.0 UPGRADE NOTES
431435
. The deprecated pg_lo_import() and pg_lo_export() signature that passes the
432436
connection as the last argument is no longer supported. The connection
433437
should be passed as first argument instead.
438+
. pg_fetch_all() will now return an empty array instead of false for result
439+
sets with zero rows.
434440

435441
- Phar:
436442
. Metadata associated with a phar will no longer be automatically unserialized,
@@ -496,6 +502,12 @@ PHP 8.0 UPGRADE NOTES
496502
. spl_autoload_register() will now always throw a TypeError on invalid
497503
arguments, therefore the second argument $do_throw is ignored and a
498504
notice will be emitted if it is set to false.
505+
. SplFixedArray is now an IteratorAggregate and not an Iterator.
506+
SplFixedArray::rewind(), ::current(), ::key(), ::next(), and ::valid()
507+
have been removed. In their place, SplFixedArray::getIterator() has been
508+
added. Any code which uses explicit iteration over SplFixedArray must now
509+
obtain an Iterator through SplFixedArray::getIterator(). This means that
510+
SplFixedArray is now safe to use in nested loops.
499511

500512
- Standard:
501513
. assert() will no longer evaluate string arguments, instead they will be
@@ -598,6 +610,8 @@ PHP 8.0 UPGRADE NOTES
598610
. sem_get() will now return an SysvSemaphore object rather than a resource.
599611
Return value checks using is_resource() should be replaced with checks
600612
for `false`.
613+
. The $auto_release parameter of sem_get() was changed to accept bool values
614+
rather than int.
601615

602616
- Sysvshm:
603617
. shm_attach() will now return an SysvSharedMemory object rather than a resource.
@@ -786,6 +800,8 @@ PHP 8.0 UPGRADE NOTES
786800
array_diff($array, ...$excludes);
787801
// OK even if $arrays only contains a single array.
788802
array_intersect(...$arrays);
803+
. The $flag parameter of ob_implicit_flush() was changed to accept bool
804+
values rather than int.
789805

790806
- Zip:
791807
. Extension updated to version 1.19.0
@@ -840,6 +856,7 @@ PHP 8.0 UPGRADE NOTES
840856
- PGSQL / PDO PGSQL:
841857
. The constant PG_VERSION_STR has now the same value as PG_VERSION, and thus
842858
is deprecated.
859+
. Function aliases in the pgsql extension have been deprecated.
843860

844861
- Zip:
845862
. Using empty file as ZipArchive is deprecated. Libzip 1.6.0
@@ -1029,7 +1046,7 @@ PHP 8.0 UPGRADE NOTES
10291046

10301047
- MySQLi / PDO MySQL:
10311048
. When mysqlnd is not used (which is the default and recommended option),
1032-
the minimum supported libmysqlclient version is now 5.1.
1049+
the minimum supported libmysqlclient version is now 5.5.
10331050
. mysqli_result now implements IteratorAggregate (instead of Traversable).
10341051

10351052
- PGSQL / PDO PGSQL:

UPGRADING.INTERNALS

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ PHP 8.0 INTERNALS UPGRADE NOTES
2323
t. Signature changes
2424
u. Error Notification callbacks to replace zend_error_cb overwrite use-cases
2525
v. Removed Zend APIs
26+
w. Renamed Zend APIs
27+
x. ZEND_EXT_NOP no longer emitted
2628

2729
2. Build system changes
2830
a. Abstract
@@ -367,6 +369,14 @@ PHP 8.0 INTERNALS UPGRADE NOTES
367369
- zend_stack_is_empty()
368370
- zend_ts_hash_exists()
369371
- zend_ts_hash_index_exists()
372+
9. Argument void to const char* in Zend Engine 4.0:
373+
- zend_get_op_array_extension_handle()
374+
10. Argument zend_extension to const char* in Zend Engine 4.0:
375+
- 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()
370380

371381
u. Instead of overwriting zend_error_cb extensions with debugging, monitoring
372382
use-cases catching Errors/Exceptions are strongly encouraged to use
@@ -395,6 +405,10 @@ PHP 8.0 INTERNALS UPGRADE NOTES
395405
w. The following APIs have been renamed:
396406
- _zend_ts_hash_init() to zend_ts_hash_init()
397407

408+
x. In COMPILE_EXTENDED_STMT mode, a ZEND_EXT_NOP opcode will no longer be
409+
generated at the start of a function. Use the new observer APIs or hook
410+
into zend_execute_ex instead.
411+
398412
========================
399413
2. Build system changes
400414
========================

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"
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/001_placement.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ $sources = [
4141
];
4242

4343
foreach ($sources as $r) {
44-
$attr = $r->getAttributes();
45-
var_dump(get_class($r), count($attr));
44+
$attr = $r->getAttributes();
45+
var_dump(get_class($r), count($attr));
4646

4747
foreach ($attr as $a) {
4848
var_dump($a->getName(), $a->getArguments());

Zend/tests/attributes/003_ast_nodes.phpt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ define('V1', strtoupper(php_sapi_name()));
88
#[A1([V1 => V1])]
99
class C1
1010
{
11-
public const BAR = 'bar';
11+
public const BAR = 'bar';
1212
}
1313

1414
$ref = new \ReflectionClass(C1::class);
@@ -38,7 +38,7 @@ echo "\n";
3838
#[A1(self::FOO, C1::BAR)]
3939
class C3
4040
{
41-
private const FOO = 'foo';
41+
private const FOO = 'foo';
4242
}
4343

4444
$ref = new \ReflectionClass(C3::class);
@@ -62,23 +62,23 @@ echo "\n";
6262
#[Attribute]
6363
class C5
6464
{
65-
public function __construct() { }
65+
public function __construct() { }
6666
}
6767

6868
$ref = new \ReflectionFunction(#[C5(MissingClass::SOME_CONST)] function () { });
6969
$attr = $ref->getAttributes();
7070
var_dump(count($attr));
7171

7272
try {
73-
$attr[0]->getArguments();
73+
$attr[0]->getArguments();
7474
} catch (\Error $e) {
75-
var_dump($e->getMessage());
75+
var_dump($e->getMessage());
7676
}
7777

7878
try {
79-
$attr[0]->newInstance();
79+
$attr[0]->newInstance();
8080
} catch (\Error $e) {
81-
var_dump($e->getMessage());
81+
var_dump($e->getMessage());
8282
}
8383

8484
?>

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 {

0 commit comments

Comments
 (0)