Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112054 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 42610 invoked from network); 14 Oct 2020 02:26:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Oct 2020 02:26:35 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 802681804B7 for ; Tue, 13 Oct 2020 18:41:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 13 Oct 2020 18:41:49 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D0CEF10C5 for ; Tue, 13 Oct 2020 21:41:47 -0400 (EDT) Received: from imap26 ([10.202.2.76]) by compute4.internal (MEProxy); Tue, 13 Oct 2020 21:41:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=HMPQUE cYFdKJD5CS5SLG4KBUUr2aGo9ZE1dFKKx0t90=; b=qKvVS/oFJSm/9lULjj9yHs d2mkGqZb9WaCVqm/Y3B6zvjmFJFw7BG7Mn8Ew+bitBWTfOt1WGhx+U898wsdCP/e nol6+KnsEqY5ehJphqXdNGFGx2cPONDXmXFfS3fP9Qk4hrrd4tK7TE8OR5BKSHwc 5BRmugPJmjJOJTlsmzRuWtKAthiHvV+hjS5tSesPztDobxWb8d0yaOCh+umOcQDx tQoxTHjp98ebIfxzNqptnC63u/jZnm+IAcLDpZGVeCTg2PUnoKQCQvjH1r5UXmgi 717GP69SKlEjnb2Gq+RAyQ66e4O7MyQL2A6YtTjQaVT7u/rJ02iiTpDoVP3iJ2WQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedriedtgdehtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenog fuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefofgggkfgjfhffhffvufgt sehttdertderredtnecuhfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoehlrg hrrhihsehgrghrfhhivghlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnheptdef ledtleduvdevudeiieehieevueffhfegueffveehudeigfeijeejvdeljeffnecuffhomh grihhnpehphhhprdhnvghtpdhthihpvghstghrihhpthhlrghnghdrohhrghdpghholhgr nhhgrdhorhhgpdhmohiiihhllhgrrdhorhhgpdhruhhsthdqlhgrnhhgrdhorhhgpdefvh eglhdrohhrghdpphhsrghlmhdruggvvhdpghhithhhuhgsrdhiohenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivg hlughtvggthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2F6A814200A6; Tue, 13 Oct 2020 21:41:47 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-407-g461656c-fm-20201004.001-g461656c6 Mime-Version: 1.0 Message-ID: In-Reply-To: References: Date: Tue, 13 Oct 2020 20:41:24 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] PHP 8 release announcement page on php.net From: larry@garfieldtech.com ("Larry Garfield") On Tue, Oct 13, 2020, at 6:56 PM, tyson andre wrote: > Hi internals, > > > As far as php.net can help with PHP's reputation, I think a brief homepage > > intro that showcased some modern-looking PHP code would be great (e.g. > > typescriptlang.org, golang.org). The docs design could also be > > slightly tweaked to make everything seem newer, while still keeping the > > (very good) content basically the same. > > That reminds me of an idea I had a while ago: > One of the features I've seen on many other programming > languages' documentation and tutorials was the ability to run and edit > the example snippets. > It may help in understanding the content of tutorials or example > snippets for functions, > - e.g. seeing what happens if code is rearranged > or how PHP handles edge cases > - It also allows new developers to try out php before deciding to > install it. > > Right now, you can read the examples in > https://www.php.net/manual/en/language.variables.scope.php > and copy them to run them locally, but you can't run them and see their > output > (as plain text or html, depending on context) > > Some examples in other languages: > > - MDN has JavaScript demos in the browser, e.g. > > https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some > - Rust has https://play.rust-lang.org/ (run on the server side) > - golang has https://tour.golang.org/welcome/1 (run on the server side) > > There's two main options available for testing out php in a browser right now: > > - A general sandboxed php implementation hosted by the owners of php.net > (requires that it be secured and may lead to additional hosting > costs), > https://3v4l.org/ (not open source https://3v4l.org/about - but > similar to what I was thinking of) > or https://psalm.dev/ (open source) are projects in that area > (Matthew Brown is one of the authors of Psalm) > - A WebAssembly solution, e.g. https://phan.github.io/demo/ (forked > from https://oraoto.github.io/pib/) > (I'm one of the maintainers of Phan) > > WebAssembly has some noticeable drawbacks such as requiring a modern > browser, > requiring a large download, and requiring more RAM than an ordinary > website. > Many other websites for programming languages have moved to sandboxed > implementations > hosted on an actual server. > > Thanks, > - Tyson This sounds like a fantastic idea. The inline-run capability of Go and Rust's documentation is a huge win. Writing good sample code for the documentation would be an interesting challenge, but it's the sort of thing that can be done over time. The interesting question would be how to configure it to ensure it doesn't become a security issue. We'd probably need to lock down the environment's ini settings *hard* to make sure it can't do any outgoing communication at all. If we need hosting for that, I work for a hosting company and we're happy to help. --Larry Garfield