From ef10728a74c39b8ebb2594aba8d939ee26fbb7df Mon Sep 17 00:00:00 2001 From: ethem Date: Mon, 20 Nov 2006 08:20:30 +0000 Subject: [PATCH] Make Zend Studio happy :) Code Analyzer Output: Variable $errno was used before it was defined (line 221) Variable $errstr was used before it was defined (line 221) Category: Coding Style A local variable is used before it is defined. Even though PHP initializes variables with empty values on the first use, it is considered a good practice to explicitly initialize variables to make code more readable and avoid unnecessary bugs. --- enrol/authorize/authorizenetlib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/enrol/authorize/authorizenetlib.php b/enrol/authorize/authorizenetlib.php index d16adde9479..07adfdd252d 100644 --- a/enrol/authorize/authorizenetlib.php +++ b/enrol/authorize/authorizenetlib.php @@ -217,6 +217,7 @@ function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE, $ $referer = "Referer: $CFG->an_referer\r\n"; } + $errno = 0; $errstr = ''; $host = $test ? 'certification.authorize.net' : 'secure.authorize.net'; $fp = fsockopen("ssl://$host", 443, $errno, $errstr, 60); if (!$fp) {