downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ReflectionParameter::isPassedByReference> <ReflectionParameter::isDefaultValueAvailable
Last updated: Fri, 20 May 2011

view this page in

ReflectionParameter::isOptional

(PHP 5 >= 5.0.3)

ReflectionParameter::isOptionalChecks if optional

Descripción

public bool ReflectionParameter::isOptional ( void )

Checks if the parameter is optional.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

TRUE if the parameter is optional, otherwise FALSE

Ver también



add a note add a note User Contributed Notes ReflectionParameter::isOptional
artkurapov at gmail dot com 09-Feb-2010 03:26
Lets say you have method defined

function read_me( a,b,c=1,d,e=2,f=3){}

then reading argument "c" to be optional, it will actually give you false (or nothing at all). This is probably a bug that counts number of required arguments, assuming you have put all optional to the end.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites