Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77004 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69855 invoked from network); 1 Sep 2014 11:24:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Sep 2014 11:24:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=dragoonis@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dragoonis@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.42 as permitted sender) X-PHP-List-Original-Sender: dragoonis@gmail.com X-Host-Fingerprint: 209.85.192.42 mail-qg0-f42.google.com Received: from [209.85.192.42] ([209.85.192.42:34089] helo=mail-qg0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/12-48532-77754045 for ; Mon, 01 Sep 2014 07:24:39 -0400 Received: by mail-qg0-f42.google.com with SMTP id a108so5056560qge.15 for ; Mon, 01 Sep 2014 04:24:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Yw5vma+JwDynQYOVf5OOKCkLr4583mqTBKcRf3k7OHg=; b=tp0MrezbZzBiQeTQsNUFhYwDVR548P5fhnqBGnROhqpTm5c8dl2rU1OzNtbhEl8/vK Xzw+ZlIEDovG4w4059qPOyv70K8uZfpDNAA7HldIzqq01ZE24DDN1mc94LLaqNbIEHKp nrTvPhb7oQ9wD0Mlz7ABuB2r8Nf96uLz13yNwM6Fjbn9KRtrIPXFwdutOvtNc7uYWv1+ j5lKQJzhRIVBc9E4D7yfNifGiTbhHWvJ9b1ypmtHdpxSSt/yQePjrPVKKHHt56gJkodQ xqrvXD1xHCyRLnh6NnqY4j3ojAtAs04JyTsGfyz+Phq7YqLe9DKpzVPzQb05jz5RC/ji gJeQ== MIME-Version: 1.0 X-Received: by 10.140.18.211 with SMTP id 77mr40666027qgf.57.1409570675864; Mon, 01 Sep 2014 04:24:35 -0700 (PDT) Received: by 10.229.97.71 with HTTP; Mon, 1 Sep 2014 04:24:35 -0700 (PDT) Received: by 10.229.97.71 with HTTP; Mon, 1 Sep 2014 04:24:35 -0700 (PDT) In-Reply-To: <2BBB5D80-5594-4F53-B507-4AD3BB03AE0A@gmail.com> References: <2BBB5D80-5594-4F53-B507-4AD3BB03AE0A@gmail.com> Date: Mon, 1 Sep 2014 12:24:35 +0100 Message-ID: To: "Tjerk Meesters (php maliing list)" Cc: PHP Internals List Content-Type: multipart/alternative; boundary=001a11353dd06bbd4d0501ff3f02 Subject: Re: [PHP-DEV] Making parse_ini_*() aware of types From: dragoonis@gmail.com (Paul Dragoonis) --001a11353dd06bbd4d0501ff3f02 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Seems like a no brainer and since its gone through voting then you could go ahead with it. On 30 Aug 2014 15:37, "Tjerk Meesters" wrote: > Hi internals, > > I was going through the bug list and found this report: > > https://bugs.php.net/bug.php?id=3D38409 > > It discusses the fact that `parse_ini_file()` and `parse_ini_string()` > throw away type information; for instance, the flag =E2=80=9Con=E2=80=9D = doesn=E2=80=99t translate > into a bool(true) but string(=E2=80=9C1=E2=80=9D). > > The report has had 21 votes and an average score of 4.3 +- 0.7, so it > seems to have some traction with users. > > > Simply changing this behaviour would cause BC, so I=E2=80=99ve found a wa= y in > which this can be solved with a separate scanner mode; e.g.: > > $data =3D parse_ini_file(=E2=80=98/path/to/file=E2=80=99, true, INI_SCANN= ER_TYPED); > > A patch for the lexer can be found here, together with a simple test case= : > > > https://github.com/datibbaw/php-src/compare/php:master...datibbaw:ini-sca= nner-plus > > It currently distinguishes between booleans, numbers and NULL (it was > mentioned in the ticket by someone else, not entirely sure of its > usefulness, though). I haven=E2=80=99t benchmarked it, but the impact on > performance should be quite minimal. > > Thoughts? > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a11353dd06bbd4d0501ff3f02--