News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Christian Stocker's Blog:
FOTD REFLECTIONCLASS()->NEWINSTANCEARGS($ARGS) is "slow"
September 18, 2008 @ 13:17:36

Christan Stocker has posted a finding of the day that he ran across and wanted to share to help out other developers out there:

For okapi we needed to have a function which loads any class with any number of arguments. This is not so easy in PHP as it looks like [...] Since 5.1.3 you can use the reflection extension to do this much nicer.

The difference comes in at about half the time for both side of the examples - with the switch and via reflection.

0 comments voice your opinion now!
reflection switch instance class arguments


blog comments powered by Disqus

Similar Posts

O'Reilly: Code As Data: Reflection in PHP

Christian Stocker's Blog: FOTD: REFLECTIONCLASS()->NEWINSTANCEARGS($ARGS) is "slow"

PHP -GTK Community Site: A New Trio of Posts (phpISO, a PHP-GTK book, and Dev Inspector)

Community Crosstalk: Matthew O'Phinney & Scott Johnson on Dynamic Function/Method Calls

Ian Selby's Blog: Dynamically Add Functions to PHP Classes


Community Events





Don't see your event here?
Let us know!


introduction developer series unittest install threedevsandamaybe library release interview language wordpress configure application api community code framework list podcast symfony

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework