PHP : Welcome to WonderLand, where Magic really exists !

Hello everybody,

This morning, I encountered one of the magical PHP feature that transforms things into others like alchemist dreamt on doing, centuries ago (except for I ended up with crap instead of gold, but who cares ?) :)

To reproduce this magical feat, you just need one var, mix it enough to get an enpty array, then try doing some logics :

1
2
3
4
5
6
$var = array();
echo 'is_array ? '. var_export(is_array($var), true);

if (null == $var) {
    echo '<br/>......I am magical var !';
}

this little code will display :

1
2
is_array ? true
......I am magical var !

Share and Enjoy

This entry was posted in PHP and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *