Is the way I use my pattern good enough?
I would prefer:

function add($left, $right) {
   if (!(isset($left, $right) &amp;&amp; is_numeric($left) &amp;&amp; is_numeric($right)))
   {
      throw new InvalidArgumentException(
          __METHOD__ . ' Left and Right arguments must be numeric.');
   }

   return $left + $right;
}


The exception can then be caught at a level where you know how to deal with it.

Usage:

try
{
   print add(1, 2) . "\n";
   print add(1, '') . "\n";
}
catch (Exception $e)
{
   echo $e-&gt;getMessage();
}


The calls to add are not mixed in with custom error handling, making it easier for other people to understand your code.  It also removes the dependency on your ReturnValue class which makes your code more reusable.  The exception allows you to let the code get back to an appropriate level where you can deal with your problem, rather than passing this information back up stack levels.