At 16:14 2004-01-13, you wrote:
Hello Sebastian,

Tuesday, January 13, 2004, 3:09:39 PM, you wrote:

SO> I cannot believe that there is no way of making an object parameter
SO> optional.

function ($parameter1, $parameter2 = NULL)
{
 // etc
}

If passed to your function, $parameter2 will be your object (or
string or whatever you wanted), if not passed in it'll be null.
this might work this is an ugly solution from the top of my head, not tested:
<?php
$myObject =& (ifYour object exists)? $yourObject : new stdClass;
foo("blaha",&$myObject);
function foo($para1,&$param2){
if(get_class($param2) =='stdClass') $param2 = NULL; // get_class might return stdclass not sure
}
?>
/ Jimmy
--
Best regards,
 Richard                            mailto:[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to