Home »
General »
PHP discussions »
PHP 4.4.0
PHP 4.4.0 [message #26305] |
Wed, 13 July 2005 09:12 |
Art Wolf
Messages: 16 Registered: May 2005 Location: Dublin, Ireland
Karma:
|
Junior Member |
|
|
Right well the webserver I'm working off was just upgraded to php 4.4.0 and immediatly I start recieving cron job errors :/
The errors point to
Quote: |
Notice: Only variable references should be returned by reference in
+/webtree/a/art_wolf/rb/FUDforum/include/theme/default/db.inc on line 180
Notice: Only variable references should be returned by reference in
+/webtree/a/art_wolf/rb/FUDforum/include/theme/default/db.inc on line 219
Notice: Only variable references should be returned by reference in
+/webtree/a/art_wolf/rb/FUDforum/include/theme/default/db.inc on line 223
Notice: Only variable references should be returned by reference in
+/webtree/a/art_wolf/rb/FUDforum/include/theme/default/db.inc on line 219
Notice: Only variable references should be returned by reference in
+/webtree/a/art_wolf/rb/FUDforum/include/theme/default/db.inc on line 180
Notice: Only variable references should be returned by reference in
+/webtree/a/art_wolf/rb/FUDforum/include/theme/default/db.inc on line 219
Notice: Only variable references should be returned by reference in
+/webtree/a/art_wolf/rb/FUDforum/include/theme/default/db.inc on line 223
Notice: Only variable references should be returned by reference in
+/webtree/a/art_wolf/rb/FUDforum/include/theme/default/db.inc on line 219
Notice: Only variable references should be returned by reference in
+/webtree/a/art_wolf/rb/FUDforum/include/theme/default/db.inc on line 180
Notice: Only variable references should be returned by reference in
+/webtree/a/art_wolf/rb/FUDforum/include/theme/default/db.inc on line 180
|
The main part of php's upgrade is to
Quote: | ..addresses a serious memory corruption problem within PHP concerning references. If references were used in a wrong way, PHP would often create memory corruptions which would not always surface and be visible.
|
Looking at the problems it refers to these functions :
Quote: |
function &db_rowarr($result)
{
return mysql_fetch_row($result);
}
function &db_saq($q)
{
return mysql_fetch_row(q($q));
}
function &db_sab($q)
{
return mysql_fetch_object(q($q));
}
|
There is a php bug report on this issue here.
So the scope of what is returned by mysql_fetch_row / _object ends when the function ends. To my understanding then one way around this is to create a new variable in GLOBAL.php and edit the functions like so :
Quote: |
./FUDforum/include/GLOBALS.php
$reference_result = "";
./FUDforum/include/theme/default/db.inc
function &db_rowarr($result)
{
$reference_result = mysql_fetch_row($result);
return $reference_result;
}
function &db_saq($q)
{
$reference_result = mysql_fetch_row(q($q));
return $reference_result;
}
function &db_sab($q)
{
$reference_result = mysql_fetchobject(q($q));
return $reference_result;
}
|
|
|
|
Goto Forum:
Current Time: Fri Nov 22 00:10:10 GMT 2024
Total time taken to generate the page: 0.04144 seconds