Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95047 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52953 invoked from network); 11 Aug 2016 20:23:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2016 20:23:02 -0000 Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.82 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.82 mx101.easyname.com Received: from [77.244.243.82] ([77.244.243.82:54384] helo=mx205.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 76/C3-25876-5AEDCA75 for ; Thu, 11 Aug 2016 16:23:02 -0400 Received: from cable-81-173-132-156.netcologne.de ([81.173.132.156] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1bXwVG-0006rk-Ra; Thu, 11 Aug 2016 20:22:59 +0000 Reply-To: internals@lists.php.net References: <10fbcb03-5de8-4d9a-da1c-7e2bf77937cb@lsces.co.uk> <5657afc7-7569-5fc4-4a5a-27ed786c4fa5@gmail.com> <0825c173-5cb4-7f65-cf34-b45ca30919a3@lsces.co.uk> <8646c3ad-b929-cb0b-bad4-52a0a7160d16@gmail.com> <11ce571b-964b-5a3e-9f2f-3f69a8bc20b4@lsces.co.uk> To: Lester Caine , internals@lists.php.net Message-ID: <21323ed4-47a6-902e-2ead-672630373b41@fleshgrinder.com> Date: Thu, 11 Aug 2016 22:22:37 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <11ce571b-964b-5a3e-9f2f-3f69a8bc20b4@lsces.co.uk> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nnSpiO1Twn8R8sb46LQA5qNT9eorcxjAU" Subject: Re: [PHP-DEV] Simple variable handling. From: php@fleshgrinder.com (Fleshgrinder) --nnSpiO1Twn8R8sb46LQA5qNT9eorcxjAU Content-Type: multipart/mixed; boundary="iLIHv4Ng2iebtQiOq43D63aftLC5Rvn6X" From: Fleshgrinder Reply-To: internals@lists.php.net To: Lester Caine , internals@lists.php.net Message-ID: <21323ed4-47a6-902e-2ead-672630373b41@fleshgrinder.com> Subject: Re: [PHP-DEV] Simple variable handling. References: <10fbcb03-5de8-4d9a-da1c-7e2bf77937cb@lsces.co.uk> <5657afc7-7569-5fc4-4a5a-27ed786c4fa5@gmail.com> <0825c173-5cb4-7f65-cf34-b45ca30919a3@lsces.co.uk> <8646c3ad-b929-cb0b-bad4-52a0a7160d16@gmail.com> <11ce571b-964b-5a3e-9f2f-3f69a8bc20b4@lsces.co.uk> In-Reply-To: <11ce571b-964b-5a3e-9f2f-3f69a8bc20b4@lsces.co.uk> --iLIHv4Ng2iebtQiOq43D63aftLC5Rvn6X Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/11/2016 10:19 PM, Lester Caine wrote: > No ... add more than just validation rules. Include facilities such as > escape rules, display rules and variable specific material such as erro= r > messages. >=20 > Just how the rules are enforced needs to be flexible and such things as= > 'required' will vary how the results are interpreted. I don't see that = a > dynamic scripting language is improved by 'language-level enforcement' > when the bulk of the data IS flexible. It is the flexibility to include= > or exclude checks as required and while a sub-set of code may work > better with a fixed set of rules defined at 'design time', just as much= > code will consist of elements of the data set that will be optional or > variable. 'is_valid' on an object with a large set of variables is an > equally valid check and if each variable has the autonomy to return it'= s > state depending on other variables, then only the currently 'required' > variables need to be set and validated. >=20 > I AM interested in tracking the state of each variable but the validity= > of it's state may depend on the specific state of other elements and a > failure to set a variable depends on the particular workflow of the > whole data set. So creating a workflow that allows different paths base= d > on the results of validation is a lot more flexible than simply calling= > 'validate' on a static array of variables? >=20 > But to keep the 'exception' camp happy, there is no reason that the > 'strict' mode can't return exceptions while the 'weak' mode allows the > error to simply select an alternate path through the code. >=20 What you are describing are classes. You can achieve all of that with the= m. You are completely right btw. that exceptions should not be used during validation and for flow control. --=20 Richard "Fleshgrinder" Fussenegger --iLIHv4Ng2iebtQiOq43D63aftLC5Rvn6X-- --nnSpiO1Twn8R8sb46LQA5qNT9eorcxjAU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXrN6fAAoJEOKkKcqFPVVrsK8P/RxyjjjXWUgH4XWO82Q9qKwt jEynyqdSH2655UEqBhwhcT3LxnT9Db/DINxuNa99Ss/ARs4O2f+lV/Od9jtsdj+E 5sdzxfgaHN1mbYDAgDRb/wvH2X2Q0GQwOUj/FAtxx0TT6v3oig/d2SJQjukm1qSy Xc2KWwo7+GR1afC96OL8NvuWpZN/XDhXxLY0AsFULqtdoq25WZCuofgJQIDHsvAL BTWZ+l32GIKFWCQ+Ij3UT8uFiI85bGBkdkyfePu735yYIkkIJHyvMKrquA9jrqhC 3vaPICo4gGfs2moOvFZzfgNSP2vYoa+YTxC8DGkofXkEg/aj3KJh6vFRXuKDc5Tt /8VgH16urKAEYG6qsaCkcfcifs36GMBeIGYoRUxmPSL7W18BTZiRutucwaQS7gSN DnBnhJ9hQJgYa7Gm2QiW1RSy1weCKQRfSdga0BPaILv9lbcWp9ZzaOHuY3nQNS94 uOa0EdT3moFhOuhUKCtU5o5ufwhNkjAWdjMV3culk3JK2yX97enpBFLud3LSJViE iyajsEEAR8441pQsbBkCJK+w9GJ5uCrTucFQhUAv6STqMtFzSEjahPeo7q7rR3W0 AV6hCo0e0L/32i2s4CMQXTcHWob+fp9Rho3x7zK77lj9lk+1PuXtEhUA11n3JYBY p5HsDQBBoQvC3PBnHCQQ =1HWv -----END PGP SIGNATURE----- --nnSpiO1Twn8R8sb46LQA5qNT9eorcxjAU--