首页 > Web开发 > 详细

[PHP] small example to show dynamic type change

时间:2014-02-07 22:12:51      阅读:356      评论:0      收藏:0      [点我收藏+]

When you declare one variable, the initial type is null, but the type can be changed by assign statement.

global $my_var;
echo gettype($my_var);

$my_var = new stdClass();
$my_var->name = ‘test‘;
$my_var->city = ‘china‘;

//$my_var[‘weather‘]= ‘cold‘;

echo gettype($my_var);
var_dump($my_var);


[PHP] small example to show dynamic type change

原文:http://blog.csdn.net/wonderfan/article/details/18968267

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!