- var_dump: documentation ( source)
<?php
class StrTo
{
public function __toString() {
$result = 'hello';
var_dump($result);
return $result;
}
}
$i = new StrTo();
switch ($i)
{
case 1:
case '1':
echo 'one';
break;
case 'hello':
echo 'hello';
case $i:
default:
break;
}