Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29969 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39003 invoked by uid 1010); 30 May 2007 22:02:57 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 38988 invoked from network); 30 May 2007 22:02:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 May 2007 22:02:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=s_federici@yahoo.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=s_federici@yahoo.com; sender-id=unknown; domainkeys=good Received-SPF: error (pb1.pair.com: domain yahoo.com from 68.142.207.240 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: s_federici@yahoo.com X-Host-Fingerprint: 68.142.207.240 web32613.mail.mud.yahoo.com Received: from [68.142.207.240] ([68.142.207.240:41722] helo=web32613.mail.mud.yahoo.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/C7-16032-F84FD564 for ; Wed, 30 May 2007 18:02:56 -0400 Received: (qmail 32489 invoked by uid 60001); 30 May 2007 22:02:53 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Message-ID; b=IT2kzfTfiHNudj87Wxc6aHDL0pdxD4e9fmgVyqBNf4I9mywP4avCCBGPyjI8ooB49QiPPhcnxKoAgHrYOQCjTCGkMQUzdbp8NRdjTvQNUWTsKIelA6CZv+yO5WnM5U7zEozEe3ZW+TPbaaDM7KvdsOKpAANk+cAzZRtz6QkN+Xo=; X-YMail-OSG: Wly9rNkVM1ntYdnNc7rc7pU_1NvtlNjdbtJ61vvFJyDvMRrK4xGDfr.ZiOGaRUJ9mJiv2A-- Received: from [209.191.119.123] by web32613.mail.mud.yahoo.com via HTTP; Wed, 30 May 2007 15:02:53 PDT X-Mailer: YahooMailRC/651.29 YahooMailWebService/0.7.41.16 Date: Wed, 30 May 2007 15:02:53 -0700 (PDT) To: internals@lists.php.net Cc: stefano federici MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1073946197-1180562573=:30896" Message-ID: <44409.30896.qm@web32613.mail.mud.yahoo.com> Subject: theoretical PHP arrays From: s_federici@yahoo.com (stefano federici) --0-1073946197-1180562573=:30896 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi,=0AI trying to find a reason why array functions are not allowed to be u= sed as normal arrays. To clarify, I'm allowed to write=0A=0A$arr =3D array(= "maria", "mario", "luigi", "luisa");=0Aecho $arr[1];=0A=0Abut I'm not allo= wed to write=0A=0Aecho array( "maria", "mario", "luigi", "luisa")[1];=0A=0A= In PHP documentation I read that "array" is a language construct, not a fun= ction. So this may be the reason. But I also tried with=0A=0Aecho (explode = (" ", "maria mario luigi luisa"))[1];=0A=0Aand this doesn't work either (ev= en if "explode" is a function). Not surprisingly,=0A=0A$arr =3D explode (" = ", "maria mario luigi luisa");=0Aecho $arr[1];=0A=0Adoes work. So, if I can= straightforwardly divide by, say, 2 the integer output by a function, why = shouldn't I be allowed to straightforwardly use the array output by a funct= ion?=0A=0AThis is not something completely weird that I'm asking. In Visual= Basic (that I know mustn't be the most loved programming language for PHP = users) you can say=0A=0Aprint array( "maria", "mario", "luigi", "luisa")(1)= =0A=0AMaybe is THIS the reason why it doesn't work in PHP? ;-)=0A=0AThanks = for your consideration and help=0A=0AStefano=0A=0A=0A=0A =0AStefano Federic= i=0A-------------------------------------------------=0AUniversit=E0 degli = Studi di Cagliari=0AFacolt=E0 di Scienze della Formazione=0ADipartimento di= Scienze Pedagogiche e Filosofiche=0AVia Is Mirrionis 1, 09123 Cagliari, It= alia=0A-------------------------------------------------=0ATel: +39 349 818= 1955 Fax: +39 070 937 1870 --0-1073946197-1180562573=:30896--