FAQ: Introduction to PHP Functions - Parameters

This community-built FAQ covers the “Parameters” exercise from the lesson “Introduction to PHP Functions”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn PHP

FAQs on the exercise Parameters

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Suggesting a correction/adjustment to the instructions in the PHP: Parameters lesson.

When I reached the final step (5) I thought I was stumped. Each time I ran my solution it returned incorrect with the comment:

Double check the instructions. It seems like you reversed which function invocation should be passed into which.

I tried swapping the functions and changing how I included the parameters, but nothing worked. I eventually gave up and looked up the solution under “Get Unstuck” - the answer was the first thing I tried!

echo increaseEnthusiasm(repeatThreeTimes("Olé"));

But it still didn’t work!

Finally I tried deleting the echo statement written above it from the previous step (4):

echo repeatThreeTimes("Check"); 

And the step finally registered as correct!

Logically, I can understand why having the previous statement left over was interfering with the results. However, up to now none of the steps in any of the lessons have overlapped like this (unless the questions specifically addressed it), As I had already completed step 4 without any problems, it didn’t occur to me to look outside of my results for step 5 when trying to troubleshoot my answer.

For the sake of clarity I think the question should be adjusted to account for this. Possibly by specifying that step 5 should overwrite step 4, or simply adding some further directions in the hint?

Just a thought. Thank you.