note 111515 deleted from function.get-defined-constants by sobak
| From: | sobak@php.net | Date: | Sun, 04 Dec 2016 10:54:20 +0000 |
| Subject: | note 111515 deleted from function.get-defined-constants by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208148@lists.php.net to get a copy of this message | ||
Note Submitter: bimal at sanjaal dot com
----
Though the syntax editors mark the following as error, it executes successfully under PHP, as you
desire.
<?php
$user_defined_constants=get_defined_constants(true)['user'];
print_r($user_defined_constants);
?>
No errors/warnings seen.
Only the special thing here is, you are passing true to the function, and extracting the
result's 'user' index directly.