[KLUG Members] PHP strict.

Richard Vincent members@kalamazoolinux.org
Sat, 3 Aug 2002 15:36:37 -0400


Wow ... that is pretty disturbing. 

-----Original Message-----
From: members-admin@kalamazoolinux.org
[mailto:members-admin@kalamazoolinux.org] On Behalf Of bill
Sent: Saturday, August 03, 2002 1:45 PM
To: members@kalamazoolinux.org
Subject: Re: [KLUG Members] PHP strict.

Short answer, no.

Variables are treated as strings by default.  It is not necessary to
define them
in advance.  You can test values for whatever type you want, and PHP
will handle
values however you want.

For example:

$var=1;
$anothervar=2;

$myvar = $var + $anothervar;
// myvar will be 3;  because this is math (+), it assumes numbers

$myvar = $var . $anothervar;
$myvar will be "12";  // because this is concantenation (.), it assumes
characters,
// So, this is the string "1" with the string "2" appended.

kind regards,

bill

Richard Vincent wrote:

> Hello,
>
> I'm in the process of learning PHP and I have a quick question. Is
there a way
> to use strict variable declaration inside of PHP? . Because right now
I get an
> error when I try and declare my variables at the top of my programs..
>
> Thank You
>
> Richard Vincent
>

_______________________________________________
Members mailing list
Members@kalamazoolinux.org