Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Appendices : Migrating from PHP 3 to PHP 4 : Initializers

Initializers

Static variable and class member initializers only accept scalar values while in PHP 3 they accepted any valid expression. This is, once again, due to the split between parsing and execution as no code has yet been executed when the parser sees the initializer.

For classes you should use constructors to initialize member variables instead. For static variables anything but a simple static value rarely makes sense anyway.

Change Language


Follow Navioo On Twitter
What has changed in PHP 4
Running PHP 3 and PHP 4 concurrently
Migrating Configuration Files
Parser behavior
Error reporting
Initializers
empty('0')
Missing functions
PHP 3 extension
Variable substitution in strings
Cookies
Handling of global variables
eXTReMe Tracker