5

The below is a php function:

bool mkdir ( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] )

I would like to call the function, specifying the first and the third parameters, leaving the second default. Can I?

2 Answers 2

8

No, you cannot. See http://www.php.net/manual/en/functions.arguments.php esp. ex #5 and #6

Specifically:

Note that when using default arguments, any defaults should be on the right side of any non-default arguments; otherwise, things will not work as expected.

Sign up to request clarification or add additional context in comments.

1 Comment

For user defined functions and methods you can use Syntactic github.com/topclaudy/php-syntactic
1

Make a wrapper function with only the parameters you want to specify.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.