Page 1 of 1

Assigning the return value of new by reference is deprecated

Posted: Sun Mar 20, 2011 7:44 am
by danyalbutt
Hi guys,
I was using php5 before I installed php 5.3.5, right after that its giving me following errors.
I can understand that there could be some changes in code syntax, but don't know how to fix it.....
Any help would be great
Thanks

My code
using SafeSQL.class.php class

Code: Select all

$safeSql =& new SafeSQL_MySQL; 

Code: Select all

Deprecated: Assigning the return value of new by reference is deprecated in J:\Programming\LocalDevelopment\Freelance_Work\bh-perlen\webConfig.php on line 128

Strict Standards: Declaration of SafeSQL_MySQL::_sql_escape() should be compatible with that of SafeSQL::_sql_escape() in J:\Programming\LocalDevelopment\Freelance_Work\bh-perlen\sIncludes\Classes\SafeSQL.class.php on line 241

Strict Standards: Declaration of SafeSQL_ANSI::_sql_escape() should be compatible with that of SafeSQL::_sql_escape() in J:\Programming\LocalDevelopment\Freelance_Work\bh-perlen\sIncludes\Classes\SafeSQL.class.php on line 266

Deprecated: Assigning the return value of new by reference is deprecated in J:\Programming\LocalDevelopment\Freelance_Work\bh-perlen\sIncludes\Classes\class.web.dkwdh.php on line 5


Notice: Undefined index: cid in J:\Programming\LocalDevelopment\Freelance_Work\bh-perlen\layout\webIncludes\contentIds.php on line 2

Notice: Undefined offset: 1 in J:\Programming\LocalDevelopment\Freelance_Work\bh-perlen\layout\webIncludes\contentIds.php on line 9

Notice: Undefined variable: name in J:\Programming\LocalDevelopment\Freelance_Work\bh-perlen\sIncludes\Classes\class.web.dkwdh.php on line 6

Notice: Undefined variable: filename in J:\Programming\LocalDevelopment\Freelance_Work\bh-perlen\sIncludes\Classes\class.web.dkwdh.php on line 6

Notice: Undefined variable: new_w in J:\Programming\LocalDevelopment\Freelance_Work\bh-perlen\sIncludes\Classes\class.web.dkwdh.php on line 6

Notice: Undefined variable: new_h in J:\Programming\LocalDevelopment\Freelance_Work\bh-perlen\sIncludes\Classes\class.web.dkwdh.php on line 6

Notice: Undefined variable: filename in J:\Programming\LocalDevelopment\Freelance_Work\bh-perlen\sIncludes\Classes\class.web.dkwdh.php on line 7

Notice: Undefined variable: linkName in J:\Programming\LocalDevelopment\Freelance_Work\bh-perlen\sIncludes\Classes\class.web.dkwdh.php on line 281

Notice: Undefined index: btmLogin in J:\Programming\LocalDevelopment\Freelance_Work\bh-perlen\index.php on line 26

Re: Assigning the return value of new by reference is deprec

Posted: Sun Mar 20, 2011 11:48 am
by Jonah Bron
Objects are by default passed by reference (actually, their reference is passed by value). Take out the &.

Code: Select all

$safeSql = new SafeSQL_MySQL;