PHP头条
热点:

[PHP] small example to show dynamic type change


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);


www.phpzy.comtrue/phprm/42999.htmlTechArticle[PHP] small example to show dynamic type change 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';$...

相关文章

    暂无相关文章

PHP之友评论

今天推荐