[geeklog-devel] [geeklog-cvs] Geeklog-1.x/system lib-mbyte.php, 1.19, 1.20

Joe Mucchiello joe at ThrowingDice.com
Sat Feb 16 14:44:59 EST 2008

Why not make $mb_enabled a global and just initialize it once in 
global scope? It seems silly to have all those if (isset()) calls and 
extraneous static variables in the MBYTE library.

This code is found in all the MBYTE functions:

>       static $mb_enabled;
>       if (!isset($mb_enabled)) {
>           $mb_enabled = MBYTE_checkEnabled();
>       }

It would be reduced to:

>     global $mb_enabled;

Less memory usage, short file size, one less if per call. What's the downside?

Joe Mucchiello
Throwing Dice Games

More information about the geeklog-devel mailing list