mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 10:56:38 +00:00
Use spl_object_id() instead of spl_object_hash()
This commit is contained in:
@@ -42,7 +42,7 @@ final class SafeAnalysisNodeVisitor implements NodeVisitorInterface
|
|||||||
*/
|
*/
|
||||||
public function getSafe(Node $node)
|
public function getSafe(Node $node)
|
||||||
{
|
{
|
||||||
$hash = spl_object_hash($node);
|
$hash = spl_object_id($node);
|
||||||
if (!isset($this->data[$hash])) {
|
if (!isset($this->data[$hash])) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ final class SafeAnalysisNodeVisitor implements NodeVisitorInterface
|
|||||||
|
|
||||||
private function setSafe(Node $node, array $safe): void
|
private function setSafe(Node $node, array $safe): void
|
||||||
{
|
{
|
||||||
$hash = spl_object_hash($node);
|
$hash = spl_object_id($node);
|
||||||
if (isset($this->data[$hash])) {
|
if (isset($this->data[$hash])) {
|
||||||
foreach ($this->data[$hash] as &$bucket) {
|
foreach ($this->data[$hash] as &$bucket) {
|
||||||
if ($bucket['key'] === $node) {
|
if ($bucket['key'] === $node) {
|
||||||
|
|||||||
Reference in New Issue
Block a user