Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60193 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97551 invoked from network); 18 Apr 2012 18:05:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2012 18:05:46 -0000 Authentication-Results: pb1.pair.com header.from=pierrick@webstart.fr; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=pierrick@webstart.fr; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain webstart.fr from 209.85.160.42 cause and error) X-PHP-List-Original-Sender: pierrick@webstart.fr X-Host-Fingerprint: 209.85.160.42 mail-pb0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:40526] helo=mail-pb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/10-30923-6720F8F4 for ; Wed, 18 Apr 2012 14:05:45 -0400 Received: by pbcun1 with SMTP id un1so10060790pbc.29 for ; Wed, 18 Apr 2012 11:05:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=FNCHy2H5A62C2fp1YF5tXKf2zPnQofY/Xs6kct0g+X0=; b=mAjurbXubxqpP2ZHBHttI/6GqjpFDn4Y4fF+ssXJX8FFjLorc1pnjcARRVrUgEXHIg jQB9AGEZc0WKr/Z6qLjsdGQmbZr2Kb019BJu75zi42zx/fATvo5ZU9KCLXcxuAoxmqYw j74uXdjfT4PRgbBinKgu3Md6nVrceGxH5cYs4HcsgskT/pPAo3Jb5WRnLEO8ovwhBH5x iUfBBbunWsYqJNyEjMtxCef1VkLixaAwqqnKGPCvao0zaaGdqhCkm6vxoc3Jod7WBK/F faRCAD7DoKD3WzPoz+S7Hcm9nd8/umazGb1gVAD2tW9/OpGCbpjwlfovr1qgRh2SFMHq wsKw== MIME-Version: 1.0 Received: by 10.68.204.169 with SMTP id kz9mr8075156pbc.78.1334772339766; Wed, 18 Apr 2012 11:05:39 -0700 (PDT) Received: by 10.68.23.37 with HTTP; Wed, 18 Apr 2012 11:05:39 -0700 (PDT) In-Reply-To: <4F8DF4B1.2040307@sugarcrm.com> References: <4F8DF4B1.2040307@sugarcrm.com> Date: Wed, 18 Apr 2012 14:05:39 -0400 Message-ID: To: Stas Malyshev Cc: PHP Internals Content-Type: multipart/alternative; boundary=e89a8ffbae9f2af6b004bdf7e74b X-Gm-Message-State: ALoCoQlvh7eDwpyA+U7+Z/i6YYFRemAVmpYWdzne+TlZyw3JWZuF2UxohtDobJL7TGVC7ILjwRDE Subject: Re: [PHP-DEV] [RFC] skipping optional parameters From: pierrick@webstart.fr (Pierrick Charron) --e89a8ffbae9f2af6b004bdf7e74b Content-Type: text/plain; charset=ISO-8859-1 I like the idea. In fact I started to implement it some time ago, but your patch is really cleaner than mine :) Otherwise I would prefer to insert the default keyword to make the code more readable. It might be hard to count when you have something like function(,,,,true); P. On 17 April 2012 18:54, Stas Malyshev wrote: > Hi! > > One of the annoying things I've encountered in working with PHP was > dealing with functions having long optional parameter lists, especially > if you need to change only the last one - you have to copy all the > defaults. Full named params implementation would solve it, probably, but > before we have that here's an easier solution for part of the problem: > > https://wiki.php.net/rfc/skipparams > > Basically, it allows you to do this: > > create_query("deleted=0", "name",,, /*report_errors*/ true); > > Implementation of it is here: > https://github.com/smalyshev/php-src/tree/skip_params > All things described in RFC seem to be working, please tell me if I > forgot anything. If it's accepted I'll also add tests, etc. of course. > > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --e89a8ffbae9f2af6b004bdf7e74b--