mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
ReflectionMethod::invoke() (and invokeArgs()) for Closure::__invoke() incorrectly accepted any Closure object, not just the one the ReflectionMethod was created from. This happened because all Closures share a single zend_ce_closure class entry, so the instanceof_function() check always passed. Fix: store the original Closure object in intern->obj during ReflectionMethod construction, then compare object identity in reflection_method_invoke() to reject different Closure instances. Closes GH-21362