- var_dump: documentation ( source)
<?php
class TestCounter {
private $private = 1;
protected $protected = 2;
public $public1 = 3;
public $public2 = 4;
public function countSelf() {
return count($this);
}
}
$test = new TestCounter;
var_dump(count($test), $test->countSelf());
$test->prop1 = 3;
var_dump(count($test), $test->countSelf());
$test->prop2 = 4;
var_dump(count($test), $test->countSelf());