The new PHP4.4 beta is supposed to fix some memory corruption bugs that deal with references. The good news is that it appears to fix some crashes I have been having with PHP4 on Windows. These crashes never happened on Linux, and were so hard to reproduce that essentially I gave up trying to reproduce an example in 4.3.
The bad news is this is quite disturbing, as PHP4 has been out for over 5 years yet no one has found this error before. The fact that PHP4 is known for reliability also suggests that references are a rarely used feature. Now you need to use references a lot in PHP4 to implement OOP well (otherwise all assignments create a duplicate copy of the object instance), which also suggests the takeup of OOP is pretty low in PHP4.
For me, the worst thing about PHP4.4 is that this type of code:
function &dosomething($a)
{
$b = false;
return empty($a) ? $b: $a;
}
Will generate a warning in the return statement:
Only variable references should be returned by reference in d:\inetpub\wwwroot\test.php on line 8
This is really weird as $b and $a are variables. This is a known bug since Dec 2004: see bug 20953 at bugs.php.net (ignore the Dec 2002 timestamp in the bug report, bugs.php.net has bugs :-), but no one is looking into it currently. I hope this problem can be fixed without requiring us to change any source code.
![]()

