Skip to content

Instantly share code, notes, and snippets.

@atmoz
Created February 19, 2010 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atmoz/308968 to your computer and use it in GitHub Desktop.
Save atmoz/308968 to your computer and use it in GitHub Desktop.
<?php
/**
* PHP Quiz #1
*
* What is the function definition of hello()?
*
* function hello() {
* ...
* }
*
*
* Result: "Hello to the following people: Higgs, Euler, Hanse, Noah"
*/
function hello($array) {
return function() use ($array) {
echo 'Hello to the following people: ' . implode(', ', array_reverse($array));
};
}
$hello = hello(array('Noah', 'Hanse', 'Euler', 'Higgs'));
$hello();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment