Created
January 1, 2016 12:45
-
-
Save msjyoo/804dab77123695660978 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Test | |
{ | |
protected $x = "success"; | |
} | |
$a = new Test; | |
($_ = function () { echo $this->x."\n"; })->call($a); // Valid, but "Expected: semicolon" | |
(function () { echo $this->x."\n"; })->call($a); // Valid, but "Expected: semicolon" | |
// function () { echo $this->x."\n"; }->call($a); // PHP Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment