note 124989 deleted from function.property-exists by cmb

From: Date: Sat, 09 May 2020 13:36:09 +0000
Subject: note 124989 deleted from function.property-exists by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-214597@lists.php.net to get a copy of this message
Note Submitter: rnealxp at yahoo dot com ---- The function property_exists() does not work for class constants; it does work for private/public/private static/public static properties. <?php class a{ private $abc='aaa'; private static $def='def'; const GHI='GHI'; } if(property_exists('a','abc')===true){echo 'yes,';}else{echo 'no,';} if(property_exists('a','def')===true){echo 'yes,';}else{echo 'no,';} if(property_exists('a','GHI')===true){echo 'yes';}else{echo 'no';} ?> output: yes,yes,no

« previous php.notes (#214597) next »