Re: Declare Function

From: Date: Tue, 15 Apr 2003 14:29:24 +0000
Subject: Re: Declare Function
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-143949@lists.php.net to get a copy of this message
Personally, I use declare when I'm setting up paramaters for a script to run, and the value I'm setting must not be overwritten by the script. Say I have a script that adds users to a site. In my configuration setup, I assign values to variables to connect to a database with one of the variables being called $user. Now, if my form has an element named "user", and I extract those form values from the post array, I will have changed the value of $user, and no longer be able to connect to my database. However, with declare, I can set these values, and they cannot be changed (either by bad coding on my part, hacking attempt, etc) lists@linuxgroup.net wrote:
I haven't done anything with declare before, so could you give me a brief explanation of what "execution parameters" are. Or, when it would be better to use declare. Thanks! Burhan Khalid <phplist@meidomus.com> wrote:
Hello lists, Monday, April 14, 2003, 4:48:24 PM, you wrote: lln> Whats the difference between lln> $var = "blah"; This declares a variable. lln> declare('var', 'blah'); This defines execution parameters for a block of code. Two very different things. -- Burhan Khalid phplist[at]meidomus[dot]com Please add reply-to: header with the list's email address for proper correspondence.
___________________________________________________________ This mail sent using V-webmail - http://www.v-webmail.co.uk


« previous php.general (#143949) next »