I don't get why I get this error
Fatal error: Class 'ImageJpg' not found Here is the code that I use
spl_autoload_register(function($class) { if(file_exists($class)) { include $class.'.php'; } }); $n = new ImageJpg(); File ImageJpg.php is in the same dir with the code above.
Here is the content of ImageJpg.php
<?php class ImageJpg { public function __construct() { echo 'Image from jpg called'; } }