Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Matthew Carter Newsgroups: comp.lang.php Subject: Re: PHP boilerplate to appear at the top of any program Date: Mon, 21 Dec 2015 21:40:12 -0500 Organization: Ahungry (http://ahungry.com) Lines: 33 Message-ID: <87io3rkxyr.fsf@ahungry.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="7c986cd4736462de309a749b207746fe"; logging-data="7365"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KYLve4ItUV7rt2Forg8wc" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:87HxRsYyEDyZAKoRICF8lPL+oe8= sha1:aD2iXHW8xVmSqUTWpMwDJg29br8= Xref: csiph.com comp.lang.php:15948 Jerry Stuckle writes: > On 12/21/2015 5:53 PM, Daniel Pitts wrote: >> 99.9% of my php files look something like the following. If I use >> require/include, it is a very specialized thing I'm doing. Probably the >> bootstrap or front-controller. >> >> > namespace ...; >> >> use ...; >> use ...; >> >> /** >> * ... >> */ >> class ... >> { >> } > > Why do you use namespaces? They are very useful in languages like C++, > but pretty worthless in PHP. > > As I said before, I do use it for my own classes, and things like > userids/passwords, which I store outside of my DOCUMENT_ROOT. > > But I have never found a need for namespaces in PHP (unlike C++). http://www.php-fig.org/psr/psr-4/ -- Matthew Carter (m@ahungry.com) http://ahungry.com