Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60155 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93076 invoked from network); 18 Apr 2012 06:02:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2012 06:02:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=peter.e.lind@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=peter.e.lind@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.170 as permitted sender) X-PHP-List-Original-Sender: peter.e.lind@gmail.com X-Host-Fingerprint: 209.85.210.170 mail-iy0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:52803] helo=mail-iy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/05-21594-BD85E8F4 for ; Wed, 18 Apr 2012 02:02:05 -0400 Received: by iaeh11 with SMTP id h11so11761033iae.29 for ; Tue, 17 Apr 2012 23:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=CrynDJLAVi54WjH5fSkHHZX3+liI8ZYZIesHIvsdSsY=; b=Sb30TRESuknY5AxkWGnJJDIRhnr9SWQHDa2OE4ZzNLg6cbQP3Nu/LJa4OKm+lf/bvB WEPHcCYUNY11gtb8X3HKeCGr+zf/cYdRATlp90Ojf03fs+kvp97T4kEJ2rdXN1zVZsxs 834HdvciZkgaDtHPp7HudSmMxTZd6hqO33C8ua00TA84DNK5XEY48Tf5JL7e0k0W0rMT QOZwP1U/cTb/ntiy4D7qL20RD2LNt7jQjmpwpZAIlFHtg9PW+XkgmG7mhg+Ks1NhT2/j 5kXDD7rufxWuERJLBNwqWICWSK47NZ1yp5LcgK17Yi1JPE1Cw32eF0jdD6MYRvi+MSOq /CLg== Received: by 10.50.202.69 with SMTP id kg5mr696672igc.7.1334728921083; Tue, 17 Apr 2012 23:02:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.157.66 with HTTP; Tue, 17 Apr 2012 23:01:40 -0700 (PDT) In-Reply-To: References: <4F8DF4B1.2040307@sugarcrm.com> Date: Wed, 18 Apr 2012 08:01:40 +0200 Message-ID: To: Alexey Shein Cc: Stas Malyshev , PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] skipping optional parameters From: peter.e.lind@gmail.com (Peter Lind) On 18 April 2012 07:56, Alexey Shein wrote: *snip* > > One question about implementation: > Given we have this function >> =C2=A0 function create_query($where, $order_by, $join_type=3D'', $execut= e =3D false, $report_errors =3D true) {} > and this statement >> On the engine level, it will be implemented by putting NULL in the place= where the parameter is passed. > > what value $join_type will get on this call? > create_query("deleted=3D0", "name",,, /*report_errors*/ true); > > NULL or empty string? I.e. will optional parameters always get NULLs > or their default values? It needs to be the default values, otherwise it will be a huge WTF for developers. With that in mind: +1 if default values are used when skipping parameters, -1 if NULL is used when skipping parameters (not that I have voting power, just showing preferences/support). Regards Peter --=20 WWW: plphp.dk / plind.dk LinkedIn: plind BeWelcome/Couchsurfing: Fake51 Twitter: kafe15