Re: simpler syntax for arrays

From: Date: Thu, 18 Dec 2008 11:39:45 +0000
Subject: Re: simpler syntax for arrays
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-42325@lists.php.net to get a copy of this message
interesting idea, thanks. but unfortunately it won't help me as i really need to pass arrays as a single argument like this: my_func($param_1,$param_2,array(...)); i'm unaware of how to make patches for php so i wonder is it possible to add a dollar sign shortcut for array keyword. like this: my_func($param_1,$param_2,$(1, 2, 3)); regards, jay On Thu, 2008-12-18 at 12:20 +0100, Christian Schneider wrote: > jay wrote: > > okey. another syntax: > > myfunc($('key1'=>'val1', 'key2'=>'val2', > > ...)); > > This has been discussed and rejected several times. > > If you still want to be able to use this syntax you can use my patch at > http://cschneid.com/php/ > including a script to convert from and to this syntax. > We use this in our production environment so the patch will be updated > for future PHP versions ;-) > > If you want to use it in an environment where you cannot patch PHP you > could use our toolkit which provides an auto_prepend file with > just-in-time translation from new to old syntax. > See: http://itools.search.ch/ > > Regards, > - Chris

« previous php.internals (#42325) next »