Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39701 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19880 invoked from network); 6 Aug 2008 15:38:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Aug 2008 15:38:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=hannes.magnusson@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=hannes.magnusson@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 216.239.58.185 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: hannes.magnusson@gmail.com X-Host-Fingerprint: 216.239.58.185 gv-out-0910.google.com Received: from [216.239.58.185] ([216.239.58.185:22848] helo=gv-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/7E-41960-B55C9984 for ; Wed, 06 Aug 2008 11:38:05 -0400 Received: by gv-out-0910.google.com with SMTP id e6so130402gvc.37 for ; Wed, 06 Aug 2008 08:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=baXWDFHblzIneM92d4SiOiW1dulFqff0LEQnZ7XDbkI=; b=X9clH6RevlphnjRivY6+APEFWEcF1aPHULdvw/+4pmtJwZt1l00bn5WVkjI2zk+FPL /+GSqoLaf7HRo2SBah4qT4UQ83wG1C7zPUFp1as2KEAyVGW4UVGH38smuxq0+CCw0VVA jaC0d+PSPMwIXfXA2fGZFQ0dehLZaBVbx/hsc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=vjqRRT/VPOwWUQ9bhGs9Z14DbBWCJxtEF5OFp6SDyQcRFcdXXsPf2nc0uRcX+XU4ri FjyiCLMucD0kiYIUZOxGPlmMmvvtGqSgvlQbXJfkDu8K+/JcI2n+eA/xWoMW44mFvt/7 dcjtLwITIQIe4gaUe/e1l2DTj09f5OetP5rcY= Received: by 10.103.52.13 with SMTP id e13mr1554785muk.80.1218037080546; Wed, 06 Aug 2008 08:38:00 -0700 (PDT) Received: by 10.103.248.20 with HTTP; Wed, 6 Aug 2008 08:38:00 -0700 (PDT) Message-ID: <7f3ed2c30808060838g48a23225gd05c49ab0d89b660@mail.gmail.com> Date: Wed, 6 Aug 2008 17:38:00 +0200 To: "Davey Shafik" Cc: "=?ISO-8859-1?Q?\"_\"Johannes_Schl=FCter_\"\"?=" , internals@lists.php.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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> Subject: Re: [PHP-DEV] [PATCH] Alias stream_context_get_default() as stream_context_set_default() From: hannes.magnusson@gmail.com ("Hannes Magnusson") 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