Skip to main content.

Archives

This is the archive for August 2004

Tuesday, August 31, 2004

When using the echo "function" to output a string which is combined of multiple parts, once could write:

echo 'foo' . htmlspecialvars($someVar) . 'bar'

The problem with this is that PHP will first concatenate the three strings (two concatenations) before using echo to dump it to the output. This means that two extra string objects will be created into memory.

The alternative is using comma's. It looks a little weird, but echo then behaves as a function that is taking multiple parameters and dumping all of them:

echo 'foo' , htmlspecialvars($someVar) , 'bar'

In this case, no concatenation is needed which means this code should be faster and more memory-efficient than the concatenating version.

I know the effect of this will be very limited, but I try to use this wherever I can.

Monday, August 16, 2004

In order to understand some parts of the Nucleus core code, you need to know what references are, how they work, and how to use them. This article tries to explain the basics of references. If you're familiar with programming languages like C or C++, this will look trivial. But remember: PHP references are NOT the same as pointers in C, they're more like symbol table aliasses.

Knowing how references work will help you understand the Nucleus MANAGER class and the Nucleus Plugin API.

Monday, August 09, 2004

On the PHP website, there's a list of backwards incompatible changes made in PHP5. There's not much to worry about: apart from the fixes already applied to Nucleus, there are no new issues.

Monday, August 02, 2004

In order to make sure Nucleus runs on as much servers as possible, my PHP setup (php.ini) is set up in a way to make the environment as hard as possible to work with. TeRanEX requested an overview, so here it is: