# Why can constants only be scalars?

- Thread: https://externals.io/message/9841
- Original archive: https://news-web.php.net/php.internals/9841
- Started by Jason Garber on 2004-05-13T15:43:08+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #9841 — Jason Garber — 2004-05-13T15:43:08+00:00

URL: https://externals.io/message/9841#9841

Was this considered?

$GLOBALS['foo'] = array('bar', 'baz');

function oink()
{
     echo $GLOBALS['foo'];
}


~Jason

At 5/13/2004 11:29 AM -0400, Sean Coates wrote:
>Ilya Sher wrote:
> > […]
>
>This can be accomplished in user-space, by cheating the existing $_* 
>superglobals (if you must -- cowiki does this, IIRC):
>
><?php
>
>$_SERVER['foo'] = array('bar', 'baz');
>
>function oink()
>{
>   print_r($_SERVER['foo']);
>}
>
>oink();
>
>?>
>
>S
