Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94091 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90556 invoked from network); 17 Jun 2016 19:29:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jun 2016 19:29:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=michael.vostrikov@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=michael.vostrikov@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.180 as permitted sender) X-PHP-List-Original-Sender: michael.vostrikov@gmail.com X-Host-Fingerprint: 209.85.220.180 mail-qk0-f180.google.com Received: from [209.85.220.180] ([209.85.220.180:34432] helo=mail-qk0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9A/2C-18862-D8F44675 for ; Fri, 17 Jun 2016 15:29:17 -0400 Received: by mail-qk0-f180.google.com with SMTP id s186so95500531qkc.1 for ; Fri, 17 Jun 2016 12:29:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=x1dYEJBQHrnLHxauhWLkSFgvkyX7peF+hK/C8qJmV3E=; b=ZX4kP7bBn9wzzlcV4kuPNBYx+TU7nX+BSoNb5A0WPvX1Td/jWGt0jRRSqP4kNlRuDi n37VEucUK2mFCaBt2tBNHOtJZYc9N0w4fwVybGb4XlAqhY3yCj5Dsz7g030oEMnKU5RE UMiDe56v9rRMaidpqvGy0PZFYCoRBIvEBpMzAr+o83IC1HefKIXcWAeuh4N+G4RI7M+y G2rEQ40/RRH09ErKeTXvtFt0uDhpopJtqSUjnHkcxnfsAeitZgXnb4AJ8Z1lBfIhSTZo bNpPY8puZOL1Lcz9WuVxm6qqYsaxVt0pj79BtVcC4nLjjmfyar5fONf1AOs8+H8nfdCD ARnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=x1dYEJBQHrnLHxauhWLkSFgvkyX7peF+hK/C8qJmV3E=; b=J1RaEHbEg+/1rglz5BROsqIkwBU3nIhZLJPLqlI3EKAQbbUzHMtgAHDJQvizIsfZW/ v9VAlLliyGDTt1MaPBtIKN/WZMipgWDj+sBWP0Ck+R2CHL8hKi0jHtO734omllh37uwW 7ynLJRgfXGOvCsgDlkJ8bSGYejUJUBLKckiuqpUOiUqig1CHWTS46AibV7LO5ObVilgm RKwnydL/VV7RcVaoCj5J7ZL2sYdTpdaruvlUoTv75YTMnBkWTa+QG19NO9PB5KiZYIwy qfvRZU0XQ1E5gnMnKXxb9gl/5ZNo/w60ByVDvqwpiL7PSCkpWadqELwPMbmsFSwrv316 ykkQ== X-Gm-Message-State: ALyK8tI9Fxv4ZPHrkVr7JIhSsvmqUdDub8hX5spTl5piDEMBtRW+TG1FKkrno3pLWmHnWSyDQiS2R+jAATGT7A== X-Received: by 10.55.26.94 with SMTP id a91mr4655008qka.26.1466191755085; Fri, 17 Jun 2016 12:29:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.53.71 with HTTP; Fri, 17 Jun 2016 12:29:14 -0700 (PDT) Date: Sat, 18 Jun 2016 00:29:14 +0500 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=001a1146eb62bc0cc905357e5e24 Subject: New escaped output operator From: michael.vostrikov@gmail.com (=?UTF-8?B?0JzQuNGF0LDQuNC7INCS0L7RgdGC0YDQuNC60L7Qsg==?=) --001a1146eb62bc0cc905357e5e24 Content-Type: text/plain; charset=UTF-8 Hello. I was thinking about a presence of escaped output operator in PHP and found this feature request: https://bugs.php.net/bug.php?id=62574. I think this is quite necessary feature. There are a lot of projects which is written without templating engine, and there are frameworks without built-in templating engine by default. All this projects require to write the code. Usually it is rather simple to switch to new version of language, but it is almost impossible to switch many and many templates on a templating engine. Most of output code is an output of properties of database entities, and only in some cases it's needed to concatenate HTML into string and then print it with unescaped output. Escaped output operator can be useful. Also we output data not into the void and not into simple text file, but into HTML-document which has a certain format (markup). Also this is logical - to have both forms, escaped and unescaped. I want to suggest the operator "", which will automatically wrap output in htmlspecialchars(). It is mentioned in the feature request above. It is quite easy to type, and there is a small possibility to write "" instead. In PHP 7 there are new operators and other changes. I think, new echo operator also can be added. I can implement it myself. --001a1146eb62bc0cc905357e5e24--