Please add to documentation as an example.

I wanted the title to be field_company and then field_person_name, separated by "/".
The 1st field is mandatory, the 2nd is sometimes empty.
That's the PHP code I've come up with, to put in the content type's auto-nodetitle definitions tab (when the PHP checkbox is checked).

<?php
  $language
= $node->language;
  if (!
in_array($language, $node->field_company)) $language LANGUAGE_NONE;
 
$title = $node->field_company[$language][0]['value'];
 
$pname = '';
  if (
count ($node->field_person_name[$language]) ) :
   
$pname = $node->field_person_name[$language][0]['value'];
  endif;
  if (
strlen($pname) > 0):
    return
$title . ' / ' . $pname;
  else:
    return
$title;
  endif;
?>