Skip to content

Commit 3ddac51

Browse files
committed
Merge branch 'master' into zend-ini-get-addr-void
2 parents 0501412 + 27d28ee commit 3ddac51

82 files changed

Lines changed: 1085 additions & 287 deletions

File tree

Some content is hidden

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

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
# Collapse generated files within git and pull request diff.
2323
**/*_arginfo.h linguist-generated -diff
24+
**/*_decl.h linguist-generated -diff
2425
/main/debug_gdb_scripts.c linguist-generated -diff
2526
/Zend/zend_vm_execute.h linguist-generated -diff
2627
/Zend/zend_vm_handlers.h linguist-generated -diff

.github/actions/brew/action.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@ runs:
1313
1414
# Some packages exist on x86 but not arm, or vice versa.
1515
# Install them with reinstall to avoid warnings.
16-
brew reinstall autoconf webp tidy-html5 libzip libsodium icu4c curl
17-
brew install \
16+
brew reinstall -v \
17+
autoconf \
18+
webp \
19+
tidy-html5 \
20+
libzip \
21+
libsodium \
22+
icu4c \
23+
curl
24+
brew install -v \
1825
bison \
1926
re2c
20-
brew install \
27+
brew install -v \
2128
bzip2 \
2229
enchant \
2330
libffi \

.github/workflows/nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ jobs:
363363
- name: Update clang
364364
uses: ./.github/actions/macos-update-clang
365365
- name: brew
366+
timeout-minutes: 10
366367
uses: ./.github/actions/brew
367368
- name: ./configure
368369
uses: ./.github/actions/configure-macos

.github/workflows/push.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ jobs:
242242
- name: Update clang
243243
uses: ./.github/actions/macos-update-clang
244244
- name: brew
245+
timeout-minutes: 10
245246
uses: ./.github/actions/brew
246247
- name: ccache
247248
uses: hendrikmuhs/ccache-action@v1.2

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ PHP NEWS
1313
. Fixed GH-20564 (Don't call autoloaders with pending exception). (ilutov)
1414
. Fix deprecation now showing when accessing null key of an array with JIT.
1515
(alexandre-daubois)
16+
. Fixed bug GH-20174 (Assertion failure in
17+
ReflectionProperty::skipLazyInitialization after failed LazyProxy
18+
initialization). (Arnaud)
1619

1720
- Date:
1821
. Update timelib to 2022.16. (Derick)

UPGRADING.INTERNALS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,20 @@ PHP 8.6 INTERNALS UPGRADE NOTES
6060
automatically unwrap references when the result of the call is stored in an
6161
IS_TMP_VAR variable. This may be achieved by calling the
6262
zend_return_unwrap_ref() function.
63+
. The php_math_round_mode_from_enum() function now takes a
64+
zend_enum_RoundingMode parameter.
65+
. Added Z_PARAM_ENUM().
66+
. Added zend_enum_fetch_case_id().
6367

6468
========================
6569
2. Build system changes
6670
========================
6771

72+
. build/gen_stub.php may now generate a _decl.h file in addition to
73+
the _arginfo.h file, if the stub declares enums and is annotated with
74+
@generate-c-enums. For each enum the file will contain a C enum. Enum values
75+
can be compared to the result of zend_enum_fetch_case_id(zend_object*).
76+
6877
========================
6978
3. Module changes
7079
========================
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--TEST--
2+
GH-20174: Assertion failure in ReflectionProperty::skipLazyInitialization after failed LazyProxy skipLazyInitialization
3+
--CREDITS--
4+
vi3tL0u1s
5+
--FILE--
6+
<?php
7+
8+
class C {
9+
public $b;
10+
public $c;
11+
}
12+
13+
$reflector = new ReflectionClass(C::class);
14+
15+
$obj = $reflector->newLazyProxy(function ($obj) {
16+
$obj->b = 4;
17+
throw new Exception();
18+
});
19+
20+
try {
21+
$reflector->initializeLazyObject($obj);
22+
} catch (Exception $e) {
23+
$reflector->getProperty('b')->skipLazyInitialization($obj);
24+
}
25+
26+
var_dump($obj);
27+
28+
?>
29+
--EXPECTF--
30+
lazy proxy object(C)#%d (1) {
31+
["b"]=>
32+
NULL
33+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
GH-20504: Assertion failure in zend_get_property_guard() when lazy proxy adds magic method - isset
3+
--CREDITS--
4+
vi3tL0u1s
5+
--FILE--
6+
<?php
7+
8+
class RealInstance {
9+
public $_;
10+
}
11+
class Proxy extends RealInstance {
12+
public function __isset($name) {
13+
return isset($this->$name['']);
14+
}
15+
}
16+
$rc = new ReflectionClass(Proxy::class);
17+
$obj = $rc->newLazyProxy(function () {
18+
return new RealInstance;
19+
});
20+
var_dump(isset($obj->name['']));
21+
22+
?>
23+
--EXPECT--
24+
bool(false)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
GH-20504: Assertion failure in zend_get_property_guard() when lazy proxy adds magic method - get
3+
--FILE--
4+
<?php
5+
6+
class RealInstance {
7+
public $_;
8+
}
9+
class Proxy extends RealInstance {
10+
public function __get($name) {
11+
return $this->$name;
12+
}
13+
}
14+
$rc = new ReflectionClass(Proxy::class);
15+
$obj = $rc->newLazyProxy(function () {
16+
return new RealInstance;
17+
});
18+
var_dump($obj->name);
19+
20+
?>
21+
--EXPECTF--
22+
Warning: Undefined property: RealInstance::$name in %s on line %d
23+
NULL
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--TEST--
2+
GH-20504: Assertion failure in zend_get_property_guard() when lazy proxy adds magic method - set
3+
--FILE--
4+
<?php
5+
6+
#[AllowDynamicProperties]
7+
class RealInstance {
8+
public $_;
9+
}
10+
class Proxy extends RealInstance {
11+
public function __set($name, $value) {
12+
$this->$name = $value;
13+
}
14+
}
15+
$rc = new ReflectionClass(Proxy::class);
16+
$obj = $rc->newLazyProxy(function () {
17+
return new RealInstance;
18+
});
19+
$obj->name = 0;
20+
21+
var_dump($obj);
22+
23+
?>
24+
--EXPECTF--
25+
lazy proxy object(Proxy)#%d (1) {
26+
["instance"]=>
27+
object(RealInstance)#%d (2) {
28+
["_"]=>
29+
NULL
30+
["name"]=>
31+
int(0)
32+
}
33+
}

0 commit comments

Comments
 (0)