Q:

Questions about php.net's tutorial on Anonymous Functions

Example 3 of PHP.net's documentation on anonymous functions has thrown me for a loop.
The first echo statement prints the value of $message even though the documentation leads me to believe this would not work.

Closures may also inherit variables from the parent scope. Any such variables must be passed to the use language construct. :

// No "use"
$example = function () {
    var_dump($message);
};
echo $example();

Instead of failing, the output is: 
Notice: Undefined variable: message in /example.php on line 6
NULL
string(5) "hello"

Before the 3rd echo statement, this appears:
$message = 'world';

And then, echo calls the function, $example again to get the value of $message. The output is string(5) "hello" again instead of string(5) "world". Since the value $message was defined when $example was defined, the echo statement still returns string(5) "hello". I get this.
Next, $message is "reset" to "hello". Echo is called again but this time the function $example has a reference to $message:
$example = function () use (&$message) {
    var_dump($message);
};

The output is string(5) "world". I don't understand this at all. I thought the value of message had been reset to hello?
Why does the first echo still work? Why does the 4th one print "world"?

A:

Example output
Notice: Undefined variable: message in /example.php on line 6
1: NULL
2: string(5) "hello"
3: string(5) "hello"
4: string(5) "hello"
5: string(5) "world"
6: string(11) "hello world"

First Echo Example
From the example code, the first echo statement appears to simply result in NULL as there's been no use included for this anonymous function. (The Notice lets you know that $message is undefined.)
Here is the relevant code in context for reference:
$message = 'hello';

// No "use"
$example = function () {
    var_dump($message);
};
echo $example();

Fifth Echo Example
While the value of $message has been reset to hello, the following code section:
// Inherit by-reference
$example = function () use (&$message) {
    var_dump($message);
};
echo $example();

shows that $message is inherited by reference which means that when $message = 'world'; is used later, we are now referring (and assigning "world") to the same $message variable as earlier.
In other words, when we define the $example function, we are pointing to the original $message variable in memory (via the &$message reference). So when we call $example() later in the code, we are referring to the same, original $message variable (that we've also recently changed with the $message = 'world'; line). This means that $example() will output our current $message value (which is currently set to "world") rather than a previously set value.
Here is the relevant code in context for reference:
// Reset message
$message = 'hello';

// Inherit by-reference
$example = function () use (&$message) {
    var_dump($message);
};
echo $example();

// The changed value in the parent scope
// is reflected inside the function call
$message = 'world';
echo $example();

