Skip to content

Commit 1e47f0f

Browse files
minor #33180 [ProxyManager] fix closure binding (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [ProxyManager] fix closure binding | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #33037 | License | MIT | Doc PR | - Follows #32992 Commits ------- 31f9208 [ProxyManager] fix closure binding
2 parents 08147dd + 31f9208 commit 1e47f0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function getProxyCode(Definition $definition)
113113
}
114114

115115
if (version_compare(self::getProxyManagerVersion(), '2.5', '<')) {
116-
$code = str_replace(' \Closure::bind(function ', ' \Closure::bind(static function ', $code);
116+
$code = preg_replace('/ \\\\Closure::bind\(function ((?:& )?\(\$instance(?:, \$value)?\))/', ' \Closure::bind(static function \1', $code);
117117
}
118118

119119
return $code;

0 commit comments

Comments
 (0)