Make namespaces backwards compatible in PHP

Posted by daeliur on Stack Overflow See other posts from Stack Overflow or by daeliur
Published on 2010-05-25T20:39:46Z Indexed on 2010/05/25 20:41 UTC
Read the original article Hit count: 143

Filed under:

So I was reading about PHP namespaces, and I realized that in versions earlier than 5.3, if you write

namespace MyNamespace

you get a parse error.

Is there any way to avoid this i.e. make namespaces backwards-compatible, so the code doesn't simply crash?

© Stack Overflow or respective owner

Related posts about php