|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-01-23 07:54 UTC] krakjoe@php.net
-Status: Open
+Status: Wont fix
[2017-01-23 07:54 UTC] krakjoe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 01:00:01 2025 UTC |
Description: ------------ Would it be possible if ReflectionMethod and ReflectionFunction's getClosure() methods always returned the same Closure object? e.g: class Foo{ function bar(){} } $a = new ReflectionMethod('Foo', 'bar'); $b = new ReflectionMethod('Foo', 'bar'); $foo = new Foo(); $aa = $a->getClosure($foo); $bb = $b->getClosure($foo); assert($aa == $bb); assert($aa === $bb); Object that would have the same lifetime of the object the variable $this is set to ($foo, in previous example). It would be nice if we were allowed to use === operator for comparison. Similarly $aa = $a->getClosure($foo)->bindTo($foo, 'static'); $bb = $b->getClosure($foo)->bindTo($foo, 'static'); assert($aa == $bb); assert($aa === $bb); might also be valid, but I imagine this would complicate things enormously. Thank you in advance.