Created
November 30, 2015 14:14
-
-
Save ThijsFeryn/5d0ba926532f5d2658e7 to your computer and use it in GitHub Desktop.
PHP 7 anonymous classes
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 | |
/** | |
* Anonymous classes | |
*/ | |
$foo = new class { | |
public function foo() { | |
return "bar"; | |
} | |
}; | |
var_dump($foo,$foo->foo()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment