Created
October 6, 2012 22:00
-
-
Save mpmont/3846308 to your computer and use it in GitHub Desktop.
using _invoke()
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 CallableClass | |
{ | |
public function __invoke($x) | |
{ | |
var_dump($x); | |
} | |
} | |
$obj = new CallableClass; | |
$obj(5); | |
var_dump(is_callable($obj)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment