Skip to content

Address Change Requests #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Zend/tests/attributes/013_class_scope.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ class C2

$ref = new \ReflectionClass(C2::class);
print_r($ref->getMethod('foo')->getAttributes()[0]->getArguments());

$ref = new \ReflectionClass(T1::class);
$attr = $ref->getMethod('foo')->getAttributes()[0];

try {
$attr->getArguments();
} catch (\Error $e) {
var_dump('ERROR 1', $e->getMessage());
}

echo "\n";

class C3
Expand Down Expand Up @@ -98,6 +108,8 @@ Array
[0] => C2
[1] => bar
)
string(7) "ERROR 1"
string(36) "Undefined class constant 'self::FOO'"

bool(true)
string(3) "bar"
Expand Down
18 changes: 4 additions & 14 deletions ext/opcache/zend_file_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,8 @@ static void zend_file_cache_serialize_attribute(zval *zv,
attr = Z_PTR_P(zv);
UNSERIALIZE_PTR(attr);

if (!IS_SERIALIZED(attr->name)) {
SERIALIZE_STR(attr->name);
}

if (!IS_SERIALIZED(attr->lcname)) {
SERIALIZE_STR(attr->lcname);
}
SERIALIZE_STR(attr->name);
SERIALIZE_STR(attr->lcname);

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

if (!IS_UNSERIALIZED(attr->name)) {
UNSERIALIZE_STR(attr->name);
}

if (!IS_UNSERIALIZED(attr->lcname)) {
UNSERIALIZE_STR(attr->lcname);
}
UNSERIALIZE_STR(attr->name);
UNSERIALIZE_STR(attr->lcname);

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