- var_export: documentation ( source)
<?php
interface Test
{
public function selfRef(Test $other);
}
class TestImpl implements Test
{
public function selfRef(Test $other)
{
echo var_export($other, true) . PHP_EOL;
}
public function nonContractSelfRef(self $other)
{
echo var_export($other, true) . PHP_EOL;
}
}
class DerivedTestImpl extends TestImpl { }
$a = new TestImpl();
$b = new DerivedTestImpl();
$a->nonContractSelfRef($b);