We help IT Professionals succeed at work.

PHP Function Parameter Auto Suggestions Possible?

Ryan Bayne
Ryan Bayne used Ask the Experts™
on
Hi

I use Zend Studio.

Is it possible to add suggestions in a functions documenting for parameters, a range of possible values?

I have a function for displaying a notification with about 15 possible styles. Instead of memorising them all or constantly referring to the list it would be great if the possible values were offered.

Is this even possible?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
Is this on a web page?  Dropdown list?  How do you decide what is possible?
Most Valuable Expert 2011
Top Expert 2016

Commented:
A function is a term of art in PHP. You can set default values for function arguments like this:

function foo($s = 'ABC')
{
    echo $s;
}

foo(); // ABC
foo('DEF'); // DEF
WordPress Developer
Commented:
Alright I think the answer is no.

One attribute has 15 possible values. It is a lot to remember and be 100% sure your getting it correct from memory. Just need to refer to the pop up information when typing the function I suppose.

OR

I'm not wonder if I setup a snippet in zend and add a string of all the possible values, then just delete those I won't use. I think zend allows this.
Ryan BayneWordPress Developer

Author

Commented:
I never got a solution because it is not really available/possible.

I typed in my own work around for others.
Ryan BayneWordPress Developer

Author

Commented:
Meant to say, I'm now wondering not "I'm not wonder" jeeze.
Most Valuable Expert 2011
Top Expert 2016

Commented:
Sure wish you had engaged in some dialog with us here.