m5n6 Posted October 28, 2002 Posted October 28, 2002 code1: <?php define(...);// line 1 define(...);// line 2 define(...);// line 3 define(...);// line 4 ?> code2: <?php define(...);// line 1 define(...);// line 2 ?> <?php define(...);// line 3 define(...);// line 4 ?> I'm guessing the performance difference can be ignored. Thanks for any comments
mattice Posted October 28, 2002 Posted October 28, 2002 You mean there is 'other stuff' between the defines in example 2? No, there is no significant difference AFAIK. The define gets defined in the same speed. Opening a few <?php ?> tags more or less should not be a time issue. "Politics is the art of preventing people from taking part in affairs which properly concern them"
hobbzilla Posted October 28, 2002 Posted October 28, 2002 The real question is why you would want to define variables throughout your code? I'd hate to pick up a coding project that you began! Opening and closing php tags a couple of times would not impact performance. However, if you want to get down to clock cycles... snipet 2 is slower than 1.
m5n6 Posted October 28, 2002 Author Posted October 28, 2002 Ryan, thanks for your reply! The reason is that I'm using 2 contributions and I want to add them automaticly. this way I can easily upgrade without a lot of file merging. appending 1 file to the end seems better than search "?>", since it might be more than 1 of them.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.