Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66134 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72617 invoked from network); 21 Feb 2013 20:49:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Feb 2013 20:49:12 -0000 Authentication-Results: pb1.pair.com header.from=andre.romcke@ez.no; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=andre.romcke@ez.no; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ez.no designates 216.32.180.12 as permitted sender) X-PHP-List-Original-Sender: andre.romcke@ez.no X-Host-Fingerprint: 216.32.180.12 va3ehsobe002.messaging.microsoft.com Received: from [216.32.180.12] ([216.32.180.12:1044] helo=va3outboundpool.messaging.microsoft.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/52-58335-44886215 for ; Thu, 21 Feb 2013 15:49:10 -0500 Received: from mail202-va3-R.bigfish.com (10.7.14.235) by VA3EHSOBE005.bigfish.com (10.7.40.25) with Microsoft SMTP Server id 14.1.225.23; Thu, 21 Feb 2013 20:49:06 +0000 Received: from mail202-va3 (localhost [127.0.0.1]) by mail202-va3-R.bigfish.com (Postfix) with ESMTP id 7B3562000DA; Thu, 21 Feb 2013 20:49:06 +0000 (UTC) X-Forefront-Antispam-Report: CIP:157.56.254.181;KIP:(null);UIP:(null);IPV:NLI;H:DBXPRD0711HT004.eurprd07.prod.outlook.com;RD:none;EFVD:NLI X-SpamScore: -3 X-BigFish: PS-3(zzbb2dI98dI1432Izz1f42h1ee6h1de0h1d18h1202h1e76h1d1ah1d2ahzz8275ch17326ah8275bh19a27bh172cdfhz2fh2a8h668h839h947hd25he5bhf0ah1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1758h18e1h1946h19b5h1155h) Received-SPF: pass (mail202-va3: domain of ez.no designates 157.56.254.181 as permitted sender) client-ip=157.56.254.181; envelope-from=andre.romcke@ez.no; helo=DBXPRD0711HT004.eurprd07.prod.outlook.com ;.outlook.com ; Received: from mail202-va3 (localhost.localdomain [127.0.0.1]) by mail202-va3 (MessageSwitch) id 1361479743321803_1521; Thu, 21 Feb 2013 20:49:03 +0000 (UTC) Received: from VA3EHSMHS033.bigfish.com (unknown [10.7.14.236]) by mail202-va3.bigfish.com (Postfix) with ESMTP id 4A44050004E; Thu, 21 Feb 2013 20:49:03 +0000 (UTC) Received: from DBXPRD0711HT004.eurprd07.prod.outlook.com (157.56.254.181) by VA3EHSMHS033.bigfish.com (10.7.99.43) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 21 Feb 2013 20:49:03 +0000 Received: from DBXPRD0711MB574.eurprd07.prod.outlook.com ([169.254.12.216]) by DBXPRD0711HT004.eurprd07.prod.outlook.com ([10.255.178.37]) with mapi id 14.16.0263.000; Thu, 21 Feb 2013 20:49:01 +0000 To: Sebastian Krebs CC: Klaus Ufo , PHP internals list Thread-Topic: [PHP-DEV] PHP 6 : a new API ? Thread-Index: AQHODzsUTSS6ClAFyEqyNd4j1X3tepiCiRKAgAJCQwA= Date: Thu, 21 Feb 2013 20:49:01 +0000 Message-ID: <4677B7D9-2612-4064-95B6-CF8E12DB7D9E@ez.no> References: <1361344921.21988.YahooMailClassic@web171605.mail.ir2.yahoo.com> In-Reply-To: Accept-Language: nb-NO, de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.255.178.4] Content-Type: text/plain; charset="iso-8859-1" Content-ID: <41BBD58DFB5C584ABA4FF6A70ACD8B9D@eurprd07.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: ez.no Subject: Re: [PHP-DEV] PHP 6 : a new API ? From: andre.romcke@ez.no (=?iso-8859-1?Q?Andr=E9_R=F8mcke?=) On Feb 20, 2013, at 11:19 , Sebastian Krebs wrote: > 2013/2/20 Klaus Ufo >=20 >> Hi there ! >>=20 >> We all know that the current PHP API has flaws. Maybe we could use >> namespaces to build a new coherent PHP API ? Like : >>=20 >> - \arr >> - \num >> - \str >>=20 >> and so on. Advantages : >>=20 >> - no more global functions >>=20 >=20 > Just to throw that in: Even if you pack them into namespaces they will > still remain global functions. They simply don't live in the root-namespa= ce > anymore. +1 So why not avoiding this by adding it as methods of the scalar variable ins= tead, aka autoboxing. This would allow the new api to be closer to what people are used to from o= ther languages, needs far less typing and IDE autocomplete of available fun= ctions pr type with "->". More recent example by Nikita Popov, see unit tests of the project for exam= ples: https://github.com/nikic/scalar_objects/blob/master/tests/string.phpt#L17 >=20 >=20 >> - separation of concerns >> - backward compatibility >=20 > - work can be done progressively >> - easy to add user-defined functions (using php namespaces) >> - we could provide a \str\utf8 namespace >>=20 >> This is just an idea. I don't know what is your vision for a next PHP 6. >>=20 >> KH >>=20 >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >>=20 >>=20 >=20 >=20 > --=20 > github.com/KingCrunch