[pLog-svn] The use of constants

Oscar Renalias oscar at renalias.net
Mon Apr 23 11:54:14 EDT 2007


How are you supposed to use global variables in method definition? As in:

function myFunction( $param1 = MY_CONSTANT )

Versus:

function myFunction( $param1 = $can_I_use_a_global_variable_here )

Does that even work?? Or please clarify what you mean by "global variables".

Oscar

On 4/23/07, Ammar Ibrahim <ammar.ibrahim at gmail.com> wrote:
>
>
> On 4/23/07, Reto Hugi <plog at hugi.to> wrote:
> > Ammar Ibrahim wrote:
> > > I don't like globals as well, they are a bad software engineering
> > > practice. But if they are faster, I don't care.
> >
> > well, we do. Else we wouldn't do OO programming. sometimes it's worth to
> > sacrifice speed over
>
> What if the sacrifice is major? we could at least use global variables
>
> > > Benchmark and let us know :) but use PHP5
> >
> > Things you should know and keep in mind during the performance tests:
> >
> > - most or at least a significiant amount of users have php4 not php5.
> > that's why we provide backward compliance. we won't implement
> > improvements that brake the compliance.
>
> of course.
>
> > - we are not really interested in improvements other versions than
> > lifetype 1.2 as this is the version we support.
>
> I'm migrating to 1.2
>
> > - inlude_once was replaced with lt_include in 1.2 to improve performance
> > (lt_include does not lead to file access operations on every call -
> > there might be more to it, but that's what I remember...)
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.lifetype.net
> > http://limedaley.com/mailman/listinfo/plog-svn
> >
>
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>


More information about the pLog-svn mailing list