<?php
class Class1
{
public $property1;
public $property2;
public function __construct
(array $values = $this->createArrayWithEmptyStrings()) {
foreach ($this as $property => $value) {
$this->$property = $values[$property];
}
}
protected function createArrayWithEmptyStrings()
{
foreach ($this as $property => $value) {
$values[$this->$property] = "";
}
return $values;
}
}
?>
PD9waHAKY2xhc3MgQ2xhc3MxCnsKICAgIHB1YmxpYyAkcHJvcGVydHkxOwogICAgcHVibGljICRwcm9wZXJ0eTI7CgogICAgcHVibGljIGZ1bmN0aW9uIF9fY29uc3RydWN0KGFycmF5ICR2YWx1ZXMgPSAkdGhpcy0+Y3JlYXRlQXJyYXlXaXRoRW1wdHlTdHJpbmdzKCkpCiAgICB7CiAgICAgICAgZm9yZWFjaCAoJHRoaXMgYXMgJHByb3BlcnR5ID0+ICR2YWx1ZSkgewogICAgICAgICAgICAkdGhpcy0+JHByb3BlcnR5ID0gJHZhbHVlc1skcHJvcGVydHldOwogICAgICAgIH0KICAgIH0KICAgIAogICAgcHJvdGVjdGVkIGZ1bmN0aW9uIGNyZWF0ZUFycmF5V2l0aEVtcHR5U3RyaW5ncygpCiAgICB7CiAgICAgICAgJHZhbHVlcyA9IGFycmF5KCk7CiAgICAgICAgZm9yZWFjaCAoJHRoaXMgYXMgJHByb3BlcnR5ID0+ICR2YWx1ZSkgewogICAgICAgICAgICAkdmFsdWVzWyR0aGlzLT4kcHJvcGVydHldID0gIiI7CiAgICAgICAgfQogICAgICAgIHJldHVybiAkdmFsdWVzOwogICAgfQp9Cj8+Cg==