|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-10-22 10:32 UTC] aharvey@php.net
-Status: Open
+Status: Bogus
[2010-10-22 10:32 UTC] aharvey@php.net
[2010-10-22 10:44 UTC] josh dot richard at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 05:00:01 2025 UTC |
Description: ------------ I'm trying to use fsocketopen() to test a server connection- to see if it's online or offline. Even the manual says I can call it like this: $connection = fsockopen("www.example.com", 80, $errno, $errstr, 30); However, I get this warning message when doing so: PHP 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. Is there another way to declare fsocketopen()??? I see nothing about this!! Test script: --------------- <? // This value is either example.com OR example.com:port $serverAddress = $_POST[server]; @list($addr,$port)= explode (':', $serverAddress); if (empty($port)) { $port = 80; } // Test the server connection $connection = @fsockopen($addr, $port, &$errno, &$errstr, 30); if (!$connection) { echo $addr . ":" . $port . " is currently DOWN"; } else { echo $addr . ":" . $port . " is currently UP"; } ?> Expected result: ---------------- Not expecting any warning!! Actual result: -------------- Where does this warning come from? I've called fsocketopen() like this for years!!