Re: PHP4 to PHP5 migration with E_STRICT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks David.

If my understanding is correct, then:

SPControlPanel::getContentTypes($db);

is a reference to a static instantiation of the class. If so, then it
must be syntactically something like when using 'new' (which returns a
reference) so there's no need to apply the & operator. Am I on the right
track?

I have some more PHP4 code in the application which caused: "PHP
Notice:  Only variable references should be returned by reference". I
have fixed it like this:

<       function & _getTable($cached=true)
<       {
<               return new TableClass($this->_getTableName());
---
>       function & _getTable($cached=true) {
>               $temp = new TableClass($this->_getTableName());
>               return $temp;

Is this acceptable?

I'll have to come back to the $db issue - it's not issuing a warning so
I'll leave it alone until I've tidied up all the other issues.

Regards,

Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux