Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39723 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42274 invoked from network); 7 Aug 2008 01:42:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Aug 2008 01:42:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=davey@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=davey@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 207.97.245.203 as permitted sender) X-PHP-List-Original-Sender: davey@php.net X-Host-Fingerprint: 207.97.245.203 smtp203.iad.emailsrvr.com Linux 2.4/2.6 Received: from [207.97.245.203] ([207.97.245.203:44262] helo=smtp203.iad.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 29/65-29324-D035A984 for ; Wed, 06 Aug 2008 21:42:37 -0400 Received: from relay10.relay.iad.mlsrvr.com (localhost [127.0.0.1]) by relay10.relay.iad.mlsrvr.com (SMTP Server) with ESMTP id 88C821F05D8; Wed, 6 Aug 2008 21:42:34 -0400 (EDT) Received: by relay10.relay.iad.mlsrvr.com (Authenticated sender: davey-AT-pixelated-dreams.com) with ESMTP id 302731F0285; Wed, 6 Aug 2008 21:42:34 -0400 (EDT) To: "Hannes Magnusson" In-Reply-To: <7f3ed2c30808060838g48a23225gd05c49ab0d89b660@mail.gmail.com> References: <220AF877-747F-4BDB-8631-235B54ED2503@php.net> <7f3ed2c30808040049w7172205ey4ae460be4beabcee@mail.gmail.com> <1217847749.4175.27.camel@goldfinger.johannes.nop> <7f3ed2c30808040414y41f32ef6ka5a9396e027978d5@mail.gmail.com> <2A1FDF9D-4C69-433C-8187-6D3C8A1BA550@php.net> <7f3ed2c30808060047jb918049o8492b9c4bf58bd77@mail.gmail.com> <7f3ed2c30808060838g48a23225gd05c49ab0d89b660@mail.gmail.com> Message-ID: <6EB9D0F2-EC46-40E9-BF21-6A19D9DEA290@php.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v928.1) Date: Wed, 6 Aug 2008 21:42:33 -0400 Cc: =?ISO-8859-1?Q?=22\=22_\=22Johannes_Schl=FCter_\=22\=22=22?= , internals@lists.php.net X-Mailer: Apple Mail (2.928.1) Subject: Re: [PHP-DEV] [PATCH] Alias stream_context_get_default() as stream_context_set_default() From: davey@php.net (Davey Shafik) On Aug 6, 2008, at 11:38 AM, Hannes Magnusson wrote: > On Wed, Aug 6, 2008 at 15:11, Davey Shafik wrote: >> On Aug 6, 2008, at 03:47 AM, Hannes Magnusson wrote: >> >>> On Wed, Aug 6, 2008 at 06:24, Davey Shafik wrote: >>>> >>>> OK, here's an attempt at a patch[1], I discussed it briefly with >>>> Johannes >>>> and he felt some discussion was needed with regards to the return >>>> value. >>>> >>>> I personally seem some benefit to returning the "new" context; >>>> Johannes >>>> wasn't sure that returning "true" might not be a better option in >>>> that we >>>> cannot return the previous "value" like ini_set(). >>> >>> Why can't we? >>> If there was a default context then return it, otherwise true/ >>> false.. >>> Hmh. That could be confusing. >>> I'm fine returning the new context :) >> >> There is always a default context :) >> >>> >>>> [1] http://pixelated-dreams.com/~davey/stream_context_set_default.patch >>> >>> The arginfo is wrong, the parameter is required, not optional. >> >> I don't see this, but that's just me not knowing, I thought that >> anything >> following >> a | (pipe) was optional, otherwise it was implicitly required, >> how do you make an argument explicitly required if that is not the >> case? > > Correct, but ext/reflaction doesn't read the zend_parse_parameters(), > it reads the arginfos, so those have to match the > zend_parse_parameters() statement. > > ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_set_default, 0, 0, 0) > > should be > ZEND_BEING_ARG_INF(arginfo_stream_context_set_default, 0) > (meaning all ZEND_ARG_INFO() arguments are required) > or > ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_set_default, 0, 0, 1) > (meaning only the first ZEND_ARG_INFO() argument is required) > > -Hannes Done, thank you for the explanation :) - Davey