- var_dump: documentation ( source)
<?php
$a = new Local();
$a->action();
class Base
{
public function action($return = false)
{
$result = 'farok';
if ($return) {
return $result;
}
echo $result;
}
}
class Vendor extends Base
{
public function action($return = false)
{
// fetch contents without rendering
$result = parent::action(true);
// this would be new:
if ($return) {
return $result;
}
echo $result;
}
}
class Local extends Vendor
{
public function action($return = false)
{
// do some venture specific stuff
var_dump('fasz');
// call parent
$result = parent::action(true);
return $result;
}
}