PHP Problem mit allow_call_time_pass_reference

sd12

Legendäres Mitglied
Erhalte in meinem Script folgenden Error:
QUOTE Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of fsockopen(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /home/httpd/vhosts/han/httpdocs/gat/sendgame_for_member.php on line 77


Beim alten hoster hat das Script funktioniert...

Wie muss ich das es nun umschreiben oder fixen?
Zeile 77 des Scripts:

CODE $fp = fsockopen( $host, 80, &$errno, &$errstr, 120 );
 
QUOTE (Benedikt @ So 22.1.2006, 23:50)[...]
Wie muss ich das es nun umschreiben oder fixen?
Zeile 77 des Scripts:

CODE $fp = fsockopen( $host, 80, &$errno, &$errstr, 120 );


Ich hatte den Fehler wohl noch nie, aber wieso sind denn bei den Funktionsaufruf die Referenzen von $errno und $errstr nochmal angegeben?
Ich würde das &-Zeichen erstmal entfernen, denn aller Wahrscheinlichkeit nach liegt vermutlich dort der Fehler, solange ich die Texte richtig verstanden habe.



QUOTE allow_call_time_pass_reference boolean

Whether to warn when arguments are passed by reference at function call time. This method is deprecated and is likely to be unsupported in future versions of PHP/Zend. The encouraged method of specifying which arguments should be passed by reference is in the function declaration. You're encouraged to try and turn this option Off and make sure your scripts work properly with it in order to ensure they will work with future versions of the language (you will receive a warning each time you use this feature).

Passing arguments by reference at function call time was deprecated for code cleanliness reason. Function can modify its argument in undocumented way if it didn't declared that the argument is passed by reference. To prevent side-effects it's better to specify which arguments are passed by reference in function declaration only.
[...]

Quelle: http://www.php.net/manual/en/ini.core.php

Und wenn das nichts bringt, setzt auch mal den Timeout etwas weiter runter, nicht auf 120, sondern so auf 20. Normalerweise wird ein Script nur max. 30 Sekunden ausgeführt, so sind zumindestens die Standardeinstellungen von PHP.



CODE $fp = fsockopen( $host, 80, $errno, $errstr, 20 );




MfG Sascha Ahlers
 
QUOTE (Sascha Ahlers @ Mo 23.1.2006, 1:33) Ich würde das &-Zeichen erstmal entfernen, denn aller Wahrscheinlichkeit nach liegt vermutlich dort der Fehler, solange ich die Texte richtig verstanden habe.

Vielen Dank; dort war der Hund begraben...
 
Zurück
Oben