Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95064 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2930 invoked from network); 12 Aug 2016 08:57:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Aug 2016 08:57:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.42 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-wm0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:32918] helo=mail-wm0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 22/96-56950-86F8DA75 for ; Fri, 12 Aug 2016 04:57:12 -0400 Received: by mail-wm0-f42.google.com with SMTP id d196so2580611wmd.0 for ; Fri, 12 Aug 2016 01:57:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=OHVLCrqEHFfXMhV0En2KJDokqdxzN/9P1uoHD9SUUVE=; b=TBuU1or/PKwFX6Yh3wSgrFOwGq0KeqEda/noEqxljTdnzdNwMRHukKhiOpsOrdWhCF xbTv4G3co5Pk41O4iJPkwSZEcodhGkbpC1pgV9bejEPk3Tkr83ynDRC8Z6p8hLCt7tZ3 eNaTDwoIP6AZzYMA6o1DJwFGtbd0qBMzBjyw9jXPIc4P9D6i8UYpZ/nlFk+zC5t0vSlg x9r/okh8/7VZoRbCPWn67utiLFFvrRZ8pH1S9gM0RrCR8ExzgtouK6tUUkftKt/9trKf 73HFjDZCtkt/dF+S2eAje4W13PljiyXUt8lwNyEGUbebxqVgIZ3QwdK2MNus+iS41LQJ 1i1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=OHVLCrqEHFfXMhV0En2KJDokqdxzN/9P1uoHD9SUUVE=; b=g9HbI6ZKk+qrYFtgklJd0m4JIqerbXvF3BHn32f0UOFKWgIfcLYg/i22JwTcESpkmN z6eKBNOJzpmzrVSiL4RyPTd65TTNFhVYjeGupMz5XbSG7GAqWcp7WEsZKFv013fxlpIi mrVyf8e+Tp3wVDxvXxFUltw++Wtuq6HpwZouG2THel5YNvlna0XE+K9ulpOmwQZZyqcd fd1CY7ZQxpzRJh7vCdQJO9TS73L3lEV6h8tZ8DTr2PskvHsfvb0nCHSm5j7SBA5x8KYf 425+oluqyESS3uoKg0tZjki1mvD2fFLV4SniKg4kJOyOcaTvy/V3ckW4If+92nZ/y9NC ySMg== X-Gm-Message-State: AEkoouvhG2gv6+rZlrJ6YRdeafaNtXTjCvOTjuwzaICoEB4NH5UDTrvDOkvWyS3FrsNnjQ== X-Received: by 10.194.221.134 with SMTP id qe6mr14305083wjc.165.1470992228379; Fri, 12 Aug 2016 01:57:08 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id 142sm1561202wmh.12.2016.08.12.01.57.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Aug 2016 01:57:07 -0700 (PDT) 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> <7d9db8d5-ae7a-4123-14f4-f76fb6d764c5@gmail.com> Message-ID: <24e9b0e6-f1f7-e6b7-0c6d-69e5ae1922cd@gmail.com> Date: Fri, 12 Aug 2016 09:54:35 +0100 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Simple variable handling. From: rowan.collins@gmail.com (Rowan Collins) On 12/08/2016 09:19, Lester Caine wrote: > I'm thinking > $var->setConstraint() > $var->setEscape() > $var->setReadOnly() > > Rather than having to build 'reflections' classes to pull out data that > a simple $var->is_valid or echo $var will output a correctly escaped > piece of text. Note that as discussed on the recent RFC thread, escape mechanisms are very much specific to the *destination* of the data not the *source*. So having "echo $foo" call "echo $foo->escape()" isn't going to work. I guess you could have "echo $foo->forHTML()" with some kind of fallback that converts that to "echo htmlspecialchars($foo)" if nothing further is defined. Or "echo_html( $foo )" calling "$foo->forHTML()" internally if it's been defined against the variable. I haven't thought this through fully, just throwing ideas out there. Regards, -- Rowan Collins [IMSoP]