![]() |
strict and functions
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. |
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.
|
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.
|
strict isn't even in the php manual...
|
All times are GMT. The time now is 08:14 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|