Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42129 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68122 invoked from network); 6 Dec 2008 23:07:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Dec 2008 23:07:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=lstrojny@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=lstrojny@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 78.46.69.2 as permitted sender) X-PHP-List-Original-Sender: lstrojny@php.net X-Host-Fingerprint: 78.46.69.2 milch.schokokeks.org Received: from [78.46.69.2] ([78.46.69.2:38682] helo=milch.schokokeks.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/A8-27690-9C50B394 for ; Sat, 06 Dec 2008 18:07:54 -0500 Received: from [192.168.0.100] (static-87-79-91-235.netcologne.de [::ffff:87.79.91.235]) (AUTH: PLAIN lars@schokokeks.org, TLS: TLSv1/SSLv3,256bits,CAMELLIA256-SHA) by milch.schokokeks.org with esmtp; Sun, 07 Dec 2008 00:07:49 +0100 id 000000000000C007.00000000493B05C5.00004334 To: Igor Feghali Cc: PHP Internals List In-Reply-To: References: Date: Sun, 07 Dec 2008 00:07:46 +0100 Message-ID: <1228604866.18444.3.camel@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=_milch.schokokeks.org-17204-1228604869-0001-2" X-Mailer: Evolution 2.24.2 Subject: Re: [PHP-DEV] Implode() FR and Patch From: lstrojny@php.net (Lars Strojny) --=_milch.schokokeks.org-17204-1228604869-0001-2 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Igor, thanks for the patch, I think it is an idea worth considering. Except that the proposed solution with executing array_filter() might be enough. You ran into a situation where this became a bottleneck in your code? Am Samstag, den 06.12.2008, 00:21 -0200 schrieb Igor Feghali: > Hello There, >=20 > I would like to propose a third argument to implode(), named > skip_empty, that will cause empty elements to be ignored when > generating the implode string. By empty I mean everything that > converts to an empty string such as '', false, null, etc. For consistency, if we decide to introduce that for implode(), we should do it for explode() too. php -r "var_dump(explode(',', 'foo,,bla'));" array(3) { [0]=3D> string(3) "foo" [1]=3D> string(0) "" [2]=3D> string(3) "bla" } and php -r "var_dump(explode(',', 'foo,,bla', true));" array(2) { [0]=3D> string(3) "foo" [1]=3D> string(3) "bla" } Anyway, would you mind writing a proper RFC for the addition? cu, Lars --=20 Jabber: lars@strojny.net Weblog: http://usrportage.de --=_milch.schokokeks.org-17204-1228604869-0001-2 Content-Type: application/pgp-signature; name="signature.asc" Content-Transfer-Encoding: 7bit Content-Description: Dies ist ein digital signierter Nachrichtenteil -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (GNU/Linux) iQIcBAABAgAGBQJJOwXBAAoJECQPF+sCY6wH59QP/R1l5cOfENOLPhClPefSw73Y 7O1GjQCnwofgq+euY6iPM33t4b5jc6nFFpudbS9VvE8bpI/JLnaD2MzkJky75IPW v1p2ZlPMho1zAVaOBj12OHUVTTpjHA+7r/9F8ZvWFrigqB1LlHs2Z5hfrnTOW5TN 5M1LP0f3SoQYhRSUnVhHG6uvnM6srlWsVyLj12n+JyNGej5A6zV/mduZSIo6IhDS Kbhzxw5GkWN59U5/JYFY+m2aqhWZffZWiIG+67vStRX8qlZhte7Hc26o7aM6SKgG /IBbQHS3qxTb3iNStyGrIiWkiPS52hOCvd9sQL0MT8pMAdbqvKF0vE7AEBkQ71sJ j3Bl9Po2KNVWogArfYDyT6j75nH/yQnYlYT1snRqr0qip7EidK+bG/Ul9gkRb4/e SZkSH/aa2SxRLxlyVP25Z9/X3IYJPM1I6OTk8MqMDng610SWW6f+pWKYddPg+Q3S ACkV6rHtMD7RMeUy4e/Xklib0zeUQfVNmsq78xYCuQwxz3NByS7+XVO7ja24bsPa J45g/jllfzT+vYTowgAh4xHJrtnh3mNMBuoUGTdo9/F32x1AWPiopdZv9I+FllcR d6LLwMc1QBMRFmUjr47sl0IJns8CRFthHKK21ESO5Ea+JxihY8IInSEbbiNDNEH8 Q38FFhC4lY10p17hpJB/ =PpBR -----END PGP SIGNATURE----- --=_milch.schokokeks.org-17204-1228604869-0001-2--