Hello Guilherme
The new implementation of spl_object_hash will solve it, since it's a
faster implementation than the old one.
Just one hint, you should not try to echo the generated hash, since it
may have non-printable chars.
I don't think that will be a problem...
Also, your code may still be possible to use SplObjectStorage.
Etienne did a lot of research regarding how it could be used, and he
showed me that a n-dimensional array is possible too.
In your situation, $events should be an ArrayAccess instance, while
each $events[$event] should be an SplObjectStorage.
May I ask why your sample uses ArrayAccess instead of a plain array()?
And ArrayAccess is an Interface, now I am bit puzzled.
SplObjectStorage will only allow objects (Docs?), I register static
classes as event listener, so something like this won't work:
EVENT::register("myevent", "Autoloader", "onmyevent"); // Register
Autoloader::onmyevent() as event listener.
A reason I wrote SplObjectStorage won't solve my usage of spl_object_hash.
So don't mark spl_object_hash deprecated in 5.4 ;-)
Best regards
Oskar Eisemuth
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php