Skip to content

Instantly share code, notes, and snippets.

@robknight
Created August 12, 2014 08:54
Show Gist options
  • Save robknight/498661a34bbb078ab9c3 to your computer and use it in GitHub Desktop.
Save robknight/498661a34bbb078ab9c3 to your computer and use it in GitHub Desktop.
[8] #default> class MyClass { function say($words, $times) { for ($i = 0; $i < $times; $i++) { echo $words . "\n"; } } }
[9] #default> $x = new MyClass;
// object(MyClass)(
//
// )
[10] #default> $y = array($x, 'say');
// array(
// 0 => object(MyClass)(
//
// ),
// 1 => 'say'
// )
[11] #default> $y('foo', 3);
foo
foo
foo
// NULL
[12] #default>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment