note 58748 added to function.property-exists
| From: | timshel at osu1 dot php dot net | Date: | Tue, 15 Nov 2005 00:20:17 +0000 |
| Subject: | note 58748 added to function.property-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-98563@lists.php.net to get a copy of this message | ||
I haven't tested this with the exact function semantics of 5.1, but this code should implement
this function in php < 5.1:
<?php
if (!function_exists('property_exists')) {
function property_exists($class, $property) {
if (is_object($class))
$class = get_class($class);
return array_key_exists($property, get_class_vars($class));
}
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.property-exists.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58748
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58748&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58748&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58748&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58748&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58748&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58748&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58748&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58748&report=yes
Search -- http://master.php.net/manage/user-notes.php