Brian's Waste of Time

Tue, 18 Oct 2005

PHP goes "Hmm..."

PHP gets a lot of grief in Java and Ruby camps. That said, my question is whether this is fantastically powerful, or outright scary:

Java:

Object foo = Class.forName(actionName)
                  .newInstance(); 
String templateName = (String)Class.forName(actionName)
                                   .getMethod(eventName, new Class[]{})
                                   .invoke(foo, new Object[]{});

PHP

$foo = new $action_name();
$template_name = $foo->$event_name();

Hmmm

6 writebacks [/src/php] permanent link