Planet PHP
[/] All news in one place Evert Pot Hello 2022! (6.1.2022, 04:08 UTC) Yesterday I received an email from a reader asking ‘Are you ok?’. It’s been nearly 8 months since the last time I wrote here. In that last post I celebrated blogging on this website for 15 years with some consistency, so perhaps it’s a bit ironic for that to be immediately followed by complete silence. The last big gap in blogging for me was in 2017, the year I joined Yelp. This experience was so depressing, every day I was done work I had no creative energy left for anything else. 2021 was a bit different though. 2 years back I started a software development agency , which grew from 2 to 5 people in the last year. The stakes have increased quite a bit, and it’s taken up a lot of my emotional reserves. I’ve also made the mistake of not taking any vacation all year. There was just not much gas left in the tank. This is so stupid. Less time off doesn’t result in more productivity. I know this, but the last 2 years there’s been little travel or activities due to lockdowns and restrictions. Every day looks the same and it kind of just flew by. Over the last holidays I’ve taken an actual break though, and have since started several new projects and buzzing with new ideas. I’m still motivated to work on Curveball and Ketting (we use it every day for almost every customer!), and I’ve also started a series of live streams in which I build a Time Tracking application with Hypermedia on twitch.tv/evrt3 . If this sounds interesting, the first few episodes are up on my youtube channel , but I’ll share more on this blog later. I’m also preparing for a tech talk on January 19th for Toronto JS . It’s online and free! So am I ok? I think I am? This year is off to a good start. I just have to make sure I don’t forget to take it easy. Happy stupid new year! I hope it sucks less! Link Larry Garfield Advent of Functional PHP: Review (30.12.2021, 01:10 UTC) Advent of Functional PHP: Review Over the last few weeks, I've been following Advent of Code 2021, using Functional PHP as an approach. It's been a fun and educational process, at least for me and apparently for a few other people, at least given how popular the articles have been. For reference, the full list of articles in this series is here: Larry 29 December 2021 - 7:10pm Read more about Advent of Functional PHP: Review Link Larry Garfield Advent of Functional PHP: Day 10 (25.12.2021, 01:14 UTC) Advent of Functional PHP: Day 10 For the 10th Day of Advent of Code , we're asked to solve a matching braces problem. This is a common parser exercise, but it's made a bit more complex in this case by using multiple types of braces. Specifically, we're handling a series of lines that contain ( and ) , but also < and > , [ and ] , and { and } . The story jazzes it up as being the code of our submarine's navigational computer, which consists entirely of braces in a sort of eldritch horror version of brainfuck, but that's mostly just a distraction. Larry 24 December 2021 - 7:14pm Read more about Advent of Functional PHP: Day 10 Link Larry Garfield Advent of Functional PHP: Day 9 (23.12.2021, 17:21 UTC) Advent of Functional PHP: Day 9 Submitted by Larry on 23 December 2021 - 11:21am Day 9 of this year's Advent of Code revolves around grid interpretation. Specifically, we are given a grid of numbers and want to find the low points, that is, the numbers that are smaller than any of their orthogonal neighbors. (We're told to ignore diagonals in part 1.) After finding the low points, we need to do a bit of math on each one, and add them up. As usual, this last step is mostly just to produce a single verification number at the end. That part is easy as usual, but how do we find the low points? Continue reading this post on PeakD . Read more about Advent of Functional PHP: Day 9 Link platform.sh PHP 8.1 lays new ground on Platform.sh (21.12.2021, 00:00 UTC) Just days after its official release, we are thrilled to announce the immediate availability of PHP 8.1 for all Grid plans projects. The new PHP foundation releases a new main version every year at the very end of November, and It’s some kind of early Christmas for us developers and application makers. Sparks and acceleration PHP 8.1 comes with many new and long-expected features such as Enums, Readonly properties, First-class callable syntax, and new in initializers. Link Larry Garfield Advent of Functional PHP: Day 8 (20.12.2021, 16:06 UTC) Advent of Functional PHP: Day 8 Advent of Code Day 8 was, to put it mildly, a pain in the ass. There's a couple of reasons for that. It's a naturally tricky problem, it's hard to genericize, and it's explained fairly badly. It took a while but with some help from others I was finally able to figure out (and refactor to) a good, functional solution to it. So let's dive in. The problem boils down to one of encryption. Our input is several lines that all look like this: acedgfb cdfbe gcdfa fbcad dab cefabd cdfgeb eafb cagedb ab | cdfeb fcadb cdfeb cdbaf Where each letter corresponds to one segment in an LED display for a number. Each number appears once on the left side, which is enough for you to figure out what letter corresponds to what segment. Then we need to use that knowledge to decode the numbers on the right and figure out what the number is. Larry 20 December 2021 - 10:06am Read more about Advent of Functional PHP: Day 8 Link Voices of the ElePHPant Ep#366 – Interview with The PHP Foundation (17.12.2021, 05:15 UTC) About Listen as hosts Cal Evans and Khayrattee Wasseem talk with Sara Golemon, Joe Watkins, and Sebastian Bergmann about the newly formed PHP Foundation. Transcript Ep#366-Interview-PHP-Foundation @ThePHPF Show Notes The PHP Foundation on Twitter PHP Foundation on Open Collective Avoiding Busses 2 – 1 Who pays for PHP? Sebastian Bergmann on Twitter Joe Watkins on Twitter Sara Golemon on Github Audio This episode is sponsored by RingCentral Developers The post Ep#366 – Interview with The PHP Foundation appeared first on Voices of the ElePHPant . Link Derick Rethans PHP Internals News: Episode 96: User Defined Operator Overloads (16.12.2021, 09:24 UTC) PHP Internals News: Episode 96: User Defined Operator Overloads London, UK Thursday, December 16th 2021, 09:24 GMT In this episode of "PHP Internals News" I chat with Jordan LeDoux ( GitHub ) about the "User Defined Operator Overloads" 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:14 Hi, I'm Derick. Welcome to PHP internals news, a podcast dedicated to explaining the latest developments in the PHP language. This is episode 96. Today I'm talking with Jordan, about a user defined operator overloads RFC that he's proposing. Jordan, would you please introduce yourself? Jordan LeDoux 0:33 My name is Jordan LeDoux. I've been working in PHP for quite a while now. This is the second time I have ventured to propose an RFC. Derick Rethans 0:44 What was the first one? Jordan LeDoux 0:45 The first one was the "never for parameter types", which was much more exploratory. And we talked about it a little bit. And it generated a lot of good discussion that contributed to kind of the idea formation, which was what I hope to get out of it. Derick Rethans 1:01 Okay, but that didn't end up making it into a PHP release. As far as I understand, right? Jordan LeDoux 1:07 No, I withdrew it actually, it was clear that the better way to approach the problem it was trying to solve was with a much more comprehensive solution. That particular solution was something that only required a seven line change to the engine. So I wanted to see if it was something people were okay with, or thought was a decent idea for that particular problem, much more comprehensive, like template classes, or something like that is probably the better route to go. Derick Rethans 1:35 Well, I think the RFC that we're talking about today, is going to require quite a bit more than seven lines of code? Jordan LeDoux 1:41 Quite a bit more. Yeah. Derick Rethans 1:42 So what is this RFC that we're talking about today? Jordan LeDoux 1:45 Well, user defined operator overloads is a way for PHP developers to define the ways in which objects interact with specific operators. So for instance, the plus operator, the plus sign. It's a way for those objects to kind of define their own logic as far as how that's handled, which right now, as of PHP 8.0, those were all switched to type errors. So it's not possible currently to write any code that doesn't result in a fatal error, where objects are used with operators. Derick Rethans 2:25 Usually, I ask about every RFC, what problem are you trying to solve this? So what problem are you trying to solve this RFC? Jordan LeDoux 2:31 The biggest problem that this solves is that objects contain, so objects in most programs represent a value or multiple values that have a program context. That's the most powerful thing about objects is they're contextual, and they understand the state, they understand what state the object is in, and sometimes even what state the whole program is in. And that's necessary for a lot of things. Like for instance, if you're tracking a distance, you know, you might measure that meters, and that would have a number you might have 30 meters of distance, but it also has a unit of meters. You could just represent that as an int. And Truncated by Planet PHP, read more at the original (another 32660 bytes) Link Cees-Jan Kiewiet async & await at the edge with ReactPHP (14.12.2021, 00:00 UTC) PHP 8.1 is out and the hip new feature for non-blocking and asynchronous programming in PHP are fibers. In this post we're going to explore them and see how we at ReactPHP will start with them at the edge. Photo by Dids from Pexels Link Larry Garfield Advent of Functional PHP: Day 7 (7.12.2021, 21:38 UTC) Advent of Functional PHP: Day 7 Advent of Code Day 7 this year is another problem that's more about the math than about the programming, so we won't see much in the way of new functional techniques. Still, there's some interesting bits in there. Today we need to calculate the fuel costs of moving a bunch of crabs in submarines all into a line. (Don't ask. Really, don't ask.) Essentially we want to center-align a series of points using the least "cost" possible. Crab positions are represented by a single number, as crabs can only move horizontally. (Because crabs.) The trick for today is realizing that the crabs don't matter; it's a distance-cost calculation. In part 1, the cost for a crab to move one space toward whatever alignment number we want to pick is 1. Continue reading this post on PeakD . Larry 7 December 2021 - 3:38pm Read more about Advent of Functional PHP: Day 7 Link More Entries Next 10 Older Entries Search Planet PHP Mozilla Searchbar Twitter Follow @planetphp on Twitter Blogs Evert Pot Larry Garfield platform.sh Voices of the ElePHPant Derick Rethans Cees-Jan Kiewiet Matthew Weier O'Phinney PHP: Hypertext Preprocessor Matthias Noback Links FAQ and Code Planet PHP FAQ Add your PHP blog Code on GitHub Contact planet-php@liip.ch Sponsors Hosted by netzwirt.ch and Liip . Maintained by Chregu Stocker , Tobias Schlitt and more. Logo designed by Colin Viebrock . Twitter account by Sepehr Lajevardi Buttons Planetarium Planet PEAR Apache Drupal MySQL