How to fix notification: links to links should be returned by link

I am using a php script I got from torrenteditor to create torrent files, but when I create new torrent files using the above method, torrent files are created, but I get a lot of notifications. Like this

Only link references should be returned by link in myfile.php on line 319

in this line

return new BEncode_End();

      

which is listed as another class as

class BEncode_End
{
    public function get_type()
    {
        return 'end';
    }
}

      

so how can i fix these notifications?

I'm new to classes so don't know where to start.

complete script / code downloaded here http://pastebin.com/L6ktvrne line 319

I use

ini_set('display_errors', 1); 
error_reporting(E_ALL);

      

+3


source to share


1 answer


Based on the notification you receive and the answer to another related question :

Always return the assigned value in PHP assignment expressions. So $ _config [0] = & $ config returns $ config - not the variable itself, but a copy of its value. And returning a link to a temporary value won't be particularly helpful (changing that won't be anything).

Change your code:

return new BEncode_End();

      



To:

$cl = new BEncode_End();
return $cl;

      

Your problem needs to be resolved.

+3


source







All Articles