Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A php namespace called default

Tags:

namespaces

php

<?php
namespace default

gives me an unexpecected T_DEFAULT, is there any way of working around this? Can I escape the reserved word somehow?

My system uses the name of the current module in my site for the namespace so it would be nice to be able to use any string as a namespace.

like image 540
michael Avatar asked Jun 16 '10 08:06

michael


1 Answers

You can't use reserved words like default for namespaces in PHP - you'll have to find a workaround (_default, default_, default1 etc.?).

like image 132
Skilldrick Avatar answered Sep 25 '22 23:09

Skilldrick