Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60153 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90288 invoked from network); 18 Apr 2012 05:56:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2012 05:56:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=confik@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=confik@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: confik@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:46907] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/64-21594-3A75E8F4 for ; Wed, 18 Apr 2012 01:56:52 -0400 Received: by yenl5 with SMTP id l5so3946047yen.29 for ; Tue, 17 Apr 2012 22:56:49 -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; bh=Ti2YYMIXdQrwL74CHT43SF3ZllZhj9DKns1TSWQSgA4=; b=idCgspW3O0d5WDii0vV6f1bRTQC8IYlNLR44Hnu9Fm72i8BbgmwGQGvbF9M0JDbus5 E1tZWflcKmnmeDU8zJzOE4TK+bms0k/DLIOiSiEURoz5FKlBH2S1tTR7ng9Dczjn8Rk1 /qx0dhJaIGxdjX5mSlDIzVMaRafUTThTRv5l08rO5XTIARON+yhA4RGs6QDog4R2RWaa XEEbJxdVH+ueYElU7/WN2rWcokQhzzfHc3KWwa0Z8SjLOgx30D1l5qDvoMELPBTEHURW DZ0zzzZm5JpaQJhdKltbqIcUmvbZwHG+DbQ3DkQCyTn+eXNbwkO8eIBkcY1nHjza3fmg LM7g== Received: by 10.236.185.10 with SMTP id t10mr794294yhm.112.1334728608944; Tue, 17 Apr 2012 22:56:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.213.40 with HTTP; Tue, 17 Apr 2012 22:56:28 -0700 (PDT) In-Reply-To: <4F8DF4B1.2040307@sugarcrm.com> References: <4F8DF4B1.2040307@sugarcrm.com> Date: Wed, 18 Apr 2012 10:56:28 +0500 Message-ID: To: Stas Malyshev Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] skipping optional parameters From: confik@gmail.com (Alexey Shein) Hi! My opinion is that solution tries to overcome bad consequences of legacy code, when it's not feasible to change something without breakage a lot of code, although the real solution is to refactor functions with long variable lists (as Uncle Bob says), maybe this should be noted in documentation of this feature. Alan nicely highlighted all cons of this feature, but instead of voting against it I suggest to put that into the docs, so people can use it wisely and understand consequences. One question about implementation: Given we have this function > function create_query($where, $order_by, $join_type='', $execute = false, $report_errors = 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=0", "name",,, /*report_errors*/ true); NULL or empty string? I.e. will optional parameters always get NULLs or their default values? Thanks. -- Regards, Shein Alexey