Sample Call

<?php
// SOAP_CLIENT_BASEDIR - folder that contains the PHP Toolkit and your WSDL
// $USERNAME - variable that contains your Salesforce.com username (must be in the form of an email)
// $PASSWORD - variable that contains your Salesforce.com password

define("SOAP_CLIENT_BASEDIR", "../../soapclient");
require_once (SOAP_CLIENT_BASEDIR.'/SforcePartnerClient.php');
require_once (SOAP_CLIENT_BASEDIR.'/SforceHeaderOptions.php');

require_once ('../userAuth.php');

try {
  $mySforceConnection = new SforcePartnerClient();
  $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/partner.wsdl.xml');
  $mylogin = $mySforceConnection->login($USERNAME, $PASSWORD);

  $obj1 = new SObject();
  $obj1->type = 'Lead';

  $fields = array (
  'Company' => 'XYZ Company',
  'FirstName' => 'John',
  'LastName' => 'Smith',
  'LeadSource' => 'Other',
  'NumberOfEmployees' => 1,
  'Status' => 'Open'
  );
  $obj1->fields = $fields;
  $createResponse = $mySforceConnection->create(array ($obj1));

  echo "***** Creating Lead *****\n";
  print_r($createResponse);

  $id = $createResponse->id;
  $deleteResponse = $mySforceConnection->delete(array ($id));
  echo "***** Deleting Lead *****\n";
  print_r($deleteResponse);

  echo "***** Wait 60 seconds *****\n";
  sleep('60');

  $currentTime = mktime();
  // assume that delete occured within the last 5 mins.
  $startTime = $currentTime-(60*10);
  $endTime = $currentTime;

  echo "***** Get Deleted Leads *****\n";
  $getDeletedResponse = $mySforceConnection->getDeleted('Lead', $startTime, $endTime);
  print_r($getDeletedResponse);

} catch (Exception $e) {
  print_r($e);
}
?> 

Sample Output

***** Creating Lead *****
stdClass Object
(
    [id] => 00Q7000000Nr9VxEAJ
    [success] => 1
)
***** Deleting Lead *****
stdClass Object
(
    [id] => 00Q7000000Nr9VxEAJ
    [success] => 1
)
***** Wait 60 seconds *****
***** Get Deleted Leads *****
stdClass Object
(
    [deletedRecords] => stdClass Object
        (
            [deletedDate] => 2008-09-17T00:21:11.000Z
            [id] => 00Q7000000Nr9VxEAJ
        )

    [earliestDateAvailable] => 2008-01-08T19:56:00.000Z
    [latestDateCovered] => 2008-09-17T00:19:00.000Z
)