Sample Call

<?php
// SOAP_CLIENT_BASEDIR - the 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.ocm password

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

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

	$leadid = '00Q5000000DO0gs';
	
  $query = "select id, title, firstname, lastname from lead where id = '$leadid'";
	
  $queryResponse = $mySforceConnection->query($query);
  $queryResult = new QueryResult($queryResponse);
  echo "***** Initial query response *****\n";
  print_r($queryResult);
  
	$sObject = new SObject();
	$sObject->fieldsToNull = array (
  "Title", "FirstName"
  );
  $sObject->type = 'Lead';
  $sObject->Id = $leadid;
  $updateResponse = $mySforceConnection->update(array ($sObject));
  
  echo "***** Updated object with fields to null *****\n";
  print_r($updateResponse);

  $queryResponse = $mySforceConnection->query($query);
  $queryResult = new QueryResult($queryResponse);
  echo "***** Final query response *****\n";
  print_r($queryResult);
  
  
} catch (Exception $e) {
	echo $mySforceConnection->getLastRequest();
	echo $e->faultstring;
}
?>

Sample Output

***** Initial query response *****
QueryResult Object
(
    [queryLocator] =>
    [done] => 1
    [records] => Array
        (
            [0] => SObject Object
                (
                    [type] => Lead
                    [fields] => SimpleXMLElement Object
                        (
                            [Title] => Manager
                            [FirstName] => John
                            [LastName] => Smith
                        )

                    [Id] => 00Q5000000DO0gsEAD
                )

        )

    [size] => 1
)
***** Updated object with fields to null *****
stdClass Object
(
    [id] => 00Q5000000DO0gsEAD
    [success] => 1
)
***** Final query response *****
QueryResult Object
(
    [queryLocator] =>
    [done] => 1
    [records] => Array
        (
            [0] => SObject Object
                (
                    [type] => Lead
                    [fields] => SimpleXMLElement Object
                        (
                            [Title] => SimpleXMLElement Object
                                (
                                )

                            [FirstName] => SimpleXMLElement Object
                                (
                                )

                            [LastName] => Smith
                        )

                    [Id] => 00Q5000000DO0gsEAD
                )

        )

    [size] => 1
)