当前位置:Gxlcms > PHP教程 > [PHP]smallexampletoshowdynamictypechange_PHP教程

[PHP]smallexampletoshowdynamictypechange_PHP教程

时间:2021-07-01 10:21:17 帮助过:4人阅读

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.bkjia.comtruehttp://www.bkjia.com/PHPjc/735900.htmlTechArticleWhen 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->nam...

人气教程排行