Re: [PHP-DEV] PHP Array Literals

2006-02-02 Thread Steph Fox
AIL PROTECTED]> To: "php internals" Sent: Friday, February 03, 2006 6:05 AM Subject: Re: [PHP-DEV] PHP Array Literals [Reply below] On 2/2/06, Christian Schneider <[EMAIL PROTECTED]> wrote: While I would kinda like array literals too (and even had a patch for it some ti

Re: [PHP-DEV] PHP Array Literals

2006-02-02 Thread James Crane
[Reply below] On 2/2/06, Christian Schneider <[EMAIL PROTECTED]> wrote: > While I would kinda like array literals too (and even had a patch for it > some time ago, don't remember if it was without problems though) the > core developers think that > a) one working solution is enough > b) array() is

Re: [PHP-DEV] PHP Array Literals

2006-02-02 Thread James Crane
So, all I heard as reasons not to introduce the '[]' syntax for creating arrays is because "'array()' is perfectly fine" and that it wouldn't make sense to have two syntaxes (compared to other legacy stuff in PHP). And certainly nobody has an objection to the fact that developers have to learn that

Re: [PHP-DEV] PHP Array Literals

2006-01-29 Thread James Crane
Or could learn that [] creates arrays the same way that it is used to access and assign pieces of arrays. M.T. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] PHP Array Literals

2006-01-29 Thread Jasper Bryant-Greene
Robert Deaton wrote: On 1/29/06, James Crane <[EMAIL PROTECTED]> wrote: Then why don't we have these: $i = integer(5); $f = float(4.5); $s = string("foo"); Perhaps because any sane person will know without reading a manual, that " delimits a string, a number without a decimal is an integer,

Re: [PHP-DEV] PHP Array Literals

2006-01-29 Thread Robert Deaton
On 1/29/06, James Crane <[EMAIL PROTECTED]> wrote: > Then why don't we have these: > > $i = integer(5); > $f = float(4.5); > $s = string("foo"); Perhaps because any sane person will know without reading a manual, that " delimits a string, a number without a decimal is an integer, and a number with

Re: [PHP-DEV] PHP Array Literals

2006-01-29 Thread Derick Rethans
On Sun, 29 Jan 2006, James Crane wrote: > Of course, that woudln't make sense. We, instead, use appropriate syntax: > > class MyClass { > public function method($arguments) { >// method body here > } > } > > Suitable, logical, appropriate code. To me, 'array()' just seems on > the verge of

Re: [PHP-DEV] PHP Array Literals

2006-01-29 Thread Marcus Boerger
Hello James, you missed recently emerged $it = betty() here or did i get confused now? Sunday, January 29, 2006, 9:21:20 PM, you wrote: > Then why don't we have these: > $i = integer(5); > $f = float(4.5); > $s = string("foo"); > And what about classes? It's slightly different, what with it

Re: [PHP-DEV] PHP Array Literals

2006-01-29 Thread James Crane
Then why don't we have these: $i = integer(5); $f = float(4.5); $s = string("foo"); And what about classes? It's slightly different, what with it being a definition rather than a specific literal value, but it produces a definition, pseudo value if you will, so why not have: class("MyClass", arr

Re: [PHP-DEV] PHP Array Literals

2006-01-29 Thread Ted Dziuba
On 1/29/06, James Crane <[EMAIL PROTECTED]> wrote: > > No, it's definitely not that hard to write, but I have seeing > 'array()' everywhere when I know damn well that it's an array. > > Concerning the 'pass by reference' problems, I'm going to assume that > that's happening when you're working with

Re: [PHP-DEV] PHP Array Literals

2006-01-29 Thread James Crane
No, it's definitely not that hard to write, but I have seeing 'array()' everywhere when I know damn well that it's an array. Concerning the 'pass by reference' problems, I'm going to assume that that's happening when you're working with some of the functions already in PHP or someone else's code,

Re: [PHP-DEV] PHP Array Literals

2006-01-29 Thread Ted Dziuba
>My reasoning is that I want to be able to quickly, in a non-verbose, intuitive way, create inline arrays which I >do a lot of in my applications. Is it really that hard to do $x = array( "cat", "dog" "mouse")? I would say this is very concise and intuitive, as the "array" word in there suggests

Re: [PHP-DEV] PHP Array Literals

2006-01-28 Thread Brian Moon
> Unfortunately, something needs to be clarified under the > previous heading: using array(...) is, in actuality, not > calling a function. Neither is include, require, echo, define and other syntax. How would you change those? > $x[] = "one"; > $x[] = "two"; > $x[] = "three"; > This is clea