PDA

View Full Version : strict and functions


FFArmageddon
06-04-2003, 07:44 PM
As some of you may know, I am learning PHP.

In the book I am using I came to a chapter about functions. It explained the use of strict.

I do not fully understand what strict does. From what I read (I'm probebly wrong) but it makes it so a variable cannot be used outside of a function. But if you do not add global to the beginning of a variable in a function doesnt that do the same thing?

What is strict actually for? Thanks in advance.

Velocd
06-05-2003, 08:52 PM
I've never seen "strict" used, but you are correct globals cannot be modified outside anyway. I suppose if you strict a variable that is passed by reference, it would not modify the original. Honestly though, I don't see a purpose to it. Maybe, in structures or classes it has more value due to the complexity of variable permissions.

Velocd
06-05-2003, 08:53 PM
I've never seen "strict" used, but you are correct globals cannot be modified outside anyway. I suppose if you strict a variable that is passed by reference, it would not modify the original. Honestly though, I don't see a purpose to it. Maybe, in structures or classes it has more value due to the complexity of variable permissions.

Black Vivi
06-06-2003, 01:59 PM
strict isn't even in the php manual...