Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 31f9208

Browse files
[ProxyManager] fix closure binding
1 parent 6a13826 commit 31f9208

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)