Created
June 8, 2009 19:27
-
-
Save rafaelss/126009 to your computer and use it in GitHub Desktop.
This file contains 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 Callable { | |
public function __invoke(array $options) { | |
print_r($options); | |
} | |
} | |
class Model { | |
public $attribute; | |
public function __construct() { | |
$this->attribute = new Callable(); | |
} | |
} | |
$callable = new Callable(); | |
$callable(array('conditions' => '1 = 1')); | |
$model = new Model(); | |
$model->attribute(array('order' => 'name ASC')); | |
?> | |
############# | |
## OUTPUT | |
Array | |
( | |
[conditions] => 1 = 1 | |
) | |
Fatal error: Call to undefined method Model::attribute() in /home/rafael/projects/php53/callable.php on line 22 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment