Skip to content

Instantly share code, notes, and snippets.

@msjyoo
Created January 1, 2016 12:45
Show Gist options
  • Save msjyoo/804dab77123695660978 to your computer and use it in GitHub Desktop.
Save msjyoo/804dab77123695660978 to your computer and use it in GitHub Desktop.
<?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