Copyright © tutorialspoint.com
| property_exists ( $object, $property ); |
This function checks if the given property exists in the specified class (and if it is accessible from the current scope).
| Parameter | Description |
|---|---|
| object | Required. The tested object |
| property | Required. The name of the property. |
Returns TRUE if the property exists, FALSE if it doesn't exist or NULL in case of an error.
Following is the usage of this function:
<?php
class Test {
public $property;
public foo() { echo($property); }
}
property_exists('Test', 'property'); // will return true
property_exists('Test', 'Property'); // will return false
?>
|
Copyright © tutorialspoint.com