Skip to content

Commit 9fb6542

Browse files
committed
Merge branch 'master' of https://github.com/php/php-src
2 parents a73433c + 1f86339 commit 9fb6542

File tree

241 files changed

+5826
-3520
lines changed

Some content is hidden

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

241 files changed

+5826
-3520
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ environment:
2323
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
2424
PHP_BUILD_OBJ_DIR: c:\obj
2525
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
26-
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0beta6
26+
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0
2727
PHP_BUILD_CRT: vc15
2828
# ext and env setup for tests
2929
#MYSQL_TEST_PASSWD: Password12!

UPGRADING

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ PHP 8.0 UPGRADE NOTES
178178
ReflectionFunction::invoke($arg = null, ...$args)
179179
ReflectionMethod::invoke($object, $arg = null, ...$args)
180180

181+
- Socket:
182+
. The deprecated AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES
183+
flags for socket_addrinfo_lookup() have been removed.
184+
181185
- SPL:
182186
. SplFileObject::fgetss() has been removed.
183187
. SplHeap::compare($a, $b) now specifies a method signature. Inheriting
@@ -198,6 +202,7 @@ PHP 8.0 UPGRADE NOTES
198202
string. Previously non-string needles were interpreted as an ASCII code
199203
point. An explicit call to chr() can be used to restore the previous
200204
behavior.
205+
. The needle argument for strpos(), strrpos(), stripos(), strripos(), strstr() and stristr() can now be empty.
201206
. The 'salt' option of password_hash() is no longer supported. If the 'salt'
202207
option is used a warning is generated, the provided salt is ignored, and a
203208
generated salt is used instead.

Zend/tests/009.phpt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ class foo {
99
}
1010
function testNull ()
1111
{
12-
var_dump(get_class(null));
12+
try {
13+
var_dump(get_class(null));
14+
} catch (TypeError $e) {
15+
echo $e->getMessage(), "\n";
16+
}
1317
}
1418
}
1519

@@ -23,7 +27,11 @@ $f1->bar();
2327
$f2->bar();
2428

2529
var_dump(get_class());
26-
var_dump(get_class("qwerty"));
30+
try {
31+
var_dump(get_class("qwerty"));
32+
} catch (TypeError $e) {
33+
echo $e->getMessage(), "\n";
34+
}
2735

2836
var_dump(get_class($f1));
2937
var_dump(get_class($f2));
@@ -38,12 +46,8 @@ string(3) "foo"
3846

3947
Warning: get_class() called without object from outside a class in %s on line %d
4048
bool(false)
41-
42-
Warning: get_class() expects parameter 1 to be object, string given in %s on line %d
43-
bool(false)
49+
get_class() expects parameter 1 to be object, string given
4450
string(3) "foo"
4551
string(4) "foo2"
46-
47-
Warning: get_class() expects parameter 1 to be object, null given in %s on line %d
48-
bool(false)
52+
get_class() expects parameter 1 to be object, null given
4953
Done

Zend/tests/bug71221.phpt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ Bug #71221 (Null pointer deref (segfault) in get_defined_vars via ob_start)
33
--FILE--
44
<?php
55
ob_start("get_defined_vars");
6-
ob_end_clean();
6+
try {
7+
ob_end_clean();
8+
} catch (\Error $e) {
9+
echo $e->getMessage();
10+
}
711
?>
8-
okey
12+
13+
OKAY
914
--EXPECT--
10-
okey
15+
Cannot call get_defined_vars() dynamically
16+
OKAY

Zend/tests/bug72107.phpt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ set_error_handler('func_get_args');
66
function test($a) {
77
echo $undef;
88
}
9-
test(1);
9+
try {
10+
test(1);
11+
} catch (\Error $e) {
12+
echo $e->getMessage();
13+
}
1014
?>
11-
--EXPECTF--
12-
Warning: Cannot call func_get_args() dynamically in %s on line %d
13-
14-
Notice: Undefined variable: undef in %s on line %d
15+
--EXPECT--
16+
Cannot call func_get_args() dynamically

Zend/tests/bug78335.phpt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--TEST--
2+
Bug #78335: Static properties/variables containing cycles report as leak
3+
--FILE--
4+
<?php
5+
6+
class Test {
7+
public static $test;
8+
9+
public static function method() {
10+
static $foo;
11+
$foo = [&$foo];
12+
}
13+
}
14+
15+
function test() {
16+
static $foo;
17+
$foo = [&$foo];
18+
}
19+
20+
$foo = [&$foo];
21+
Test::$test = $foo;
22+
test();
23+
Test::method();
24+
25+
?>
26+
===DONE===
27+
--EXPECT--
28+
===DONE===

Zend/tests/bug78454_1.phpt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--TEST--
2+
Invalid consecutive numeric separators after hex literal
3+
--FILE--
4+
<?php
5+
0x0__F;
6+
--EXPECTF--
7+
Parse error: syntax error, unexpected '__F' (T_STRING) in %s on line %d

Zend/tests/bug78454_2.phpt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--TEST--
2+
Invalid consecutive numeric separators after binary literal
3+
--FILE--
4+
<?php
5+
0b0__1
6+
--EXPECTF--
7+
Parse error: syntax error, unexpected '__1' (T_STRING) in %s on line %d

Zend/tests/closure_062.phpt

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
--TEST--
2+
Closure $this unbinding deprecation
3+
--FILE--
4+
<?php
5+
6+
class Test {
7+
public function method() {
8+
echo "instance scoped, non-static, \$this used\n";
9+
$fn = function() {
10+
var_dump($this);
11+
};
12+
$fn->bindTo(null);
13+
echo "instance scoped, static, \$this used\n";
14+
$fn = static function() {
15+
var_dump($this);
16+
};
17+
$fn->bindTo(null);
18+
echo "instance scoped, non-static, \$this not used\n";
19+
$fn = function() {
20+
var_dump($notThis);
21+
};
22+
$fn->bindTo(null);
23+
}
24+
25+
public static function staticMethod() {
26+
echo "static scoped, non-static, \$this used\n";
27+
$fn = function() {
28+
var_dump($this);
29+
};
30+
$fn->bindTo(null);
31+
echo "static scoped, static, \$this used\n";
32+
$fn = static function() {
33+
var_dump($this);
34+
};
35+
$fn->bindTo(null);
36+
echo "static scoped, static, \$this not used\n";
37+
$fn = function() {
38+
var_dump($notThis);
39+
};
40+
$fn->bindTo(null);
41+
}
42+
}
43+
44+
(new Test)->method();
45+
Test::staticMethod();
46+
47+
?>
48+
--EXPECTF--
49+
instance scoped, non-static, $this used
50+
51+
Deprecated: Unbinding $this of closure is deprecated in %s on line %d
52+
instance scoped, static, $this used
53+
instance scoped, non-static, $this not used
54+
static scoped, non-static, $this used
55+
static scoped, static, $this used
56+
static scoped, static, $this not used

Zend/tests/closure_extra_args.phpt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--TEST--
2+
Immediately invoked closure with extra args
3+
--FILE--
4+
<?php
5+
6+
(function() {})(new stdClass);
7+
8+
?>
9+
===DONE===
10+
--EXPECT--
11+
===DONE===

0 commit comments

Comments
 (0)