4

I understand that in normal php if we're including a file we're merging the source of it in the script and it would take longer for that page to be parsed/processed but if we're using HipHop shouldn't it be ok to just create one single php file and include every file in it (that contains some class) and every page which needs those classes (in separate file each) can just include one single php file?

Would this be ok in presence of HipHop?

3

Correct way to handle this situation is using spl_autoload_register method to register your custom method that will be invoked every time a class is used in your file which is not yet declared.

In the implementation of this method you can do a dynamic include based on the class name. It is also supported in HipHop

http://www.php.net/manual/en/function.spl-autoload-register.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.