David Coallier wrote:
2008/9/12 Greg Beaver <[EMAIL PROTECTED]>:
Hi,

This is a simple patch that allows files like this:

main.php:

<html>
<head>
 <title>template example</title>
</head>
</html>
<body>
<?php
namespace my::template;
// stuff
?>
</body>


Is it me or this doesn't look really clean? I have a clear idea that
namespaces are there to add an extra structural layer to the code and
not to be randomly used in some HTML/PHP/Javascript mixing.

Since the current namespace implementation doesn't want to have
multiple namespaces per file, I think we should restrict a namespace
per file to... a namespace per file, and nothing else. I can't imagine
taking over someone's code who had declared a namespace under is
footer template.

Perhaps I am missing something but that would be bloody ugly in the end :)


Since you're looking for input from everyone, I'll throw my 2 cents in.

I agree that this should not be allowed. Even with just a new line or space, PHP developers should learn that that is not a good practice.

My feelings for namespaces is that it's for frameworks and such. I would be USING [use ...] inside a PHP/XHTML/JS type of file, not declaring a namespace.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to