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
[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
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
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
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,
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
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
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
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
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
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,
>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
> 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
13 matches
Mail list logo