A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Waterfall_Cache has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 47

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 194

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Memcache_Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 275

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Filesystem_Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 440

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; APC_Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 628

PHPBuilder: Variable Variables, PHP, and You

PHPBuilder: Variable Variables, PHP, and You

By ServerWatch Staff (Send Email)
Posted Oct 1, 2000


"During a recent project I discovered a totally new concept in programming for myself, variable variables. I needed to update multiple records from one page. After banging my head on the wall for quite some time, I stumbled across the variable variable and all my troubles went away!" So, just what the heck is a variable variable anyway? According to the PHP manual, a variable variable takes the value of a variable and treats that as the name of a variable. While this may seem pretty straightforward, it can be a little confusing with so many uses of the word variable in one sentence. What the definition simply states is that you can set a variable -- x equals this -- and then set the variable variable, meaning you set the value of x as a new variable of x. In this example, the variable this would equal is cake.

"So, just what the heck is a variable variable anyway? According to the PHP manual, a variable variable takes the value of a variable and treats that as the name of a variable. While this may seem pretty straightforward, it can be a little confusing with so many uses of the word "variable" in one sentence. What the definition simply states is that you can set a variable -- x equals this -- and then set the variable variable, meaning you set the value of x as a new variable of x. In this example, the variable this would equal is cake."

Page 1 of 1


Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.


 

 


Thanks for your registration, follow us on our social networks to keep up-to-date