Undocumented feature: ParamArrays in PHP

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Undocumented feature: ParamArrays in PHP

Willem Bogaerts
In PHP, you can use the func_get_args() function to read all the
parameters to a function or method. This can be used to build functions
that accept any number of parameters, like the ParamArray construct in
languages like Visual Basic.

When I was looking for a way to document such a construct in Doxygen, I
could not find it in the documentation. However, I found a way to do it
in PHPCodumentor, and I bluntly tried that in Doxygen. And it worked!

If you append ",..." to a parameter name in PHP, Doxygen will produce
the right output and there is no warning it cannot find that appended
parameter. For example:


/// @brief select values immediately.
/// @details Any preselected keys are also selected,
/// This allows values to be requested in batches.
/// @param[in] mixed $mixKeyValue,... The key of the record to schedule.
/// May by used as ParamArray.
 public function Select($mixKeyValue=NULL)
       {}


It would be nice it this feature could be included in the documentation
as well.

Best regards,

Willem Bogaerts.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Doxygen-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/doxygen-users
Loading...