Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85527 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39028 invoked from network); 29 Mar 2015 12:30:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Mar 2015 12:30:04 -0000 Received: from [127.0.0.1] ([127.0.0.1:9456]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id D6/B0-34966-B40F7155 for ; Sun, 29 Mar 2015 07:30:03 -0500 Authentication-Results: pb1.pair.com header.from=gm@gm.lv; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=gm@gm.lv; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gm.lv designates 188.226.183.209 as permitted sender) X-PHP-List-Original-Sender: gm@gm.lv X-Host-Fingerprint: 188.226.183.209 unknown Received: from [188.226.183.209] ([188.226.183.209:39005] helo=smtp.gm.lv) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/B0-34966-BFFE7155 for ; Sun, 29 Mar 2015 07:28:45 -0500 Received: from [10.59.26.116] (unknown [81.198.169.230]) by smtp.gm.lv (Postfix) with ESMTPSA id CAB9240DF1 for ; Sun, 29 Mar 2015 12:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gm.lv; s=mail; t=1427632120; bh=ZtFRaHWSDLFjlgJ6gYZxNPcZTDAKthPonG7fRQU0YXg=; h=From:Subject:Date:To:From; b=WrTHU7fQ/XJDqK77HL3pSJIRz9uO/6NBOY/mMWcOgTOa1RYWOoQQ9fRcgDIjHDLEi L5T92xu0uNG1sJleGddJiMDzdVt+SPBKd5h0JaYB1hADnPjsxebUm3PODJGO7/vTrR 49mYyadFINGTBGm9bdxWM01LOzFyiL5SP2+rDcUU= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <76D3DA4F-06EE-4F6B-893E-1D111FAD3C2C@gm.lv> Date: Sun, 29 Mar 2015 15:28:39 +0300 To: internals@lists.php.net Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) X-Mailer: Apple Mail (2.2070.6) Subject: Re: [PHP-DEV] [RFC] Named parameters From: gm@gm.lv (Gints Murans) Hi, What happened to this RFC? This is a really great idea for php. For example this function: function getIdByTitle($title, $insert =3D false) { // find record // If no record find and $insert =3D=3D=3D true, insert new = record and return the id // Return false } Reading over some old code, this way it would be a lot easier to = understand what that second parameter boolean =3D true is:=20 getIdByTitle('sample', insert =3D true) than this way:=20 getIdByTitle('sample', true) Also great for skipping default parameters. About syntax: $insert =3D> true seems kind of confusing:=20 $insert =3D true; getIdByTitle('sample', $insert =3D> $insert) My preference would be either - getIdByTitle('sample', insert =3D = $insert) or getIdByTitle('sample', insert: $insert) with no parameter = name prefixes. =E2=80=94--- Gints Mur=C4=81ns