Sample Call

<?php
// SOAP_CLIENT_BASEDIR - folder that contains the PHP Toolkit and your WSDL

define("SOAP_CLIENT_BASEDIR", "../../soapclient");
require_once (SOAP_CLIENT_BASEDIR.'/SforceEnterpriseClient.php');
require_once ('../userAuth.php');
try {
  $mySforceConnection = new SforceEnterpriseClient();
  $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/enterprise.wsdl.xml');
  $mylogin = $mySforceConnection->login($USERNAME, $PASSWORD);

  $response = $mySforceConnection->getUserInfo();
  print_r($response);
  
  $mylogout = $mySforceConnection->logout();
  print_r($mylogout);

  $response = $mySforceConnection->getUserInfo();
  print_r($response);
  
} catch (Exception $e) {
  echo $mySforceConnection->getLastRequest();
  echo $e->faultstring;
}
?>

Sample Output

stdClass Object
(
    [accessibilityMode] => 
    [currencySymbol] => $
    [orgDefaultCurrencyIsoCode] => USD
    [orgHasPersonAccounts] => 
    [organizationId] => 00D70000000J4qjEAC
    [organizationMultiCurrency] => 
    [organizationName] => salesforce.com
    [profileId] => 00e70000000vr2wAAA
    [roleId] => 
    [userDefaultCurrencyIsoCode] => 
    [userEmail] => anemail@email.com
    [userFullName] => Nick Tran
    [userId] => 005700000014rfAAAQ
    [userLanguage] => en_US
    [userLocale] => en_US
    [userName] => anemail@email.com
    [userTimeZone] => America/Los_Angeles
    [userType] => Standard
    [userUiSkin] => Theme2
)
stdClass Object
(
)

462300D70000000J4qj!AR0AQO40VW6Za74stEeEbVvWzdIHDcGRVaD4Mmowtd3rgEysVQxcchPZiY_F30iCG6M7XBGyI2kP0VLm8i3S.zrY2zf5bxdn
INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session