Skip to content

Commit 651f1cb

Browse files
Merge pull request #1 from php/master
Updating fork
2 parents 3053f6f + f888674 commit 651f1cb

File tree

282 files changed

+6286
-3339
lines changed

Some content is hidden

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

282 files changed

+6286
-3339
lines changed

NEWS

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
?? ??? ????, PHP 8.0.0rc1
3+
?? ??? ????, PHP 8.0.0RC1
4+
5+
6+
17 Sep 2020, PHP 8.0.0beta4
47

58
- Core:
69
. Implement #[Attr] Attribute syntax as per final vote in RFC
710
https://wiki.php.net/rfc/shorter_attribute_syntax_change
811
. Fixed bug #80045 (memleak after two set_exception_handler calls with
912
__call). (Nikita)
13+
. Fixed bug #80096 (Segmentation fault with named arguments in nested call).
14+
(Nikita)
15+
. Fixed faulty generator cleanup with yield from. (Bob)
1016

1117
- Date:
1218
. Fixed bug #80057 (DateTimeImmutable::createFromFormat() does not populate

UPGRADING.INTERNALS

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,19 +370,19 @@ PHP 8.0 INTERNALS UPGRADE NOTES
370370

371371
u. Instead of overwriting zend_error_cb extensions with debugging, monitoring
372372
use-cases catching Errors/Exceptions are strongly encouraged to use
373-
the new error notification API instead.
373+
the new error observer API instead.
374374

375-
Error notification callbacks are guaranteed to be called regardless of
375+
Error observering callbacks are guaranteed to be called regardless of
376376
the users error_reporting setting or userland error handler return values.
377377

378-
Register notification callbacks during MINIT of an extension:
378+
Register observer callbacks during MINIT of an extension:
379379

380-
void my_error_notify_cb(int type,
380+
void my_error_observer_cb(int type,
381381
const char *error_filename,
382382
uint32_t error_lineno,
383383
zend_string *message) {
384384
}
385-
zend_register_error_notify_callback(my_error_notify_cb);
385+
zend_observer_error_register(my_error_observer_cb);
386386

387387
v. The following APIs have been removed from the Zend Engine:
388388
- zend_ts_hash_init_ex(), drop the last argument and use zend_ts_hash_init() instead

Zend/tests/bug31720.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ try {
1212
?>
1313
--EXPECTF--
1414
Warning: Undefined variable $nonesuchvar in %s on line %d
15-
array_walk(): Argument #2 ($funcname) must be a valid callback, first array member is not a valid class name or object
15+
array_walk(): Argument #2 ($callback) must be a valid callback, first array member is not a valid class name or object

Zend/tests/bug41026.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ echo "Done\n";
2323
--EXPECT--
2424
Done
2525

26-
Warning: (Registered shutdown functions) Unable to call self::on_shutdown() - function does not exist in Unknown on line 0
26+
Fatal error: Registered shutdown function self::on_shutdown() cannot be called, function does not exist in Unknown on line 0

Zend/tests/bug52355.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ $foo = -sin(0);
1010

1111
var_dump($foo);
1212

13-
var_dump(@(1.0 / -0.0));
13+
try {
14+
var_dump(1.0 / -0.0);
15+
} catch (\DivisionByZeroError $e) {
16+
echo $e->getMessage() . \PHP_EOL;
17+
}
1418

1519
?>
1620
--EXPECT--
1721
float(-0)
1822
float(-0)
1923
float(-0)
20-
float(-INF)
24+
Division by zero

Zend/tests/bug69957.phpt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,26 @@ try {
6060
}
6161

6262
?>
63-
--EXPECTF--
64-
Warning: Division by zero in %sbug69957.php on line %d
65-
float(INF)
63+
--EXPECT--
64+
Variable div
65+
Type: DivisionByZeroError
66+
Message: Division by zero
6667

6768
Variable mod
6869
Type: DivisionByZeroError
6970
Message: Modulo by zero
7071

71-
Warning: Division by zero in %sbug69957.php on line %d
72-
float(INF)
72+
Literal div
73+
Type: DivisionByZeroError
74+
Message: Division by zero
7375

7476
Literal mod
7577
Type: DivisionByZeroError
7678
Message: Modulo by zero
7779

78-
Warning: Division by zero in %sbug69957.php on line %d
79-
float(INF)
80+
Double div
81+
Type: DivisionByZeroError
82+
Message: Division by zero
8083

8184
Double mod
8285
Type: DivisionByZeroError

Zend/tests/bug76667.phpt

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,14 @@ class T {
1616
}
1717

1818
$x = new T;
19-
$x->x = 1;
19+
try {
20+
$x->x = 1;
21+
} catch (\DivisionByZeroError $e) {
22+
echo $e->getMessage() . \PHP_EOL;
23+
}
2024
?>
2125
--EXPECTF--
2226
Warning: Undefined variable $undefined in %s on line %d
2327

2428
Warning: Attempt to read property "1" on null in %s on line %d
25-
26-
Warning: Division by zero in %s on line %d
27-
28-
Warning: Undefined variable $undefined in %s on line %d
29-
30-
Warning: Attempt to read property "NAN" on null in %s on line %d
31-
32-
Warning: Division by zero in %s on line %d
33-
34-
Warning: Undefined variable $undefined in %s on line %d
35-
36-
Warning: Attempt to read property "NAN" on null in %s on line %d
37-
38-
Warning: Division by zero in %s on line %d
29+
Division by zero

Zend/tests/bug80096.phpt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
Bug #80096: Segmentation fault with named arguments in nested call
3+
--FILE--
4+
<?php
5+
6+
function println($arg) {
7+
echo $arg, "\n";
8+
}
9+
10+
println(htmlentities("The < character is encoded as &lt;", double_encode: false));
11+
12+
?>
13+
--EXPECT--
14+
The &lt; character is encoded as &lt;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
A generator can be yielded from multiple times, testing immediate release of the yield from'ing generator
3+
--FILE--
4+
<?php
5+
6+
function gen() {
7+
yield 42;
8+
}
9+
function yield_from($gen) {
10+
yield from $gen;
11+
}
12+
$gen = gen();
13+
var_dump(yield_from($gen)->current());
14+
var_dump(yield_from($gen)->current());
15+
16+
?>
17+
--EXPECT--
18+
int(42)
19+
int(42)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--TEST--
2+
Impossible to yield from a generator which already failed, nested version
3+
--FILE--
4+
<?php
5+
6+
function from() {
7+
yield 0;
8+
throw new Exception();
9+
}
10+
function gen($gen) {
11+
yield from $gen;
12+
}
13+
14+
$gen1 = from();
15+
$gen2 = gen($gen1);
16+
$gen3 = gen($gen1);
17+
try {
18+
$gen2->next();
19+
} catch (Exception $e) {
20+
unset($gen2);
21+
}
22+
$gen3->next();
23+
24+
?>
25+
--EXPECTF--
26+
Fatal error: Uncaught Error: Generator passed to yield from was aborted without proper return and is unable to continue in %s:%d
27+
Stack trace:
28+
#0 [internal function]: gen(Object(Generator))
29+
#1 %s(%d): Generator->next()
30+
#2 {main}
31+
thrown in %s on line %d

0 commit comments

Comments
 (0)