Rick Widmer wrote:
D. Dante Lorenso wrote:
Eric,
This reply is too basic and is not the answer. The problem is more complex then you have grasped.
function ifsetor()  {
$args = func_get_args();
$count = count( $args );

for( $i=0; $i<$count; $i++ ) {
   if isset( $args[ $i ] )) {
      return $args[ $i ];
   }

return false;
}



No, that doesn't address the problem.  See this:

---------- 8< -------------------- 8< -------------------- 8< ----------
<pre>
<?php
function ifsetor()  {
   $args = func_get_args();
   $count = count($args);
   for ($i=0; $i<$count; $i++) {
       if (isset($args[$i])) {
           return $args[$i];
       }
   }
   return false;
}
print ifsetor($x, $y, $z, "dante")."\n";
?>
</pre>

PHP Notice:  Undefined variable: x in .../ifsetor.php on line 13
PHP Notice:  Undefined variable: y in .../ifsetor.php on line 13
PHP Notice:  Undefined variable: z in .../ifsetor.php on line 13
---------- 8< -------------------- 8< -------------------- 8< ----------

See my post regarding a specification for 'filled()' as a function. An important feature is that warnings about unset variables should not occur. Your suggestion does not qualify. This problem can not be solved in userspace.

Dante

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to