note 95486 added to language.types
| From: | Wes at osu1 dot php dot net | Date: | Tue, 05 Jan 2010 19:08:21 +0000 |
| Subject: | note 95486 added to language.types | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-164667@lists.php.net to get a copy of this message | ||
Jeffrey, Note that using PHP's functions gettype() and get_class() are also useful for
deteriming what your are dealing with.
<?php
class Point
{
public $x = 0;
public $y = 0;
}
?>
Now, let's figure out what we just created.
<?php
$point = new Point();
if(gettype($point) == 'object')
{
echo 'This is a PHP object of type ' . get_class($point);
}
else
{
echo 'This is a PHP ' . gettype($point);
}
?>
Output: This is a PHP object of type Point
----
Server IP: 69.147.83.197
Probable Submitter: 69.85.144.120
----
Manual Page -- http://www.php.net/manual/en/language.types.php
Edit -- https://master.php.net/note/edit/95486
Del: integrated -- https://master.php.net/note/delete/95486/integrated
Del: useless -- https://master.php.net/note/delete/95486/useless
Del: bad code -- https://master.php.net/note/delete/95486/bad+code
Del: spam -- https://master.php.net/note/delete/95486/spam
Del: non-english -- https://master.php.net/note/delete/95486/non-english
Del: in docs -- https://master.php.net/note/delete/95486/in+docs
Del: other reasons-- https://master.php.net/note/delete/95486
Reject -- https://master.php.net/note/reject/95486
Search -- https://master.php.net/manage/user-notes.php