PHP/Reflection/gettype
Creating an object from the Cat class
<source lang="html4strict">
<?php class Cat { } $fluffy = new Cat( ); echo gettype($fluffy); ?>
</source>
Displaying the Type of a Variable
<source lang="html4strict">
<html> <body>
<?php
$testing; // declare without assigning print gettype( $testing ); print "
"; $testing = 5; print gettype( $testing ); print "
"; $testing = "five"; print gettype( $testing ); print "
"; $testing = 5.0; print gettype( $testing ); print "
"; $testing = true; print gettype( $testing ); print "
";
?>
</body>
</source>