Skip to content

Instantly share code, notes, and snippets.

@nicolas-grekas
Created September 3, 2015 11:14
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 nicolas-grekas/a24a6b74091206302e05 to your computer and use it in GitHub Desktop.
Save nicolas-grekas/a24a6b74091206302e05 to your computer and use it in GitHub Desktop.
<?php
$foo = function (): foo {
return new foo();
};
$foo instanceof foo; // => true
$foo->toto = 123; // $foo() is evaluated and is swapped to its return value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment