I need to include several files in a main index.php file. I'm working with namespaces.
Can I use include/require and make 开发者_开发技巧the files use the same namespace as index.php without specifying the namespaces and use statements in each included file?
PHP namespaces are scoped at the file level.
If a.php is inside a namespace, and it includes b.php, but b doesn't specify a namespace, it will not adopt the namespace defined in a.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论