Bifalgorithm post · Computer science one · Function Pointers

How do omitted arguments match parameters in PHP functions?

How do omitted arguments match parameters in PHP functions? (Computer science one · Function Pointers) — "It would not be possible to invoke getMonthlyPayment(…

Ideas in this flowchart

  • Regeln für Argumente und optionale Parameter in Funktionsaufrufen
  • Die übergebenen Argumente werden den ersten n Parametern in ihrer Reihenfolge zugeordnet.
  • Daher kann getMonthlyPayment() nicht aufgerufen werden, indem nur das zweite Argument ausgelassen wird.
  • Optionale oder Standardparameter sollten in der Funktionsdefinition am Ende stehen.
Feed/

How do omitted arguments match parameters in PHP functions?

No cover

Channel

Computer science one

1 page

"It would not be possible to invoke getMonthlyPayment() by omitting only the second argument. Providing n arguments will match the first n parameters. Thus, in your function design you should place any optional/default parameters last."

Flowchart preview
👍
0
0 comments0 shares

Sign in to view and post comments.