Re: [PHP] Rate my (really) simple template class

2011-02-15 Thread David Hutto
On Mon, Feb 14, 2011 at 9:52 PM, Brian Waters wrote: > So I decided to write a template class in order to get myself going on > learning PHP. Of course I wrote the simplest thing possible: > > class Template > { >        protected $template; >        protected $vars; > >        public function __c

Re: [PHP] Rate my (really) simple template class

2011-02-15 Thread Adam Richardson
On Tue, Feb 15, 2011 at 5:02 PM, Brian Waters wrote: > On Mon, Feb 14, 2011 at 11:49 PM, Paul M Foster > wrote: > > Advice: don't use eval() this way. It's slow and dangerous. > > Could you elaborate, or provide a link? > Hi Brian, Here's a dated but still relevant reference: http://blog.joshua

Re: [PHP] Rate my (really) simple template class

2011-02-15 Thread Paul M Foster
On Tue, Feb 15, 2011 at 05:02:51PM -0500, Brian Waters wrote: > On Mon, Feb 14, 2011 at 11:49 PM, Paul M Foster > wrote: > > Advice: don't use eval() this way. It's slow and dangerous. > > Could you elaborate, or provide a link? A year or two on this list. The comments in the php.net article on

Re: [PHP] Rate my (really) simple template class

2011-02-15 Thread Brian Waters
On Mon, Feb 14, 2011 at 11:49 PM, Paul M Foster wrote: > Advice: don't use eval() this way. It's slow and dangerous. Could you elaborate, or provide a link? > ...read in the file and pass it to you on the stack, which is > really an abuse of the stack if you can avoid it. Interesting. I'm used

Re: [PHP] Rate my (really) simple template class

2011-02-14 Thread Paul M Foster
On Mon, Feb 14, 2011 at 09:52:51PM -0500, Brian Waters wrote: > So I decided to write a template class in order to get myself going on > learning PHP. Of course I wrote the simplest thing possible: > > class Template > { > protected $template; > protected $vars; > > publi