1.2.399. Dynamic Property¶
Dynamic access to class property. This is when the the name of the property is stored in a variable (or other container), rather than statically provided.
<?php
class x {
static public $foo = 1;
public $bar = 2;
}
$staticproperty = 'foo';
// dynamic static property call to x::$foo
echo x::${$staticproperty};
$property = 'bar';
// dynamic property call to bar()
$object = new x();
$object->$property = 4;
?>
See also class.
1.2.399.1. Connex PHP features¶
1.2.399.1.1. Specs¶
Short name |
Classes/DynamicPropertyCall |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Available in |