PHP Internals News: Episode 66: Namespace Token, and Parsing PHP

PHP Internals News: Episode 66: Namespace Token, and Parsing PHP

In this episode of "PHP Internals News" I chat with Nikita Popov (Twitter, GitHub, Website) about his Namespaced Names as a Single Token, and Parsing PHP.

The RSS feed for this podcast is https://derickrethans.nl/feed-phpinternalsnews.xml, you can download this episode's MP3 file, and it's available on Spotify and iTunes. There is a dedicated website: https://phpinternals.news

Transcript

Derick Rethans 0:16

Hi, I'm Derick, and this is PHP internals news, a weekly podcast dedicated to demystifying the development of the PHP language. This is Episode 66. Today I'm talking with Nikita Popov about an RFC that he's made, called namespace names as token. Hello Nikita, how are you this morning?

Nikita 0:35

I'm fine Derick, how are you?

Derick Rethans 0:38

I'm good as well, it's really warm here two moments and only getting hotter and so.

Nikita 0:44

Same here. Same here.

Derick Rethans 0:46

Yeah, all over Europe, I suppose. Anyway, let's get chatting about the RFC otherwise we end up chatting about the weather for the whole 20 minutes. What is the problem that is RFC is trying to solve?

Nikita 0:58

So this RFC tries to solve two problems. One is the original one, and the other one turned up a bit later. So I'll start with the original one. The problem is that PHP has a fairly large number of different reserved keyword, things like class, like function, like const, and these reserved keywords, cannot be used as identifiers, so you cannot have a class that has the name list. Because list is also a keyword that's used for array destructuring. We have some relaxed rules in some places, which were introduced in PHP 7.0 I think. For example, you can have a method name, that's a reserved keyword, so you can have a method called list. Because we can always disambiguate, this versus the like real list keyword. But there are places where you cannot use keywords and one of those is inside namespace names.

So to give a specific example of code that broke, and that was my, my own code. So, I think with PHP 7.4, we introduced the arrow functions with the fn keyword to work around various parsing issues. And I have a library called Iter, which provides various generator based iteration functions. And this library has a namespace Iterfn. So Iter backslash fn. Because it has this fn keyword as part of the name, this library breaks in PHP 7.4. But the thing is that this is not truly unnecessary breakage. Because if we just write Iter backslash fn, there is no real ambiguity there. The only thing this can be is a namespace name, and similarly if you import this namespace then the way you actually call the functions is using something like fn backslash operator. Now once again you have fn directly before a backslash so there is once again no real ambiguity. Where the actual ambiguity comes from is that we don't treat namespace names as a single unit. Instead, we really do treat them as the separate parts. First one identifier than the backslash, then other identifier, then the backslash, and so on. And this means that our reserved keyword restrictions apply to each individual part. So the whole thing.

The original idea behind this proposal was actually to go quite a bit further. The proposal is that instead of treating all of these segments of the name separately, we treat it as a single unit, as a single token. And that also means that it's okay to use reserved keywords inside it. As long as like the whole name, taken together is not a reserved keyword. The idea of the RFC was to, like, reduce the impact of additional reserved keywords, introdu

Truncated by Planet PHP, read more at the original (another 18806 bytes)

PHP Internals News: Episode 65: Null safe operator

PHP Internals News: Episode 65: Null safe operator

In this episode of "PHP Internals News" I chat with Dan Ackroyd (Twitter, GitHub) about the Null Safe Operator RFC.

The RSS feed for this podcast is https://derickrethans.nl/feed-phpinternalsnews.xml, you can download this episode's MP3 file, and it's available on Spotify and iTunes. There is a dedicated website: https://phpinternals.news

Transcript

Derick Rethans 0:18

Hi, I'm Derick, and this is PHP internals news, a weekly podcast dedicated to demystifying the development of the PHP language. This is Episode 65. Today I'm talking with Dan Ackroyd about an RFC that he's been working on together with Ilija Tovilo. Hello, Dan, would you please introduce yourself?

Dan Ackroyd 0:37

Hi Derick, my name is Daniel, I'm the maintainer of the imagick extension, and I occasionally help other people with RFCs.

Derick Rethans 0:45

And in this case, you helped out Ilija with the null safe operator RFC.

Dan Ackroyd 0:50

It's an idea that's been raised on internals before but has never had a very strong RFC written for it. Ilija did the technical implementation, and I helped him write the words for the RFC to persuade other people that it was a good idea.

Derick Rethans 1:04

Ilija declined to be talking to me.

Dan Ackroyd 1:06

He sounds very wise.

Derick Rethans 1:08

Let's have a chat about this RFC. What is the null safe operator?

Dan Ackroyd 1:13

Imagine you've got a variable that's either going to be an object or it could be null. The variable is an object, you're going to want to call a method on it, which obviously if it's null, then you can't call a method on it, because it gives an error. Instead, what the null safe operator allows you to do is to handle those two different cases in a single line, rather than having to wrap everything with if statements to handle the possibility that it's just null. The way it does this is through a thing called short circuiting, so instead of evaluating whole expression. As soon as use the null safe operator, and when the left hand side of the operator is null, everything can get short circuited, or just evaluates to null instead.

Derick Rethans 1:53

So it is a way of being able to call a methods. A null variable that can also represent an object and then not crash out with a fatal error

Dan Ackroyd 2:02

That's what you want is, if the variable is null, it does nothing. If a variable was the object, it calls method. This one of the cases where there's only two sensible things to do, having to write code to handle the two individual cases all the time just gets a bit tedious to write the same code all the time.

Derick Rethans 2:20

Especially when you have lots of nested calls I suppose.

Dan Ackroyd 2:25

That's right. It doesn't happen too often with code, but sometimes when you're using somebody else's API, where you're getting structured data back like in an in a tree, it's quite possible that you have the first object that might be null, it's not null, it's going to point to another object, and the object could be null so and so so down the tree of the structure of the data. It gets quite tedious, just wrapping each of those possible null variables with a if not null.

Derick Rethans 2:55

The RFC as an interesting ex

Truncated by Planet PHP, read more at the original (another 22729 bytes)

PHP 8.0.0 Beta 1 available for testing

The PHP team is pleased to announce the fourth testing release of PHP 8.0.0, Beta 1. This continues the PHP 8.0 release cycle, the rough outline of which is specified in the PHP Wiki. For source downloads of PHP 8.0.0 Beta 1 please visit the download page.Please carefully test this version and report any issues found in the bug reporting system.Please DO NOT use this version in production, it is an early test version. For more information on the new features and other changes, you can read the NEWS file, or the UPGRADING file for a complete list of upgrading notes. These files can also be found in the release archive. The next release will be Beta 2, planned for Aug 20 2020.The signatures for the release can be found in the manifest or on the QA site.Thank you for helping us make PHP better.

Laravel File Model

Package:
Laravel File Model
Summary:
Add support for file properties in Laravel models
Groups:
Design Patterns, Files and Folders, Libraries, PHP 5
Author:
Moamen Eltouny
Description:
This package can add support for file properties in Laravel models...

Read more at https://www.phpclasses.org/package/11746-PHP-Add-support-for-file-properties-in-Laravel-models.html#2020-08-05-13:47:20

10 Free Professional Intro Video Templates for After Effects

A great and effective intro for your video will help draw your audience in and encourage them to watch the rest. Creating a video intro from scratch can be time-consuming but you can easily save time with a premade, professional intro template.

In this post, we’ve gathered the best free professional video intros for Adobe After Effects that you can use as a starting point in your project.

You might also like our collection of the 10 Best Professional Intro Video Templates for After Effects

More After Effects templates: Titles, Animated Icons, Logo Reveals, Animated Fonts, Slideshows, Lower Thirds, and Openers.

Free Retro Wave Intro Flat Design After Effects Template (Free)

This free Retro Wave Intro is a perfect combination for any vintage or retro projects. The template features a colorful design and comes with 2 editable text layers, 1 logo placeholder and a full color controller.

intro animation ae adobe after effects template motion design project files video movie free

Elegant Corporate Intro (with Envato Elements)

This Elegant Corporate Intro can be used in corporate-style videos but you can also use it in wedding or fashion projects. The template includes 8 text and image placeholders as well as a detailed help file.

intro animation ae adobe after effects template motion design project files video movie free

Free Simple & Fast 2d Intro Template (Free)

If you need a simple and fast intro template, this intro is the right choice. The template is as simple as it can be and you can easily customize colors and add the text of your choosing.

intro animation ae adobe after effects template motion design project files video movie free

Cyberpunk Intro (with Envato Elements)

If you’re a fan of the cyberpunk style, don’t miss this Cyberpunk Intro. This is a great choice if you’re trying to achieve a more cinematic look in your videos. It would also be a great fit for a tech company.

intro animation ae adobe after effects template motion design project files video movie

Free Adobe After Effects Intro Templates (Free)

This free intro template features bold typography and duotone colors. You will get 5 image or video placeholders, 4 text placeholders, 1 logo placeholder, and a custom color controller.

intro animation ae adobe after effects template motion design project files video movie

Modern Intro (with Envato Elements)

First up is the Modern Intro template that features a bold and modern design. The template includes several different styles and you can easily customize the text, colors, and other elements used in the intro.

intro animation ae adobe after effects template motion design project files video movie

Free Spiral AE Intro Template (Free)

Consider this creative and unique intro template for your next video project. The template is easy to customize in terms of colors and text and you can also control the duration of the entire animation.

intro animation ae adobe after effects template motion design project files video movie free

Photographic Intro (with Envato Elements)

This cute intro is a great choice if you’re a photographer working on a video presentation of your work of if you’re trying to create a personal video presentation. Simply drop in your photos, change colors, and you’re good to go.

intro animation ae adobe after effects template motion design project files video movie

Free 2D Clean Intro Template for After Effects (Free)

The 2D Clean Intro Template for After Effects features a vintage design style and includes a detailed help file that will help you customize the template to your needs.

intro animation ae adobe after effects template motion design project files video movie free

Free Retro Intro AE Template (Free)

When you’re working on projects that require a retro look and feel, this template will come in handy. The template features a simple retro-style badge on a colored background. You can easily customize the colors and animation duration.

intro animation ae adobe after effects template motion design project files video movie free

Modern Website Presentation (with Envato Elements)

If you need a creative and unique way to present your web design client work or your portfolio, try this Modern Website Presentation template. You can also use it to showcase your website templates or CMS themes.

opener animation ae adobe after effects template motion design project files video movie

Free After Effects Intro Templates (Free)

This free After Effects intro template comes with 15 different image placeholders and can be used for corporate videos or any video that promotes a fashion or a jewelry brand.

intro animation ae adobe after effects template motion design project files video movie free

Split Screen 2D Intro AE Template (Free)

Try this split screen 2D intro for a more creative intro that makes it easier to showcase different information. The template includes a help file with editing instructions and you can change colors and text with ease.

intro animation ae adobe after effects template motion design project files video movie free

Free Short Gaming Intro After Effects Template (Free)

A gaming video project isn’t complete without a proper intro. Try this short but sweet gaming intro template to spice up any gaming channel on Youtube or on Twitch.

intro animation ae adobe after effects template motion design project files video movie free

Free Video Intro Templates for After Effects (Free)

This bright and clean After Effects intro template comes with 7 image or video placeholders and 7 text placeholders. It features an elegant animation that’s perfect for corporate and business video projects.

intro animation ae adobe after effects template motion design project files video movie free

Conclusion

Spice up your video with a professionally designed intro template. No matter which type of video you’re editing and producing, you will find an intro that suits your needs so be sure to check out these After Effects intro templates.

The post 10 Free Professional Intro Video Templates for After Effects appeared first on Speckyboy Design Magazine.

Installers that don’t suck

The first part of your web application that users will see is its installer. It’s a surprisingly important piece of your application, yet because it’s only seen once, it’s often an afterthought or doesn’t get the same attention as the user experience of other parts of the system. When it does, however, there is a tendency to focus on a very specific new-user experience only, to the detriment of the multitude of ways that a web application could be deployed, installed, or set up.
Powered by Gewgley