# PHP 8 release announcement page on php.net

- Thread: https://externals.io/message/112026
- Original archive: https://news-web.php.net/php.internals/112026
- Started by Roman Pronskiy on 2020-10-12T07:56:53+00:00
- Messages: 36
- Page 1 of 2: messages 1 to 25 (25 per page, add `?page=N` to the URL)
- Next page: https://externals.io/message/112026.md?page=2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #112026 — Roman Pronskiy — 2020-10-12T07:56:53+00:00

URL: https://externals.io/message/112026#112026

Hello Internals,

The PHP 8 release is going to be huge, and in some sense, you could
say it's a whole new language. There is a feeling that more can be
done to promote it more extensively.

Usually for releases, there’s a short text announcement on php.net.
This may be okay for minor releases and for people who are deeply
involved in PHP as they already know about the new features. But for
the majority of PHP developers and potential PHP developers, it is not
enough.

So, the idea is to create a separate release announcement landing page
to achieve the following goals:

– Promote the release of PHP 8 to the PHP developers
– Promote PHP as a modern language, as well as the PHP 8 release, to
the general tech audience

Alexander Makarov, myself, and Svetlana Belozerova, a designer from
JetBrains, have created the following concept:
https://i.imgur.com/6fKmTyM.jpg

We’d like to hear from you about how you like the idea. If you support
it, we’ll finish the design and work on a PR against
github.com/php/web-php with the implementation.

Looking forward to hearing what you think.

Roman Pronskiy,
PMM at JetBrains

---

## #112027 — Lynn — 2020-10-12T08:16:06+00:00

URL: https://externals.io/message/112026#112027 · In reply to: #112026

On Mon, Oct 12, 2020 at 9:57 AM Roman Pronskiy <roman.pronskiy@jetbrains.com>
wrote:

> Hello Internals,
>

Hi, this message ended up in my spam directory with the message, could be
that people missed it. When opening the message, gmail told me: "Gmail
could not verify that it actually came from jetbrains.com. Avoid clicking
links, downloading attachments, or replying with personal information."

---

## #112028 — Sebastian Bergmann — 2020-10-12T08:32:41+00:00

URL: https://externals.io/message/112026#112028 · In reply to: #112026

Am 12.10.2020 um 09:56 schrieb Roman Pronskiy:
> The PHP 8 release is going to be huge, and in some sense, you could
> say it's a whole new language. There is a feeling that more can be
> done to promote it more extensively.

Agreed!

> So, the idea is to create a separate release announcement landing page
> to achieve the following goals:
> 
> – Promote the release of PHP 8 to the PHP developers
> – Promote PHP as a modern language, as well as the PHP 8 release, to
> the general tech audience
> 
> Alexander Makarov, myself, and Svetlana Belozerova, a designer from
> JetBrains, have created the following concept:
> https://i.imgur.com/6fKmTyM.jpg

I like the idea as well as the concept you shared.

---

## #112029 — Lester Caine — 2020-10-12T08:49:36+00:00

URL: https://externals.io/message/112026#112029 · In reply to: #112026

> The PHP 8 release is going to be huge, and in some sense, you could
> say it's a whole new language. There is a feeling that more can be
> done to promote it more extensively.

HOPEFULLY that does not mean it's as much of a cock-up as Python 2 to 
Python 3 changes. Personally I think this simply reinforces my thought 
that I will simply stick with PHP7 for as long as I can. I'm still 
running 7.2 live, and working through the code changes to get 7.3 
running without warnings and since I'm reliant on Firebird I now have to 
manually build modules anyway so securing a private build I can maintain 
myself seems the right way forward.

-- 
Lester Caine - G8HFL
-----------------------------
Contact - https://lsces.uk/wiki/Contact
L.S.Caine Electronic Services - https://lsces.uk
Model Engineers Digital Workshop - https://medw.uk
Rainbow Digital Media - https://rainbowdigitalmedia.uk

---

## #112030 — Rowan Tommins — 2020-10-12T09:54:13+00:00

URL: https://externals.io/message/112026#112030 · In reply to: #112026

On Mon, 12 Oct 2020 at 08:57, Roman Pronskiy <roman.pronskiy@jetbrains.com>
wrote:

> The PHP 8 release is going to be huge, and in some sense, you could
> say it's a whole new language.
>


I think that's going a bit far. I don't want to detract from the great
features in 8.0, but there were great features in other releases as well -
7.4 had arrow functions and typed properties, for instance, which are just
as game-changing for some code as named parameters and constructor property
promotion.

So, while I like the idea of shouting about the release, I'd like to see
this become a regular effort for _every_ release from now on (i.e. 8.1,
8.2, etc), and I'd like to see it emphasise "version 8.0" rather than "PHP
8".

With both PHP 5 and PHP 7, there was a concerted "evangelism" effort to get
hosts and applications to upgrade, but really we want that to happen *every
year*, not just every 5 years. I'm concerned that people may consider "PHP
7" to be "current", even though both 7.0 and 7.1 are now EOL, and that the
same will happen with "PHP 8" in a few years' time.

Regards,
-- 
Rowan Tommins
[IMSoP]

---

## #112031 — AllenJB — 2020-10-12T10:47:24+00:00

URL: https://externals.io/message/112026#112031 · In reply to: #112026

> Hello Internals,
>
> The PHP 8 release is going to be huge, and in some sense, you could
> say it's a whole new language. There is a feeling that more can be
> done to promote it more extensively.
>
> Usually for releases, there’s a short text announcement on php.net.
> This may be okay for minor releases and for people who are deeply
> involved in PHP as they already know about the new features. But for
> the majority of PHP developers and potential PHP developers, it is not
> enough.
>
> So, the idea is to create a separate release announcement landing page
> to achieve the following goals:
>
> – Promote the release of PHP 8 to the PHP developers
> – Promote PHP as a modern language, as well as the PHP 8 release, to
> the general tech audience
>
> Alexander Makarov, myself, and Svetlana Belozerova, a designer from
> JetBrains, have created the following concept:
> https://i.imgur.com/6fKmTyM.jpg
>
> We’d like to hear from you about how you like the idea. If you support
> it, we’ll finish the design and work on a PR against
> github.com/php/web-php with the implementation.
>
> Looking forward to hearing what you think.
>
> Roman Pronskiy,
> PMM at JetBrains


As a developer I don't care for marketing fluff like this. What does 
this provide that the migration appendices and other documentation does 
not? I feel that this kind of page also has a very limited useful lifespan.

As others have commented, I'm not sure what about PHP 8 makes it any 
more of a "whole new language" than many previous releases.


I would much rather see the effort be focused on ensuring the migration 
guides be as complete and concise as possible whilst also ensuring other 
sections of the manual are updated too (information is sometimes only 
found in one or the other - ie. the migration guide is updated but the 
specific manual section is not).

I would say that what might actually help drive upgrades / adoption is 
promotion of tooling that helps detect and automatically update code 
where possible (php-compatibility for CodeSniffer, Rector, etc).

Obviously this starts to infringe on core's ongoing insistence on not 
referencing third party tools, but I feel this could possibly be solved 
with something like Python's Wiki that provides a "less official" area 
for community contributed content and "related content". (It need not 
necessarily be a wiki - it could be, for example, something GitHub powered)

Such an area might also provide an easier to contribute to and more 
easily organised and updated representation for the conferences (which, 
despite being labelled "Upcoming" on the front page makes no real 
distinction and still lists events from 2015 - it might also be useful 
to be able to categorize / filter conferences by geographic, language or 
online/offline) and talks sections of the site.

(I have talked about this before: 
https://externals.io/message/107096#107101 - see also my notes on 
Python's tutorial here and compare that to PHP.net's current official 
tutorial, which still references XForms and has a rather lacking "what's 
next" section)


I also think new releases could be a good point for reviewing existing 
documentation - in some cases I feel that some sections have grown 
unwieldy and hard to use (quickly find what you want) in their current 
form.

An example of this would be 
https://www.php.net/manual/en/language.types.array.php which is quite a 
long read and has no table of contents despite having many sub-sections. 
(A TOC would also help by exposing the section-specific link anchors 
that already exist in the manual but are not obvious unless you use a 
browser plugin that exposes them).

(It also appears to be missing information on array destructuring and 
unpacking features from 7.3 and 7.4 - an example of the specific manual 
sections not being updated that I mentioned earlier)


AllenJB

---

## #112032 — Arvids Godjuks — 2020-10-12T11:02:38+00:00

URL: https://externals.io/message/112026#112032 · In reply to: #112027

Can confirm, Gmail ate the email into spam folder.



> On Mon, Oct 12, 2020 at 9:57 AM Roman Pronskiy <
> roman.pronskiy@jetbrains.com>
> wrote:
>
> > […]
>
> Hi, this message ended up in my spam directory with the message, could be
> that people missed it. When opening the message, gmail told me: "Gmail
> could not verify that it actually came from jetbrains.com. Avoid clicking
> links, downloading attachments, or replying with personal information."

---

## #112033 — Eliot Lear — 2020-10-12T11:10:36+00:00

URL: https://externals.io/message/112026#112033 · In reply to: #112026

What helps me when I spread the word is if there is a simple page that
will look good on a retweet/FB/LinkedIn page, with a couple of release
highlights.  It doesn't need to be fancy, but something that flashes a
big PHP 8.0 logo or some such as the image as part of the preview would
be quite nice.

Eliot

---

## #112036 — Larry Garfield — 2020-10-12T13:24:42+00:00

URL: https://externals.io/message/112026#112036 · In reply to: #112033

> What helps me when I spread the word is if there is a simple page that
> will look good on a retweet/FB/LinkedIn page, with a couple of release
> highlights.  It doesn't need to be fancy, but something that flashes a
> big PHP 8.0 logo or some such as the image as part of the preview would
> be quite nice.
> 
> Eliot


Apropos of this... where did the PHP 8 logo come from?  And is it safe to reuse elsewhere for PHP 8-related marketing without further authorization?  What's the license on it and where can one get the original version?  (In SVG format, because all other logo formats are wrong.)

--Larry Garfield

---

## #112040 — Ben Ramsey — 2020-10-12T15:24:26+00:00

URL: https://externals.io/message/112026#112040 · In reply to: #112036

> 
> 
> 
> > […]
> 
> 
> Apropos of this... where did the PHP 8 logo come from?  And is it safe to reuse elsewhere for PHP 8-related marketing without further authorization?  What's the license on it and where can one get the original version?  (In SVG format, because all other logo formats are wrong.)
> 
> --Larry Garfield



Logo is from Vincent Pontier:

* https://twitter.com/Elroubio/status/1300843481829703681?s=20
* https://twitter.com/Elroubio/status/1300836386518585346?s=20

You can download it at https://www.elephpant.com

He offers it for free, in the same way he offers the elePHPant logo for free. There’s no license, though.

Cheers,
Ben

---

## #112041 — Gabriel Caruso — 2020-10-12T15:37:59+00:00

URL: https://externals.io/message/112026#112041 · In reply to: #112036

> 
> > […]
>
>
> Apropos of this... where did the PHP 8 logo come from?  And is it safe to
> reuse elsewhere for PHP 8-related marketing without further authorization?
> What's the license on it and where can one get the original version?  (In
> SVG format, because all other logo formats are wrong.)
>
> --Larry Garfield
>
> --
> 
> To unsubscribe, visit: https://www.php.net/unsub.php
>
>

AFAIK via https://twitter.com/Elroubio/status/1300843481829703681, more
specific https://www.donnedusens.fr/dwn/logo_php_8.zip.

---

## #112042 — Matthew Brown — 2020-10-13T04:06:22+00:00

URL: https://externals.io/message/112026#112042 · In reply to: #112026

W/r/t the goals:

– Promote the release of PHP 8 to the PHP developers
> – Promote PHP as a modern language, as well as the PHP 8 release, to the
> general tech audience


The page's design does a *great* job of promoting PHP 8 to existing PHP
developers, but a general tech audience skeptical of PHP's modern-day
relevance is unlikely to be swayed by improvements to WordPress
performance. I'm not sure that PHP's reputation with non-PHP developers can
be improved by a splash page.

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.

---

## #112047 — Roman Pronskiy — 2020-10-13T15:58:36+00:00

URL: https://externals.io/message/112026#112047 · In reply to: #112030

Agree, this should be for every release. So with this concept, we can
start from PHP 8.0, see how it works, and then reuse the template for
subsequent releases.


>
> On Mon, 12 Oct 2020 at 08:57, Roman Pronskiy <roman.pronskiy@jetbrains.com>
> wrote:
>
> > […]
>
>
> I think that's going a bit far. I don't want to detract from the great
> features in 8.0, but there were great features in other releases as well -
> 7.4 had arrow functions and typed properties, for instance, which are just
> as game-changing for some code as named parameters and constructor property
> promotion.
>
> So, while I like the idea of shouting about the release, I'd like to see
> this become a regular effort for _every_ release from now on (i.e. 8.1,
> 8.2, etc), and I'd like to see it emphasise "version 8.0" rather than "PHP
> 8".
>
> With both PHP 5 and PHP 7, there was a concerted "evangelism" effort to get
> hosts and applications to upgrade, but really we want that to happen *every
> year*, not just every 5 years. I'm concerned that people may consider "PHP
> 7" to be "current", even though both 7.0 and 7.1 are now EOL, and that the
> same will happen with "PHP 8" in a few years' time.
>
> Regards,
> --
> Rowan Tommins
> [IMSoP]



-- 
Best regards,
Roman Pronskiy
Product Marketing Manager of PhpStorm
https://www.jetbrains.com/

---

## #112049 — Benjamin Eberlei — 2020-10-13T16:31:49+00:00

URL: https://externals.io/message/112026#112049 · In reply to: #112026

Hi Roman,

On Mon, Oct 12, 2020 at 9:57 AM Roman Pronskiy <roman.pronskiy@jetbrains.com>
wrote:

> Hello Internals,
>
> The PHP 8 release is going to be huge, and in some sense, you could
> say it's a whole new language. There is a feeling that more can be
> done to promote it more extensively.
>
> Usually for releases, there’s a short text announcement on php.net.
> This may be okay for minor releases and for people who are deeply
> involved in PHP as they already know about the new features. But for
> the majority of PHP developers and potential PHP developers, it is not
> enough.
>
> So, the idea is to create a separate release announcement landing page
> to achieve the following goals:
>
> – Promote the release of PHP 8 to the PHP developers
> – Promote PHP as a modern language, as well as the PHP 8 release, to
> the general tech audience
>
> Alexander Makarov, myself, and Svetlana Belozerova, a designer from
> JetBrains, have created the following concept:
> https://i.imgur.com/6fKmTyM.jpg
>
> We’d like to hear from you about how you like the idea. If you support
> it, we’ll finish the design and work on a PR against
> github.com/php/web-php with the implementation.
>
> Looking forward to hearing what you think.
>

i love the idea!

Honestly in my opinion, the actual content itself and what is or what is
not on the page is not so important, this kind of release announcement post
is mostly about the signal effect to the outside world that there is a
force behind PHP that goes beyond "a few people tinkering on a programming
language" (to be hyperbolic). As such I think we should just do it and not
bikeshed over the content, or if this marketing speaks to old or new users
or what does. If the overall message is along the lines is "PHP gets faster
again, PHP gets more awesome features again, PHP is alive and kicking" then
this is a huge win :-)

>
> Roman Pronskiy,
> PMM at JetBrains
>
> --
> 
> To unsubscribe, visit: https://www.php.net/unsub.php

---

## #112051 — kocsismate90@gmail.com — 2020-10-13T16:43:18+00:00

URL: https://externals.io/message/112026#112051 · In reply to: #112049

Hi Roman,

I 100% agree with what Benjamin has just written. Marketing PHP as a
modern, thriving
programming language which (mostly) left its dark past behind is very much
needed.

That said, I'm very grateful for this idea, so thank you! I like the design
as well:
it's informative, looks clean, and fits php.net very well.

Regards:
Máté

---

## #112053 — tyson andre — 2020-10-13T23:56:16+00:00

URL: https://externals.io/message/112026#112053 · In reply to: #112042

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

---

## #112054 — Larry Garfield — 2020-10-14T01:41:24+00:00

URL: https://externals.io/message/112026#112054 · In reply to: #112053

> Hi internals,
> 
> > […]
> 
> 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

---

## #112055 — Peter Bowyer — 2020-10-14T07:21:33+00:00

URL: https://externals.io/message/112026#112055 · In reply to: #112053

> 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)
>

Add repl.it to the list: a couple of releases behind, but works very well
in my experience for testing.
https://repl.it/languages/php_cli

On the page: a big +1 from me. PHP needs some marketing, and I would like
the content to address the objections from naysayers online who start by
saying "I haven't used PHP since PHP 4/5 and I wouldn't use it because..."

Can any firms that support PHP donate a copywriter or marketing executive
to help?

Peter

---

## #112056 — Roman Pronskiy — 2020-10-14T08:20:58+00:00

URL: https://externals.io/message/112026#112056 · In reply to: #112033

>
> What helps me when I spread the word is if there is a simple page that
> will look good on a retweet/FB/LinkedIn page, with a couple of release
> highlights.  It doesn't need to be fancy, but something that flashes a
> big PHP 8.0 logo or some such as the image as part of the preview would
> be quite nice.
>
> Eliot
>

Sure. This is important. We'll design images for social networks.
These will be linked to the page via og: meta tags.

-Roman

---

## #112057 — Dik Takken — 2020-10-14T11:18:40+00:00

URL: https://externals.io/message/112026#112057 · In reply to: #112054

> 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.

I second this. However, then we should also make sure that the example
code actually works, and on which PHP versions. As soon as examples can
be run right from the documentation pages, the examples will be run far
more frequently than they are now, simply because it is so much easier
to do. Broken examples will cause more disappointing experiences.

I don't know if example code is currently tested automatically. If not,
adding a sandbox for running them may also offer an opportunity for
automatic testing.

Besides experimenting with example code, a sandbox may also be used to
expose runtime information. Think of generated opcodes, the JIT compiled
assembly, the AST.

At some point I can imagine adding a documentation page about
performance, optimization and JIT. That page could enable users to see
how an example code snippet is compiled, optimized and how type
inference is done. Change the code, change opcache settings and see what
happens. It is interesting to toy around with and it helps to get more
exposure to some impressive developments of recent years.

> 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.

Trying to lock things down will also limit the example code that can be
run. And we run the risk of overlooking things. Maybe we could learn
from other languages, how they set up their sandbox environments.

> If we need hosting for that, I work for a hosting company and we're happy to help.

I think we all highly appreciate that offer.

Regards,
Dik Takken

---

## #112058 — Brent Roose — 2020-10-14T11:34:26+00:00

URL: https://externals.io/message/112026#112058 · In reply to: #112057

Hi internals

Regarding the matter of a sandbox, one of my colleagues open sourced a Laravel sandbox that runs straight in the browser and uses docker containers, with a little work you can extract away the Laravel part and have it run plain PHP. Here's the source: https://github.com/spatie/tinker.app <https://github.com/spatie/tinker.app> and here's it running: https://tinker.app/ <https://tinker.app/>

On topic now, regarding the promo page: this kind of marketing is where PHP lacks a little bit, so I think it's a great initiative. A simple one pager just to promote PHP, one you can share with both PHP and non-PHP developers, and teases the right amount to get some people interested. A perfect page to share on hackernews, reddit, twitter and the likes. I think it's a great first step!

Kind regards
Brent

> 
> 
> 
> > […]
> 
> I second this. However, then we should also make sure that the example
> code actually works, and on which PHP versions. As soon as examples can
> be run right from the documentation pages, the examples will be run far
> more frequently than they are now, simply because it is so much easier
> to do. Broken examples will cause more disappointing experiences.
> 
> I don't know if example code is currently tested automatically. If not,
> adding a sandbox for running them may also offer an opportunity for
> automatic testing.
> 
> Besides experimenting with example code, a sandbox may also be used to
> expose runtime information. Think of generated opcodes, the JIT compiled
> assembly, the AST.
> 
> At some point I can imagine adding a documentation page about
> performance, optimization and JIT. That page could enable users to see
> how an example code snippet is compiled, optimized and how type
> inference is done. Change the code, change opcache settings and see what
> happens. It is interesting to toy around with and it helps to get more
> exposure to some impressive developments of recent years.
> 
> > […]
> 
> Trying to lock things down will also limit the example code that can be
> run. And we run the risk of overlooking things. Maybe we could learn
> from other languages, how they set up their sandbox environments.
> 
> > […]
> 
> I think we all highly appreciate that offer.
> 
> Regards,
> Dik Takken
> 
> -- 
> 
> To unsubscribe, visit: https://www.php.net/unsub.php

---

## #112059 — Sara Golemon — 2020-10-14T15:28:52+00:00

URL: https://externals.io/message/112026#112059 · In reply to: #112057

>
> However, then we should also make sure that the example
> code actually works, and on which PHP versions. As soon as examples can
> be run right from the documentation pages, the examples will be run far
> more frequently than they are now, simply because it is so much easier
> to do. Broken examples will cause more disappointing experiences.
>

Agreed 100%.  I do think it should be reasonable to write a one-time doc
scanner to look for <programlisting role="php" /> and attempt to run those
in a container.  It's not going to be a guarantee that the code does what
we *expect*, but we can probably turn it into a report of "things that
definitely don't parse" + "things that raise E_ERROR" + "things that
warn/notice, should be looked at" + "things that we hope probably work
maybe" and from there just have a prominent "report a bug about this
example" button which prefills a lot of the bugs.php.net form data and/or
maybe even avoid duplication by attaching "me too" to reports that have
already been filed for a given code snippet hash.

Bear in mind translations sometimes have unique bugs (variable names and
example content get translated too), so scanning the other languages would
be a good followup task.

TL;DR - Yes, this is work to do up front, but it's pretty clear that we can
turn this from a massive pile of wtf into a tractable problem.

> I don't know if example code is currently tested automatically. If not,
> adding a sandbox for running them may also offer an opportunity for
> automatic testing.
>

It's automatically run in the brain of whoever commits the example to the
docs repository. :(

Usually this doesn't lead to any *majorly* broken code, but a typo here or
there is sadly not uncommon.  Once in a while we get a report via
bugs.php.net and it's a quick fix, but bugs exist.

> - 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)
>
The simple implementation here is a "try this code" button that pops
3v4l.org open in a new tab with the code prefilled and running.  That means
a conversation with the owner of 3v4l.org obviously, but potentially
doable, and probably not hard.

> or https://psalm.dev/ (open source) are projects in that area
> (Matthew Brown is one of the authors of Psalm)
>
I don't like the idea of executing that on www.php.net for a few reasons,
but someone else mentioned the possibility of donated cpu time from
somewhere that's worth a conversation.

> - 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)
>
Honestly, I like this solution best.  There are drawbacks, and we'd
probably need to suppress it in certain reference chapters (e.g. mysql,
since there's no DB to talk to), but damn if it don't feel skippy trying it
out just now. (On my admittedly well connected, beefy dev workstation)

-Sara

---

## #112060 — Matthew Brown — 2020-10-15T05:46:40+00:00

URL: https://externals.io/message/112026#112060 · In reply to: #112059

>
> > […]
> I don't like the idea of executing that on www.php.net for a few reasons,
> but someone else mentioned the possibility of donated cpu time from
> somewhere that's worth a conversation.
>
> > […]
> of Phan)
> > […]
> Honestly, I like this solution best.  There are drawbacks, and we'd
> probably need to suppress it in certain reference chapters (e.g. mysql,
> since there's no DB to talk to), but damn if it don't feel skippy trying it
> out just now. (On my admittedly well connected, beefy dev workstation)
>
> -Sara
>

I don't think Tyson was suggesting running Psalm on php.net, merely showing
it as an example of a server-based approach. Ironically I added that
server-based demo because I was so taken by the client-side one on
hacklang.org which ran a version of Hack's typechecker transpiled from the
original Ocaml (it sadly doesn't work any more).

I think the WASM solution would be great. The 2MB download would be cached
between pages, and a simple bit of JS would ensure it was only downloaded
when a user wanted an interactive mode, and only on browsers that could run
WASM.

There'd also be the novelty of a mature language ecosystem relying on a
new, hip, technology. All the kids would love it.

---

## #112062 — Benjamin Eberlei — 2020-10-15T14:24:52+00:00

URL: https://externals.io/message/112026#112062 · In reply to: #112053

On Wed, Oct 14, 2020 at 1:56 AM tyson andre <tysonandre775@hotmail.com>
wrote:

> Hi internals,
>
> > […]
> homepage
> > […]
>
> 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
>

Sorry to step in here as this crowds out the original post too much imho,
this is really a tangential concern from Romans original post though.
Inline execution would be really awesome, but coupling this to a release
announcement to PHP 8 sets both projects up for failure imho.

To expand back to the topic, if we think Romans idea is great, then the
next steps would be to enable Roman to put this in place for the PHP 8
release. Its only 6 few weeks out, so going this backwards i would say

1. October: RMs and/or php-web maintainers should give their go on the idea
(someone else?), so that more detailed creative time investment is not
going to waste.
2. until mid November: Roman's group of contributors have time to finalize
creative design and copywirting
3. until mid November Someone with access to php-web would volunteer to
guide through technical roadblocks / deployment of the release
announcement, maybe keeping it simple as a static html page for now
4. ~20th November: Page is rolled out with a date based feature flag?


> --
> 
> To unsubscribe, visit: https://www.php.net/unsub.php

---

## #112063 — Kalle Sommer Nielsen — 2020-10-15T15:32:37+00:00

URL: https://externals.io/message/112026#112063 · In reply to: #112026

Hi

Den man. 12. okt. 2020 kl. 10.57 skrev Roman Pronskiy
<roman.pronskiy@jetbrains.com>:
> https://i.imgur.com/6fKmTyM.jpg

The concept looks great, however in the current state, it cannot go in
like that which mainly comes down to neutrality.

- This means we cannot display projects such as Symfony, Laravel and
WordPress at the top.Sure they are popular, but we cannot promote
them.
- At the same time we cannot have the community leaders section and
potentially not the one beneath that, again this comes down to
neutrality and not to show any sort of favoritism. Note we do not link
to Core Developer blogs or anything like that, the closet you would
get to that is people.php.net, and even that is limited.

This basically means that at best, this page can be a glorified
migration page with code examples and new features presented in a long
page style layout (unlike the sectioned multi page style that the
manual traditionally has), which I would be perfectly fine with and
accept if posted as a PR for php-web on Github. Personal side note
here: I would prefer to keep the written language similar to existing
style on PHP.net for consistency, the "overselling" part is personally
a bit too much for me, and more something I would expect to read on
pages like Zend.com that has a business gain for getting users on PHP8
or whatnot, however not a deal-breaker for me.

However the most important thing I see here is to actually begin
documenting these features, as linking to their RFCs, is not the way
we should document features. I'm currently not aware of what the
status is on that, but given the last few versions of PHP, we are
probably far from a state where PHP8 is broadly available in the
manual. This naturally is not a blocker for this project, but a
consideration.


Also note that anything related to the websites belong to the
php-webmaster@ mailing list, *not* internals and I would highly
recommend moving the thread there.


-- 
regards,

Kalle Sommer Nielsen
kalle@php.net

---

Next page: https://externals.io/message/112026.md?page=2
