I have a class:
Code: Select all
class myClass{
private static $objectNumber = 1;
private $var;
public $var2;
private $otherVar1;
private $otherVar2;
...
Code: Select all
function __construct($var){
$this->objIncrement = self::incrementObjectNumber();
$this->var = $var;
$this->var2 = $var;
$this->otherVar1 = 'whatever';
$this->otherVar2 = 'also whatever';
}
Code: Select all
final private static function incrementObjectNumber(){
self::$objectNumber++;
}
like this:
Code: Select all
myClass Object
(
[var:private] => Array
(
[something] => Array
(
[value1] => whatever
[value3] => whatever
)
)
[otherVar1:private] => whatever
[otherVar2:private] => also whatever
[var2] => Array
(
[something] => Array
(
[value1] => whatever
[value3] => whatever
)
)
)