- print_r: documentation ( source)
- get_class_vars: documentation ( source)
<?php
class Advert {
protected $id;
protected $headline;
protected $text;
protected $url;
protected $billing;
protected $remaining;
protected $total;
public function __construct(array $data) {
echo "<pre>" . print_r(get_class_vars($this), true) . "</pre>";
}
}
$x = new Advert();