Created
January 27, 2011 23:42
-
-
Save iammerrick/799545 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 | |
$array = array( | |
'name' => 'Kenneth' | |
); | |
$array = (Object)$array; | |
echo $array->name; | |
$array = (Array)$array; | |
echo $array['name']; |
Author
iammerrick
commented
Jan 27, 2011
<?php
class Idea{
public function __call($cast, $caster)
{
echo $cast;
if($cast == 'array') return array('Hi', 'Bye');
}
}
$idea = new Idea();
$idea = (array) $idea->array();
print_r($idea);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment