- var_dump: documentation ( source)
- settype: documentation ( source)
<?php
// r() simply returns a reference to a given variable.
function &r(&$v){return $v;}
// Here, we have a scalar $a on which settype() fails to operate if
// parentheses are involved.
print "Scalar demonstration:\n";
$a = 1;
// First with parentheses, then without.
// v v
settype( ( r($a) ) , "boolean"); var_dump($a);
settype( r($a) , "boolean"); var_dump($a);
// ^ ^