Issues

ZF-8842: Reflection call could be avoided

Issue Type: Improvement Created: 2010-01-16T13:50:57.000+0000 Last Updated: 2010-01-16T17:01:53.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: julien PAULI (doctorrock83) Assignee: Marc Bennewitz (private) (mabe) Tags: - Zend_Serializer

Related issues: Attachments:

Description

Zend_Serializer::factory() makes a call to Reflection to make a check for implemented interfaces of the adapter class.

Reflection calls are known to be PHP greedy, and this one could be avoided.

2 solutions suggested : - Create an instance of the adapter class, then use instanceof operator to check if it implements an interface - use PHP::class_implements() which avoid any object instanciation but require an in_array() search.

Comments

Posted by julien PAULI (doctorrock83) on 2010-01-16T13:54:40.000+0000

A fix is at svn 20343

Posted by Marc Bennewitz (private) (mabe) on 2010-01-16T16:48:45.000+0000

On creating an instance it will execute code (constructor) of the unchecked class.

Posted by Marc Bennewitz (private) (mabe) on 2010-01-16T17:01:53.000+0000

fixed in r20347 & on 1.10 branch in r20348

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts