- var_dump: documentation ( source)
<?php
class Identifier
{
protected $id;
public function __construct($id)
{
$this->id = $id;
}
public function getValue()
{
return $this->id;
}
}
class Example
{
protected $id;
public function __construct(Identifier $id)
{
$this->id = $id;
}
public function sameValueAs($test)
{
return $test->id === $this->id;
}
}
$identifier = new Identifier('1');
$example = new Example($identifier);
var_dump($example);