Skip to content

Instantly share code, notes, and snippets.

@mpmont
Created October 6, 2012 22:00
Show Gist options
  • Save mpmont/3846308 to your computer and use it in GitHub Desktop.
Save mpmont/3846308 to your computer and use it in GitHub Desktop.
using _invoke()
<?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