Skip to content

Commit 20aceb5

Browse files
authored
Merge pull request #17 from koolkode/Cleanup2
Address Change Requests
2 parents c643232 + fb29945 commit 20aceb5

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

Zend/tests/attributes/013_class_scope.phpt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ class C2
4040

4141
$ref = new \ReflectionClass(C2::class);
4242
print_r($ref->getMethod('foo')->getAttributes()[0]->getArguments());
43+
44+
$ref = new \ReflectionClass(T1::class);
45+
$attr = $ref->getMethod('foo')->getAttributes()[0];
46+
47+
try {
48+
$attr->getArguments();
49+
} catch (\Error $e) {
50+
var_dump('ERROR 1', $e->getMessage());
51+
}
52+
4353
echo "\n";
4454

4555
class C3
@@ -98,6 +108,8 @@ Array
98108
[0] => C2
99109
[1] => bar
100110
)
111+
string(7) "ERROR 1"
112+
string(36) "Undefined class constant 'self::FOO'"
101113

102114
bool(true)
103115
string(3) "bar"

ext/opcache/zend_file_cache.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,8 @@ static void zend_file_cache_serialize_attribute(zval *zv,
411411
attr = Z_PTR_P(zv);
412412
UNSERIALIZE_PTR(attr);
413413

414-
if (!IS_SERIALIZED(attr->name)) {
415-
SERIALIZE_STR(attr->name);
416-
}
417-
418-
if (!IS_SERIALIZED(attr->lcname)) {
419-
SERIALIZE_STR(attr->lcname);
420-
}
414+
SERIALIZE_STR(attr->name);
415+
SERIALIZE_STR(attr->lcname);
421416

422417
for (i = 0; i < attr->argc; i++) {
423418
zend_file_cache_serialize_zval(&attr->argv[i], script, info, buf);
@@ -1179,13 +1174,8 @@ static void zend_file_cache_unserialize_attribute(zval *zv, zend_persistent_scri
11791174
UNSERIALIZE_PTR(Z_PTR_P(zv));
11801175
attr = Z_PTR_P(zv);
11811176

1182-
if (!IS_UNSERIALIZED(attr->name)) {
1183-
UNSERIALIZE_STR(attr->name);
1184-
}
1185-
1186-
if (!IS_UNSERIALIZED(attr->lcname)) {
1187-
UNSERIALIZE_STR(attr->lcname);
1188-
}
1177+
UNSERIALIZE_STR(attr->name);
1178+
UNSERIALIZE_STR(attr->lcname);
11891179

11901180
for (i = 0; i < attr->argc; i++) {
11911181
zend_file_cache_unserialize_zval(&attr->argv[i], script, buf);

0 commit comments

Comments
 (0)