Skip to content
forked from php/php-src

Commit ee2ba03

Browse files
authored
Merge pull request #5 from php/master
sync master
2 parents 728d914 + c0f8cc1 commit ee2ba03

File tree

1,473 files changed

+4816
-6096
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,473 files changed

+4816
-6096
lines changed

NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ 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)
510

611
17 Sep 2020, PHP 8.0.0beta4
712

UPGRADING

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,8 @@ PHP 8.0 UPGRADE NOTES
598598
. sem_get() will now return an SysvSemaphore object rather than a resource.
599599
Return value checks using is_resource() should be replaced with checks
600600
for `false`.
601+
. The $auto_release parameter of sem_get() was changed to accept bool values
602+
rather than int.
601603

602604
- Sysvshm:
603605
. shm_attach() will now return an SysvSharedMemory object rather than a resource.
@@ -786,6 +788,8 @@ PHP 8.0 UPGRADE NOTES
786788
array_diff($array, ...$excludes);
787789
// OK even if $arrays only contains a single array.
788790
array_intersect(...$arrays);
791+
. The $flag parameter of ob_implicit_flush() was changed to accept bool
792+
values rather than int.
789793

790794
- Zip:
791795
. Extension updated to version 1.19.0
@@ -1029,7 +1033,7 @@ PHP 8.0 UPGRADE NOTES
10291033

10301034
- MySQLi / PDO MySQL:
10311035
. When mysqlnd is not used (which is the default and recommended option),
1032-
the minimum supported libmysqlclient version is now 5.1.
1036+
the minimum supported libmysqlclient version is now 5.5.
10331037
. mysqli_result now implements IteratorAggregate (instead of Traversable).
10341038

10351039
- PGSQL / PDO PGSQL:

UPGRADING.INTERNALS

Lines changed: 10 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,10 @@ 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()
370376

371377
u. Instead of overwriting zend_error_cb extensions with debugging, monitoring
372378
use-cases catching Errors/Exceptions are strongly encouraged to use
@@ -395,6 +401,10 @@ PHP 8.0 INTERNALS UPGRADE NOTES
395401
w. The following APIs have been renamed:
396402
- _zend_ts_hash_init() to zend_ts_hash_init()
397403

404+
x. In COMPILE_EXTENDED_STMT mode, a ZEND_EXT_NOP opcode will no longer be
405+
generated at the start of a function. Use the new observer APIs or hook
406+
into zend_execute_ex instead.
407+
398408
========================
399409
2. Build system changes
400410
========================

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/005_objects.phpt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,68 +6,68 @@ Attributes can be converted into objects.
66
#[Attribute(Attribute::TARGET_FUNCTION)]
77
class A1
88
{
9-
public string $name;
10-
public int $ttl;
11-
12-
public function __construct(string $name, int $ttl = 50)
13-
{
14-
$this->name = $name;
15-
$this->ttl = $ttl;
16-
}
9+
public string $name;
10+
public int $ttl;
11+
12+
public function __construct(string $name, int $ttl = 50)
13+
{
14+
$this->name = $name;
15+
$this->ttl = $ttl;
16+
}
1717
}
1818

1919
$ref = new \ReflectionFunction(#[A1('test')] function () { });
2020

2121
foreach ($ref->getAttributes() as $attr) {
22-
$obj = $attr->newInstance();
22+
$obj = $attr->newInstance();
2323

24-
var_dump(get_class($obj), $obj->name, $obj->ttl);
24+
var_dump(get_class($obj), $obj->name, $obj->ttl);
2525
}
2626

2727
echo "\n";
2828

2929
$ref = new \ReflectionFunction(#[A1] function () { });
3030

3131
try {
32-
$ref->getAttributes()[0]->newInstance();
32+
$ref->getAttributes()[0]->newInstance();
3333
} catch (\ArgumentCountError $e) {
34-
var_dump('ERROR 1', $e->getMessage());
34+
var_dump('ERROR 1', $e->getMessage());
3535
}
3636

3737
echo "\n";
3838

3939
$ref = new \ReflectionFunction(#[A1([])] function () { });
4040

4141
try {
42-
$ref->getAttributes()[0]->newInstance();
42+
$ref->getAttributes()[0]->newInstance();
4343
} catch (\TypeError $e) {
44-
var_dump('ERROR 2', $e->getMessage());
44+
var_dump('ERROR 2', $e->getMessage());
4545
}
4646

4747
echo "\n";
4848

4949
$ref = new \ReflectionFunction(#[A2] function () { });
5050

5151
try {
52-
$ref->getAttributes()[0]->newInstance();
52+
$ref->getAttributes()[0]->newInstance();
5353
} catch (\Error $e) {
54-
var_dump('ERROR 3', $e->getMessage());
54+
var_dump('ERROR 3', $e->getMessage());
5555
}
5656

5757
echo "\n";
5858

5959
#[Attribute]
6060
class A3
6161
{
62-
private function __construct() { }
62+
private function __construct() { }
6363
}
6464

6565
$ref = new \ReflectionFunction(#[A3] function () { });
6666

6767
try {
68-
$ref->getAttributes()[0]->newInstance();
68+
$ref->getAttributes()[0]->newInstance();
6969
} catch (\Error $e) {
70-
var_dump('ERROR 4', $e->getMessage());
70+
var_dump('ERROR 4', $e->getMessage());
7171
}
7272

7373
echo "\n";
@@ -78,9 +78,9 @@ class A4 { }
7878
$ref = new \ReflectionFunction(#[A4(1)] function () { });
7979

8080
try {
81-
$ref->getAttributes()[0]->newInstance();
81+
$ref->getAttributes()[0]->newInstance();
8282
} catch (\Error $e) {
83-
var_dump('ERROR 5', $e->getMessage());
83+
var_dump('ERROR 5', $e->getMessage());
8484
}
8585

8686
echo "\n";
@@ -90,9 +90,9 @@ class A5 { }
9090
$ref = new \ReflectionFunction(#[A5] function () { });
9191

9292
try {
93-
$ref->getAttributes()[0]->newInstance();
93+
$ref->getAttributes()[0]->newInstance();
9494
} catch (\Error $e) {
95-
var_dump('ERROR 6', $e->getMessage());
95+
var_dump('ERROR 6', $e->getMessage());
9696
}
9797

9898
?>

Zend/tests/attributes/006_filter.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ echo "\n";
5555
$ref = new \ReflectionFunction(function () { });
5656

5757
try {
58-
$ref->getAttributes(A1::class, 3);
58+
$ref->getAttributes(A1::class, 3);
5959
} catch (\Error $e) {
60-
var_dump('ERROR 1', $e->getMessage());
60+
var_dump('ERROR 1', $e->getMessage());
6161
}
6262

6363
$ref = new \ReflectionFunction(function () { });
6464

6565
try {
66-
$ref->getAttributes(SomeMissingClass::class, \ReflectionAttribute::IS_INSTANCEOF);
66+
$ref->getAttributes(SomeMissingClass::class, \ReflectionAttribute::IS_INSTANCEOF);
6767
} catch (\Error $e) {
68-
var_dump('ERROR 2', $e->getMessage());
68+
var_dump('ERROR 2', $e->getMessage());
6969
}
7070

7171
?>

Zend/tests/attributes/011_inheritance.phpt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ Attributes comply with inheritance rules.
66
#[A2]
77
class C1
88
{
9-
#[A1]
10-
public function foo() { }
9+
#[A1]
10+
public function foo() { }
1111
}
1212

1313
class C2 extends C1
1414
{
15-
public function foo() { }
15+
public function foo() { }
1616
}
1717

1818
class C3 extends C1
1919
{
20-
#[A1]
21-
public function bar() { }
20+
#[A1]
21+
public function bar() { }
2222
}
2323

2424
$ref = new \ReflectionClass(C1::class);
@@ -37,20 +37,20 @@ echo "\n";
3737

3838
trait T1
3939
{
40-
#[A2]
41-
public $a;
40+
#[A2]
41+
public $a;
4242
}
4343

4444
class C4
4545
{
46-
use T1;
46+
use T1;
4747
}
4848

4949
class C5
5050
{
51-
use T1;
51+
use T1;
5252

53-
public $a;
53+
public $a;
5454
}
5555

5656
$ref = new \ReflectionClass(T1::class);

Zend/tests/attributes/012_ast_export.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ assert(0 && ($a = #[A1] #[A2] function ($a, #[A3(1)] $b) { }));
1212
assert(0 && ($a = #[A1(1, 2, 1 + 2)] fn () => 1));
1313

1414
assert(0 && ($a = new #[A1] class() {
15-
#[A1]#[A2] const FOO = 'foo';
16-
#[A2] public $x;
17-
#[A3] function a() { }
15+
#[A1]#[A2] const FOO = 'foo';
16+
#[A2] public $x;
17+
#[A3] function a() { }
1818
}));
1919

2020
assert(0 && ($a = function () {
21-
#[A1] class Test1 { }
22-
#[A2] interface Test2 { }
23-
#[A3] trait Test3 { }
21+
#[A1] class Test1 { }
22+
#[A2] interface Test2 { }
23+
#[A3] trait Test3 { }
2424
}));
2525

2626
?>

0 commit comments

Comments
 (0)