in reply to Re: Re: Re: Re: php + Smarty looks like CGI
in thread php + Smarty looks like CGI

"Pass by ' Don't think so.
Yes, but what you're doing is explicitly accessing the argument list which is an array of aliases, which is somewhat of a hangover from earlier perls. But generally when you use the args passed into a subroutine you'll find that they were passed by value and not reference.
What do you mean by this?
In perl there's no standard way of creating or assigning class/object variables, whereas in PHP you can declare them with var $foo or create them with $this->foo = $thing and access them like so $this->foo.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: php + Smarty looks like CGI
by Koschei (Monk) on May 19, 2003 at 05:51 UTC
    Out of interest, how painless is it to override the accessors or mutators?
      If you've got a recent enough version (as is usually the case with PHP) you can do it very easily indeed by creating __get and __set methods and the calling then overload function with appropriate class name.
      HTH

      _________
      broquaint

Re: Re: Re: Re: Re: Re: php + Smarty looks like CGI
by Jenda (Abbot) on May 18, 2003 at 18:16 UTC

    1. Well ... but it's the aliases that are "passed" to the subroutine. When you do

    sub foo { my ($foo, $bar) = @_;
    you are assigning the values from the references/aliases passed to the subroutine to some lexical variables. The $foo and $bar are not the subroutine parameters, they are plain old lexicals that got their value from the parameters.

    2. I see. I've never worked with PHP so I did not know :-)

    Jenda
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature