- var_dump: documentation ( source)
<?php
class Something
{
private $value;
private function __construct($value) {
$this->value = $value;
}
public static function create($value) {
return new self($value);
}
public function __toString() {
return $this->value;
}
}
var_dump(strval(Something::create("hallo")));