Re: Function design recomendation?
| From: | Sterling Hughes | Date: | Wed, 21 Mar 2001 17:40:27 +0000 |
| Subject: | Re: Function design recomendation? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-49654@lists.php.net to get a copy of this message | ||
On Wed, 21 Mar 2001, Fredrik Ohrn wrote:
>
> I'm about to properly implement cpdf_set_viewer_preferences which is
> currently just a stub.
>
> The underlying function takes a struct with 8 fields.
>
> I'd like to avoid having to specify 8 parameters to the PHP equivalent
> (especially as most of them has sensible defaults).
>
> How are structs 'emulated' in other places?
>
>
You have a couple of options...
First of all are you sure that the user needs to specify all 8 fields of
the structure, or can you safely fill in some of them?
As a second option you could have the user pass an associative array which
is the closed equivalent of a structure in php.
-Sterling