Weekly News for Designers № 552

Envato Elements

A Lightweight Masonry Solution A nice lightweight solution from Ana Tudor. The minified JavaScript is under 800 bytes, while the strictly masonry-related styles are under 300 bytes.
A Lightweight Masonry Solution

What is the difference between this & that? Learn the the differences between ___ and ___ in front-end development.
What is the difference between this & that?

Deep Dive into CSS Grid Dive deep into the CSS Grid Layout and explore almost all related properties and features.
Deep Dive into CSS Grid

Modern CSS Techniques To Improve Legibility This detailed article covers how we can improve website legibility using some modern CSS techniques,

Getting the Most Out of Variable Fonts on Google Fonts

Mobile App UX Design Process
Mobile App UX Design Process

Growing Your Audience as a Designer We discuss the key principles that allow community builders to rise above others, and how you can learn from the examples they set.

macintosh.js Freely download Macintosh Quadra with Mac OS 8.1, together with a bunch of apps and games. It runs on JavaScript.
macintosh.js

μPlot.js A fast, memory-efficient Canvas 2D-based chart library for quickly plotting time series, lines, areas, ohlc and bar charts.
μPlot.js

How to Troubleshoot WordPress Website Email Issues
How to Troubleshoot WordPress Website Email Issues

Forge Icons A collection of 300+ free SVG icons for your next design project.
Forge Icons

What Does 100% Mean in CSS?
What does 100% mean in CSS?

Should a Web Designer Ever Provide Discounts? Discounting your services is not really a good move. But, there are some scenarios where it does make sense to offer a lower price for your web services.

System UIcons A free collection of 220 clean and simple icons that have been designed specifically for products. Use them how you want, without attribution.

Free MacBook Mockup Photoshop PSD Templates Take a look at some of the best free Macbook computer mockups (Photoshop PSD) curated here and add them all to your resource library.

The post Weekly News for Designers № 552 appeared first on Speckyboy Design Magazine.

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:
Summary:
Add support for file properties in Laravel models
Groups:
Author:
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
Powered by Gewgley