If I have a base class that contains a static var, I then set this static var, and then have a class that extends the base class, will the extended class retain the value of the static var that I have already set in the base class?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Yes, although they're different variables, the static variables in both classes are in the same reference set.
You can break this reference set though, by using reference assignment (
=&
) or by redeclaring it in the extended class: