8000 [PropertyAccess] Major performance improvement by dunglas · Pull Request #16294 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[PropertyAccess] Major performance improvement #16294

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

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[PropertyAccess] use get_class instead of spl_object_hash
  • Loading branch information
dunglas committed Oct 20, 2015
commit fa34c9e2a71581ea547f679c57eb94711d82f727
4 changes: 2 additions & 2 deletions src/Symfony/Component/PropertyAccess/PropertyAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private function &readProperty(&$object, $property)
throw new NoSuchPropertyException(sprintf('Cannot read property "%s" from an array. Maybe you should write the property path as "[%s]" instead?', $property, $property));
}

$key = spl_object_hash($object).'::'.$property;
$key = get_class($object).'::'.$property;

if (isset($this->readPropertyCache[$key])) {
$access = $this->readPropertyCache[$key];
Expand Down Expand Up @@ -344,7 +344,7 @@ private function writeProperty(&$object, $property, $singular, $value)
throw new NoSuchPropertyException(sprintf('Cannot write property "%s" to an array. Maybe you should write the property path as "[%s]" instead?', $property, $property));
}

$key = spl_object_hash($object).'::'.$property;
$key = get_class($object).'::'.$property;

if (isset($this->writePropertyCache[$key])) {
$access = $this->writePropertyCache[$key];
Expand Down
0