PHP - Array FunctionsWhich statement about array_walk is TRUE?AIt requires the callback function to return the modified valueBIt always returns a new array with modified valuesCIt cannot access the keys of the array elementsDIt modifies the original array only if the callback parameter is passed by referenceCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand array_walk behaviorarray_walk applies callback to each element; modification requires reference.Step 2: Evaluate other statementsarray_walk does not return a new array, can access keys, and callback return is ignored.Final Answer:It modifies the original array only if the callback parameter is passed by reference -> Option DQuick Check:Modification needs reference in callback [OK]Quick Trick: Only reference parameters in callback modify original array [OK]Common Mistakes:Thinking array_walk returns a new arrayBelieving callback must return valueAssuming keys are inaccessible
Master "Array Functions" in PHP9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PHP Quizzes Array Functions - Array chunk and pad - Quiz 15hard Classes and Objects - Object instantiation with new - Quiz 2easy Error and Exception Handling - Throwing exceptions - Quiz 14medium Error and Exception Handling - Try-catch execution flow - Quiz 2easy File Handling - File pointer manipulation - Quiz 3easy Inheritance and Polymorphism - Type hinting with parent classes - Quiz 8hard Interfaces and Traits - Why traits are needed - Quiz 10hard Sessions and Cookies - Starting and using sessions - Quiz 7medium Sessions and Cookies - Starting and using sessions - Quiz 3easy String Functions - Trim functions - Quiz 10hard