Just because your code ate up 200 mb of memory does not mean that PHPs memory management is bad, it means that your code is bad 😉.
PHP 5 has a much stronger object syntax than PHP 4 and is very akin to Java, however PHP 4 is usually capable of most things.