I thought I could speed up code by using integeres in our $mode variable used in compares instead of a string.
define("MODE_CONST",1);
Ie mode="my_string_that_should_take_longer" being used in "switch" or "if" compares, with mode=MODE_CONST instead, there are several dozen modes, and about maybe 5 switches in every page load...
Howcome using integers doens't seem faster then using strings??? Not even slightly faster... I also tried to make a demo program to test this increasing the intervals to see if I could really determine which is faster, it turns out that php was doing something funny with strings, and eventualy the string comapres were faster then the integer compares even, like it was caching them or something..
Anyone have any suggestions or ideas on this??? I am lost.
Thanks,
Jeff.
Question about Strings vs integers (in defines)
Moderator: General Moderators