<?php
// sample code for showing how type hinting is used in php
class a
{
public function __construct(b $b)
{
echo $b->v;
}
}
class b
{
public $v;
function __construct($val)
{
$this->v = $val;
}
}
$objb = new b('PHP is best');
$obj = new a($objb);
?>