update page now
Longhorn PHP 2026 - Call For Papers

Voting

: three plus four?
(Example: nine)

The Note You're Voting On

rayro at gmx dot de
16 years ago
It is never a good idea and a unconscienable concept to create the classes in the autoload function via eval. 
It should be a nice feature with these Exception, but i think anyone is able to handle it without this method although. Atm i dont realize for what this is good for...

As i might note, class_exists() will ever define the classes u only want to check for existance, and will therefor ever return true:
<?php
function EvalIsEvil($class) {
  eval('class '.$className.'{}');
}
spl_autoload_register('EvalIsEvil');
if (class_exists($s="IsMyModuleHere")) {
  // this is no module, but get there with eval()...
  return new $s();
}
?>

<< Back to user notes page

To Top