Re: PHP Streamlining Ideas

Posted by wizanda on 1240483562
Static containment:
Often we look at code from the perspective of what we need and not what would the computer need to recall..
So where practical you can vastly reduce loading times by not requiring everything each time, yet instead collecting it from stasis...



Static class $handlers will hold vast amounts of required files information in stasis for use when needed...Thus Allowing functions, classes and even additional extended class file requirements, to be held within the field of stasis.
The required files can add additional weight if stored inside another class.


Ok due to what i would call an error in PHP, the code has now been edited since first posting it.
This is because if Static variables use !isset it will fill a reference for each time its called, inside the static variable.
If you return it when it isset, it can not auto fill the static variable each time its called, as it has already been returned.
This basically means many people in PHP code have done their questions backwards, as all questions that are called multiple times will save additional copies inside the static variables; (var_dump() these to check) thus making more memory usage overall.

This Post was from: https://www.wizanda.com/newbb/viewtopic.php?topic_id=1491&post_id=3860