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);
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号