PHPUgly

213:They Stole Steve

Episode Summary

This week on the podcast, Eric, John, and Thomas talk a lot of PHP. We continue our discussions around what is coming in PHP 8, as well as Laravel Breeze, xDebug, and more...

Episode Notes

This week on the podcast, Eric, John, and Thomas talk a lot of PHP. We continue our discussions around what is coming in PHP 8, as well as Laravel Breeze, xDebug, and more...

Links:

PHPUgly streams the recording of this podcast live. Typically every Thursday night around 9 PM PT. Come and join us, and subscribe to our Youtube Channel, Twitch, or Periscope. Also, be sure to check out our Patreon Page.

Episode Transcription

[0:00] You are listening to the PHP ugly podcast and despite what the title may lead you to believe
this is a podcast about the joys and challenges of being a professional PHP developer.
Your host are three passionate developers who make a living coding and who live stream every week to discuss coating projects work Tech and running a business
and now here are your hosts Eric Van Johnson Jon Congdon and Tom write out your list apps.

[0:31] Music.

[0:39] Hello why am I first time condom we're doing last names this week hello we don't want people knowing that I always do last names at the beginning and we just do the first thing about the anyways
listen take a moment here so if this is your first time joining us thank you very much if you're watching us live
welcome you're more than welcome to participate on the live stream which we record every week Thursday starting at nine o'clock you can talk to us during the of the chats of any of the platforms that were streaming on.

[1:10] Twitch YouTube Periscope not this man Periscope to me know if you're not joining us live if you're watching old
or if you don't have any of that stuff you're always welcome to join us on our Discord Channel.
Discord dot PHP ugly.com will get you there feel free to pop in there that Discord Channel runs all week long so a lot of our people a lot of people who listen and participate on the show or in there
you're always welcome to Papa's mirror and say hello if you listen to the podcast welcome this information is probably old by now but thank you for listening and.
Think about during the live stream sometimes subscribe to our YouTube channel I've been watching our little numbers creep up it's fun to see look my little so are we are we bump it up on that hundred thousand
we're very close we're at a hundred and seventy now I'm going to 74 look at that how did it 74 wow so let's just sit around the corner you know why people are subscribing.

[2:09] This long Preamble in the beginning
like forget to mention that you consume more people have been subscribing since I've been doing this Preamble so that's your he's busted I plan on having a few dead people subscribe here soon that's how we can do things now this country so
we'll just have us down even start what oh my God.
No did you know that dead people legally can vote sorry I didn't mean to go down the road but I'm afraid to ask how.

[2:36] If you cast your ballot and then you die you were legally allowed that vote still counts even though you are currently dead.

[2:43] Somebody just something to show Ferguson that's right.
He hit that subscribe button beat me he's now subscriber 175 boo boo but I don't know man we need sound effects you need something all right thanks show thanks for hanging out with us so yeah join us in our Discord Discord is always there okay.
And yes all of that out of the way dead people can only vote depending on the states some states if you die after you've cast your vote they throw your vote out some kind some states don't really
yeah that's very interesting
so if I if I had bailed my vote in in Georgia and then died before the counting started then my vote would have been thrown out well let's just try not dying how about how about that that be our goal for next week we all just not that I'm on board
I think it's a it's a tri verbal trip that Barlow is what I do so I'm glad we've made it this far at least because on Wednesday.

[3:34] No windows decided to update itself and I woke up to a screen that said please insert system disk oh dear.
Yeah don't do that one taking a drink please if you're not familiar with Windows that's a bad thing
um it's a bad thing because modern systems don't have a place to put a disk anymore yes.
So the last couple of computers I have didn't have disk drives I
I screwed around with my system for 30 minutes just trying to get it to find something to boot off of trying to figure out what was specifically wrong which I knew it was the hard drive and I eventually got the system to boot back up.
No idea how I basically made a bunch of changes and then undid them and then the system booted up so that's a real problem because this is your streaming machine right this is where we do the show up yeah so this is my new hard drive which on its own is
is still stunning to me even though it shouldn't be but it's credit card sized a little bigger than a credit card and it's half a terabyte and it was $50
and it's 15 times faster than the hard drive I already had in the machine which was I assume it's the hard drive is going bad because it is about 10 years old so are they still spinning platters in there those are spinning platters yeah I have spinning platters in this machine
no so so I just.

[4:57] I'm glad we're here I'm glad we could all make it as I almost didn't well that's that's just it just has to help keep it together for another hour and we'll be good.
Yeah that's that's what I'm betting on is tomorrow I'm actually going to try and clone.

[5:11] My windows over to the to the new SSD and not do a fresh reinstall.

[5:17] And see how that goes but I am going to be backing up all of my OBS and other things that aren't cloud-based right now so we'll see we'll see how it goes I've been answer you trying to stream from for the next machine but I haven't wanted to suggest.
Because I can't even join that worrying about it like you doing it.

[5:36] And I enjoy doing it there's no reason not to not to do it yeah besides having a backup in case you need it insert a system disk on a Thursday night yeah how about you John how's the system76 machine holding up for you.

[5:50] With your hairy Mac swag on most of the great not been able to find
replacements for anything that I don't have mac wise the one big one that I'm kind of missing is audio hijack only for things like
I'm not gonna be able to play the Harry Mack
MP3 because I don't have a way to get it into Skype right now that I know of anyway I'm figure that out so there's that Skype is a pain in the butt because it does something weird with our audio devices so means getting on 15 minutes early and
monkeying around with audio settings until things magically seemed to work again but outside of that I miss I miss my
SQL Ace MySQL tool but I'm making do with data grip right now how you found what is it be Studio beekeeper Studio but it's so lacking in features.

[6:41] It has such potential but it's it's behind the curve right now yeah and the the tool I used on Mac that table plus does have a
Linux version but very much like beekeeper it's very limited compared to the
Mac version in the windows version but I've been kind of dance between those I tried it I spent a solid week last week when David did a grip and I don't know just couldn't I couldn't get a good feel for it I was actually pretty stuck on that.

[7:12] DB
Beaver one which was it was very similar to data grip but both of them lovely kimono I'm making do with data grip the one thing I really dislike about it in SQL Pros which became SQL Ace on the Mac
when you open a new connection you open it in a new window or in data group
it's you have all the tabs but all your connections could be intermixed so you might be on production on one Tab and on your local development on another one and
way too easy to make a mistake so I'm finding myself to really pay attention to what tab you're on yeah I mean you can color code and it does color code along the bottom line
believe but it's just it's scary trying to keep my tabs close I'm trying to make sure I'm not all over the place like I used to be able to because I just had several windows and I kind of was able to see a lot easier but this data grip
I think as Thomas's tonight time to say thank you said it did but I can figure out how none of the tools I found so far allows you to do the management piece where you can because I'm pretty picky about
having individual users per database that can only have certain permissions to that database right and.
I haven't seen that on any of these tools since leaving the Mac like well all of them
I'll sequel a standard table plus did it all on the Mac version but the Lily's room does does it yeah beta group if you.

[8:38] When I have to do a little pair programming and take a look at it because I feel like I should be able to appreciate data grip more when I just
yeah I'm still finding my way around I hate the fact that you can't filter down to your table neighbor easily yes you can.
Click in there you can start typing but you're jumping around your we're in all my other tools that I've used in the past as soon as I start typing it basically filtered my list so I can type a piece of a table name.
And find all the tables that match that much easier than I can and data group and the fact that you have your tables in your views are separated in almost folder structure that's
weird yeah yeah I'm exactly which Tama the reason I keep bouncing back to DB beavers I I keep
wanting to have this ethical thing of okay well I'm just going to use open source like it has to be open source first and then if
I have a good argument to not use it I will I will move to a commercial.
Tool if I understand them and make a living doing this and find spending the money it's more of a
exercise for me because I used to be like everything open source like I really I was really behind the open source message and why things were open source and I kind of gotten away from that over the last few years and I'm finding myself
kind of wanting to go back down that road again.

[10:06] I'm not quite there yet because I just like getting things done too crazy too much I think I still might my laptop
here on the desk it's been closed almost the entire time for the past week I open it occasionally when I need to get something done that I.
I'm not quite sure how I'm going to do it on the Linux machine big one is VP ending in two different environments.
Finally I think I've got that all worked out and have to worry about that as much the different database connections just because I hadn't copied all the credentials over to data group
I've got that 95% moved over now so yeah pretty soon it's gonna be off my desk except for
opening it up just to make sure it's updated so when I have to run out I have everything I need he actually inspired me I had had my Mac machine to my right here.

[10:58] And when you mentioned that you didn't even have yours open I'm like okay if John can do it I could do it so I just put it away
all I've been running on it for weeks we're just all my chat clients my Discord telegram things like that.
Yeah I just set it aside and get rid of it so yeah it's been going good I like it and they had a Big Mac event this year are this weekend
I could care less I'll even watch it I didn't didn't care about it you kidding me didn't didn't care oh my God why did I miss something good daughter by something what
yes I just watch and no and yes you didn't miss anything good okay but you're gonna want it so bad no I don't think so
then one chip we've already talked yeah so apple apple this week announced their M1 ship which is their first custom silicon in ever Maybe.

[11:50] Or maybe 20 years and boy it was it was it was a bunch of really good-looking Engineers shoveling you horseshit and telling you that it's french fries it was an impressive show
Apple definitely has this virtual conference thing down now
Dave Dave figured out how to make it look good how to build sets for it and how to make it not look like it's a replacement
for in-person stuff but like a giant advertisement and they threw out a huge amount of numbers that were all relative to a completely undefined thing
so it's this new chip is eight times faster than the top selling laptop right now but they don't say what it is why I don't know what that means this
again I saw MKBHD S-Video or.

[12:45] You know take on it and he showed a graph that they had and there was like no real numbers to it it was just like hey look at this line and here's our line right right they had a line on a graph that didn't have a
xia or an x-axis it was just a line over it was it was a line on it on a one dimensional plane
it had no meaning whatsoever it was bizarre really yeah and then they talked about how they've got Engineers apples yeah they've got engineers at Apple who are already pouring over to the arm architecture they didn't call it the arm architecture they called it
their new architecture but it's just arm and the memory is now
on board the chip the system memory is that why all the systems come with such little like the memory I don't think they had a 64.
No you can't you can't get a 64 the chip doesn't support it you can't add memory after the fact you get the memory and video card if your memory goes bad you can't change it out because it's part of the chip.

[13:45] What so now Andy and chat.
Says that in one doesn't work a little soccer me but again I'm gonna get there okay cuz I that's what I'm most because I heard all this like oh yeah it's all about virtualization they're doing all this work for virtualization
yeah but they're virtualizing the old Apple system so they're virtualizing their virtualizing x86 through what they're calling Rosetta to which is it's just a virtualization environment for running your old apps
and some of them even run well Rosetta.
Yeah some of them run well that's good news but Photoshop doesn't come out until mid next year so there's.

[14:27] If you're a photo designer there's no reason you wouldn't get this thing the drives start at 5:12 gigs and go up to two terabytes for $800 I mean it's the prices on this thing are.

[14:40] Absolutely out of control just
totally obnoxious and there is no Benchmark out there showing how it performs compared to anything how well it actually runs their promising 20 hour battery life though really
but this is in the low power mode
we're four of your eight CPU cores aren't running and this is all on the new OS which is what Sierra no that's old what is the new one big what's up
Mount Rainier Big Sur Big Sur so that's where we get into the virtualization stuff so virtualization for this kind of stuff has to be implemented at the CPU level
do you have to have virtualization support so that the CPU knows that it can talk directly to a shared memory space
if you don't have that virtualization is just emulation it's not virtualization the developer preview kits that came out did not have this feature in the hardware
all of the developer kits don't support virtualization VMware Fusion has come out and said we're working on it
no and Docker has come out and said we found the address where virtualization is enabled on the core
so we know it's there but we don't know what's wrong with it right now and it could be quite some time before virtualization through Docker works.

[16:05] This is so typical Apple they like they just don't give a shit
it's like yeah we're going to change everything you guys are either going to adapt and catch up or you're going to fall to the Wayside and become a relevant in our ecosystem but they've gotten they've got so many other users now they're not
catering to developers they're catering to the people that want absolutely no it's 20 hour battery life.

[16:28] Because you know everyone's traveling across the country right now or around the world.

[16:33] Been watching movies Vader they started they started their own silicon process couple years ago I don't think they had thought this thing was going to happen.

[16:43] So the other so notable starts to optimizing for battery life it seems like more than anything
yes but the other interesting the notable thing about this is that now all of the devices
are the same so you've got the the MacBook Air the MacBook Pro and what's the other one imagine hominy
and the Mac Mini right and they are all essentially iPads of different variations of the MacBook Pro has active Cooling and a bigger screen and the touch pad that everyone wants to pay the premium for the
MacBook Air is passively cooled so it doesn't have any moving parts inside whatsoever it has a slightly smaller battery but
the same thing and then the Mac Mini is a
iPad without a screen but finally the this whole conversation started with an apple than happened this week and I could care less don't really want to talk about it and the one guy who's been slamming Apple for the.
Four years goes on a rant for the last 15 minutes about because detail it's a very very strange move
for at for Mac because they are locking everything down so tightly hardware and software wise this another issues that.

[17:58] The hardware is now digital digitally signing everything so
you're locked out of your own operating system its did a digitally signed by the hardware and there's a lot of things you can't do because of that now it's very possible you can't install third-party apps that aren't signed by
Apple oh I heard that if a problem because they're signing exit their certificate Authority went down
I heard external gpus aren't going to work anymore and no protection reviews will not work the I remember when I was talking about getting an iPhone because I was in the Apple ecosphere.

[18:29] Yeah I'm not doing that anymore it's like we picked a perfect time to Veer away from that world huh jeez man now
I like the I like the MacBook Air because passive cooling 18 hour battery life that's pretty cool but it's an iPad I guess I said ma'am my iPad
it's I feel like I can do a lot with iPad I'm happy with that I still have the Mac laptop if I need it.

[18:55] When it dies if it dies if I leave it at the airport or something I don't know if I'm going to buy a Mac or not I mean I had you asked me.

[19:05] Before I started before I started using the system 76 machine I would have said yeah I oh I would always want like that level of support for.
A mobile device because again this is my business not only my livelihood but my business and.
I want to make sure that it's always functional but I don't know man I'm pretty happy with my little Linux set up right now so you'll go with the system76 to laptop the next machine you buy
yeah yeah feel like I feel like I could do it man I'm not not even that concerned about it it's not even legal
big deal but so have a good question for you guys I want to move on I'm not talking about Max anymore yep that's it that's it the M1 chip that that
that was the whole thing I was going to do with my pitch the whole reason I have us introduce ourselves before I did my pictures I was going to let people know who we are how John might have a business.
How we're all professional developers we all code PHP every day there was a whole Spiel I had going
you guys made me feel bad about it Thomas me ask you a question yes how long have you been podcasting professionally professionally.

[20:11] Never have it started and it started yesterday you what we're doing is professional oh we'll call it
almost three years I think four years for your four years yes have you ever been on voices of the elephant.

[20:26] No no really that's that's that's funny John John you've been pretty well entrenched in the
PHP Community started user groups you've been a conference speaker you're a podcaster have you ever been on voices of the elephant.
I have not no really that's surprising neither have I ER Eric have you been on them you've never done I have not you know who has been on their fucking Steve oh God.

[20:57] Steve mister.
I'm not like today's other right choices of your last name I saw it I saw on the Trello board Steve McDougal and I'm like who's that but he said fucking Steve and now I know who you're talking about now you know talking about.

[21:13] We love we love we love you Steve we do yeah Steve I Steve popped him listen to voice their help and they might he's like you know this week I speak to Steve McDougal and I'm like hey we have a Steve.
I'm like listen to him like huh that's weird he says a lot of things are Steve says I go back and look your mic.

[21:32] This is our fucking Steve you stoner Steve
Steve We Made You Famous so you're on voices elephant now right it's all us what we're going to take credit.
Well okay to be clear here Eric got his revenge I'm not sure.
I'm not sure if you saw the latest edition of PHP architect oh yes absolutely if you want to check it out it's free PHP
Arch.com so the article I'm referencing here right and we'll be on our show notes.

[22:03] Which I've been told it's our complete crap whatever according to this article we are the number two
PHP podcast out there who wait wait who wrote the article some some journaling it looks some credible journalist it looks Swedish
Eric then Jason I'm talking about Sanchez banzer Eric Van Jason sounds German commands Twitter handle is really similar to yours Eric
I'm not sure if he has a zero where I haven't no I think that's a lowercase is 0 oh yeah It's Tricky.
Lower case number
those will get you every time every time man yes my community corner I'm PHP.
I got released as the free article of the month and he tried making it number one
the editor-in-chief said no no no we have a PHP architect podcast so he cleverly put architect podcast as number one but put ours higher up in the margin
the you don't do the layout man don't do the layout.

[23:16] So I can I can expect a flood of new listeners because of this shining recommendation lying in here now feel it.
Moment now I missed a lot too I can't believe I forgot to mention Dev that to slash podcast so I created a whole honorable mentions page or section.

[23:37] Because they're people like however who has worker we're on the main section and not in the honorable mention
it's hey I had to give laravel their hosts whole separate sections just for laravel podcast level has a lot of freaking podcast man.

[23:53] This is even all of them I mean they've got a lot of party and they're all pretty good to know unfortunately
from envious about that but yeah they got a lot of podcasts I even looked for a good Symphony or WordPress podcast I'll throw in here even though I don't listen to it and nobody recommended one and I couldn't find one so
I didn't do it I started messing with Symphony this week
decided to just completely completely Halt and not do anything until PHP 8 comes out no yeah.
Yeah so listen PHP 8 man we got a lot of feedback up or PHP coverage and.
I had even how wrong we were no
but I popped into the PHP architect Discord so PHP architect has a Discord I can't
exactly tell you how to get to it because I'm not sure if you need to be a member or if it's open to everybody one I got in because I'm a contributor and they let us in early I think they let subscribers and now
I'm not sure they didn't know who you were first yeah but anyways I got in there because a lot of the PHP
contributors hang out in there and a lot of people have respect so I asked them about the named that mean variables what we mean by arguments.
Asthma that mean bergman's one because.

[25:14] It was bugging me like all week long like it can't be like it can't be what we thought it was like camping at fragile right
and they all pretty much agree they're like yeah that's just how it is get used to it because it's the way it's going to be and it's really not that big of a deal don't know don't overthink
oh my God I feel like it is a big deal I mean yeah it's not that big of a deal except the one example of using it.
On the internet at the time of our recording was broken because the syntax had changed like
there was only one real in production use of that code and it was broken because PHP.

[25:56] For the alpha for had come out and change the name of a variable that's right arrey arrey Phil or something yeah one of the yeah energy moments in within the.

[26:06] The PHP code base it probably won't be a big deal they're saying that it's part of the contract which is all fine it's all fine and dandy
but Library maintainers you know I'm a refactor my code often enough and just I'm just going to update the name of this very well because I'm used to you know.

[26:25] They're in order people are doing names attributes or whatever they're called named arguments well yeah and you can tell now you have to be concerned about that you can tell them don't use named Arguments for my library but that doesn't mean they're going to or not.
You have no way of estimating from that's gonna be part of a coding Style.

[26:43] You know if you were organization uses those is going to be across the board it's not going to be here and there and I'm not going to do it for this Library
so it's concerning you beyond the the PHP code base or a core functions mmm well ya see it break there we also covered
a couple things last week that I said I was going to look into and I got some great information I don't know if you guys want to go into that now absolutely I have been looking forward to it all week and share your browser I guess I think
viewers appreciate so let's start with the null safe
operator yes the one where we kind of agreed that it is pointless stupid at so the no safe operator what this does is it returns null
when a when a method doesn't exist or when a when a null when a method or attribute is being called on a null object
and we had sort of come to the conclusion that this was stupid because you can use the null coalescing operator to achieve the same thing the issue here is that with the null coalescing operator
if you're making call a to call B to call see to call D and B if your chain if you're chaining yeah so if you're chaining then.

[28:05] A will get called to be and be able to return null but the null called what coalescing operator will say well let's keep trying and that ever go to Sea and it already called keep you're gonna keep trying on no
it's got to do something other than null then it's basically just suppressing the null warning but it keeps executing the chain because it is an operator at the
end of the execution path so if C has a value B is null.

[28:32] It'll continue to return term agency so this is it's a bad example but it shows the under underlining function of it is that null coalescing operator will execute the hole
thing and then return null which isn't that big of a deal until you have method bar in you're at in your argument
to a null method so on my screen here you can see null question mark points to Foo as a method and the envy
function call bar is inside of the Foo method with null coalescing bar will get called even if a is null when you try to call the method B it will.

[29:17] First fetch the arguments for method B and execute all the code that those arguments require
and then try to call method be on know where as this is this null safe operator will say hey this method doesn't exist don't bother
trying to establish the arguments for it okay I'm getting it so you're passing a almost a closure or a method call.
As a parameter that's still going to get called right so if bar all it did was say sleep 10 seconds return true then if you're calling it on null it will sleep for 10 seconds and then return true
annul whereas with the null safe
operator it won't call Bar it'll just say you're trying to call a method that doesn't exist and isn't going to exist so don't bother with the arguments in it either yeah so it's a bad example in the in in the fact that it's
it's hard to conceptualize but if you're talking about just a closure that.
Executes right so so so can you give me a rule of thumb when would use one over the other you would always use null safe.

[30:30] Instead of null coalescing wait other way around right.
Null safe is a lower level operation and it takes more effort to implement oh no safe will not
execute the closure where the null coalescing will so the null safe and null coalescing will produce the same results but null safe we'll have
a much lower overhead and actually short-circuits the execution of the rest of the of the
come and where as null coalescing says do your thing and when you get back to me let me know what you got and if you threw an exceptional thrown all gotcha so it's still an ugly it's an ugly syntax but it has a purpose
yes now in practice I'm going to use null coalescing because I'm not anticipating problems with polymorphic chaining on data.
You know relationship models and all this stuff building to expect either I get something or I don't in lower level.

[31:29] Design and this is a theme that runs through all of the new stuff in PHP 8 in lower level programming.
Where performance is a major Focus where framework design is
flexible but fast that's what this stuff is for and you're really going to see that when we get to week maps all right let's do it it's given week Maps but before we Maps you're teasing me I don't appreciate it but can't write you love it
the match button for punishment the match expression we covered it but there was there was some confusion.
About its use for our switch yes crazy so match does support a default value which we had had trouble locating
it is a keyword it is not a it's just default and then the thing one of the interesting things about match that we didn't cover is that match.

[32:25] Must match a condition so early.

[32:29] If you are if you have case 1 2 and 3 handled in your match expression and someone passes in for it will throw an unhandled match exception unless you have a default setup
yes gotcha interesting is that right yeah so that's something that that everyone should be aware of.

[32:48] You're right also interesting third default for match yeah just default just the word default unquoted unquoted
unquoted it's a keyword so just like in switch yes another thing is that match is strictly typed
you can match an object to an object or an array to an array and it supports the dot-dot-dot Syntax for
making multiple matches on a single value so there's lots of interesting cases I recommend checking out PHP. Watch
they have an article on the match expression and it basically covers everything you would need to know about it which you should want to know everything because
you're going to see this in place of switch in a lot of places and it'll be annoying if you don't know what it what the syntax means
are you gonna throw that in the washer that yeah I threw the wrong one in there that's that's in the show notes I just it's on the wrong page okay week Maps you ready let's do it you gonna pull up that playground again
nope not yet because sort of them
we're going to start with weak references so this is all brand new to PHP 8 no no weak references.

[34:02] Were new to PHP 7 but greater than greater than seven for right yes seven for sorry that's what I'm here for I can read I can read the screen
so this gets a little inside e but if I create a new object and assign to the variable a then that object is created in memory and the variable gets a reference pointer
to the object in memory if I say b equals a then the internal counter of how many references there are to that object.
Goes up right if the internal counter if I destroy b or unset it or I change B to point to something else
that internal counter goes down if I unset B and then unset a the counter is at 0 and the garbage collection process destroys the object.

[34:49] Or Flags the memory as abandoned to be used again somewhere else.
So a weak reference is a way of referencing an existing object without incrementing that internal counter so if I say
a equals new standard class and then I say b equals weak reference create
a then the counter on that standard class is still just one and if I delete the weak reference the counter is still one and do you know what the benefit of this is yeah go ahead explain that because I think go has a similar principle with their references as well and I don't remember why this would be if you're using something in a loop and you want to make sure that you're cleaning up the contents of your Loop that
within your Loop your references to the object are not incrementing it so that
when your Loop exits you don't have trailing references to an object that's no longer being used and and familiar on its own it's not super helpful but that's why we're starting with weak references instead of week Maps because week Maps is where it gets helpful
so okay on a weak reference if I delete the initial object a be still exists but because the counter is now 0 garbage collection will clean it up.

[36:01] B will point to null at some point maybe not right away.
Yeah and it's depends on your ini settings and stuff like that but when garbage collection needs to run it will run
and anything with zero references will be cleaned up so this this can help in seating databases and doing certain things it's
not the most handy thing in the world for day-to-day stuff but I mean we Maps aren't going to be a day-to-day thing for us either so a week map is
the concept of carrying over that week relationship to an entirely new
object or reference so if in this case in the case that's on screen here I'm not sure if it's actually displaying very well move it move it to your left a little if you can so in this reference here we are getting a product and marketing that as
variable product and then we're getting all the reviews for that product and marketing that variable that contains all the reviews as
just reviews with a week map I can say the reviews the contents of the reviews variable is bound
to the existence of the week object that I give that I attach it to so I've got product and I've got reviews and in memory
product is 1 K of data and reviews is megabytes of text when I week Map Reviews to product.
And delete product reviews goes with it in garbage collection if you browser on stream that's right I'm not.

[37:27] There we go yeah no worries so traditionally in this situation.

[37:33] I would have if I was having a memory issue and I've determined this is where was that in order to get around it I would have created a d-struct method Within.
My review list and then unset the variables I needed and hope that they weren't referenced
elsewhere that was being somewhere else or not being used if you're if you have dynamically named variables or if you have deep reaches of your code of your if Loops that don't get called every time a product is pulled up you know if you're handling.
Reviews and then reviews goes down another tunnel and says reviews for your location and then reviews that are positive you know above three stars and then further down the chaining of all this stuff you can develop these
memory holes these memory leaks in your system I've got time I've got tons of those so do eyes yeah.

[38:24] And so the solution to this is in your for each loops.
Where you're handling lots of data make sure that you weak map to your object that you're looping over that way
every time the loop finishes and starts over again when that variable when that object that you're looping over gets
deconstructed and then constructed into the next iterative iterated item the whole for Loop gets collapsed garbage collected
and start it over so I can see myself using this a lot in stuff that has out of memory usage or slows down as it continues executing
or things like that it's I had this issue in a library that we are still using again the library was written for PHP for so it's full of memory
issues and I'm constantly fighting like needing to call free on it and then unset every piece of it when I.
When I'm trying to fight these memory issues so.

[39:26] This could be very useful yeah this is this is one where I absolutely see myself using it in the future.
I don't know if this is really a good example that they show here because there's no obvious place where the leak would occur but you can see that at least right here when you unset product 1 then the weekly mapped
contents of the reviews get dumped they get sent to garbage collection an interesting note in this article is
the null coalescing assignment operator being used which means.

[40:01] That if the garbage collection has executed and this weekly mapped value is no longer referenced you can say
get it again so in this case we say get reviews for the product and then it stores it in an array or it goes and executes the database call to get the reviews so it's Mal most this is almost a caching method for
objects within a single execution of a program the week map itself is an array it's being treated as an array yes you are you're basically getting a pointer to a specific item in that array and then when you
get rid of it you're getting rid of it basically you're getting rid of that element within that array so it's not kept around for no reason right
and and for what we do on the daily basis this seems like okay well there's caching there's other caching that uses redis and whatever and whatever that caching does not account for the memory that's being
in use by the PHP application that's running that cashing handles large blocks of data that need to be fetched frequently
but it doesn't handle object being shuffled around and constantly used
and when they're not used anymore flushing the memory out of PHP and so this is it this is interesting to me though because.

[41:18] To me the cash is there because you want a copy of it so when you go to get product one again you already have it you don't need to go grab it again
unless some unless you've got a long-running process
that is pruning itself maintaining its own memory by checking the size of the array and cleaning out things that haven't been used recently or you're running something like a web application that can search for
10 different users at once and if 10 users are all
looking at product one then you want to have those 10 instances pointing to the same one product but as soon as no one's looking at product one anymore you want it dumped and this process this is a long-running process
that's handling multiple users simultaneously this is in PHP we don't think about that we think of one process per user but when you start your engines start and stop really quick right
but you start getting into websockets.

[42:11] You couldn't write websockets and PHP because the memory if you weren't masterful at handling it would leak all over the place so this.
A way of writing log running processes designed to handle multiple users simultaneously and spreading your garbage collection out to handle that specific use case it's interesting as we did just
talk to the creators of swole last last month and that's exactly what they do and that was actually one of the one of the uses they talk about long range of processes and but yeah it's maybe they're just really good at
but they do I don't know yeah for my long-running process right now in each loop I check how much memory of used and if you.
Over at some threshold all right exit let supervisor D restart you back up right and the idea there's no way to know where that memory is being used at and.
Cleaning it up some pain in the ass the idea that's very common in node is handing having abstract factories.

[43:12] Are weak mapped to result sets and if the result sets being used by one thread then it can be used by the other thread if not
then you create it for this one thread and that thread can be used by the other threads that need to use it so this is something that has existed a long time in multi-threaded long-running process based languages
but we couldn't do it without the null coalescing and the weak references and a couple other.
Technologies that just got added in seven four and eight so now this is an actually viable thing for a PHP developer to do
create a long-running process that knows it's a long-running process and handles itself according and you don't have to deal with garbage collection you just have to know that garbage collection exists and works so yeah you know that's that's why week Maps were so hard to understand on the first reading well.

[44:01] That's interesting garbage collection on the long-running process I've never really thought about it but it has to be a manual thing because it is currently it is a probability based
Bing / run isn't it it used to be but it's not anymore part of the performance increases in seven and eight
are changing the way garbage collection works and having it run on a timed interval or a CPU cycle interval really well you know I'm going to have to look it up and tell you next week because I remember mess up here I said that in Saint Vincent Lee as I could it used to be
it was it was a whole probability so there was a percentage chance that your garbage would be cleaned up or not yeah it no longer is.

[44:46] All right I'll take your word on it because I'm not taking the time to look it up I believe it runs it runs with every application execution it's always running in the background I'll take your word for it because I was just asking some time but we'll get it we'll get into it next week
I've got the page right here and it's too long to read right now so that's that's my promised update on the PHP 8 stuff cool
except I kind of got into attributes today and that's one of the reasons why I decided I wasn't going to keep going with symphony is that Symphony says hey you know here's how you do attributes and dock blocks.
And I just know I just know that that's going to be done for in December that actually know that oh it's so nice
it's so much faster it's so nice it's so pretty you can set rules to your attributes so you can have a framework that says hey here's your attribute rules
the the newest version of PHP storm I think came out last week supports attribute type hinting and all that stuff that you would need for IDE
so it's fancy and I've already started thinking about trying to Port.

[45:52] Durable routes over to attribute driven because it's definitely a doable thing
isn't it how Symphony does it isn't Symphony routes attributes yeah in Symphony it said it's an additional it's an add-on you can either use you can either use a built-in routing class and write them out
or you can use the attributes the symphony attributes plugin which inspects doc blocks.

[46:17] To find your routes I mean I'm reading a lot about Symphony right now and it's just no one's going to want to stick with the doc block-based attribute stuff when this comes out no one no of course not it's.

[46:28] What's this part of the actual language it's going to be moved yeah and I think it'll move quote see I don't because I mean then you're forcing everybody to move to PHP 8 quick right I know a lot of them backwards compatible baby because it's within a comment.

[46:43] It is a homework.
It will work I mean I can stack it on top of like really backwards compatible then we'll know I can stack it on top of clarabelle's existing
route system call a new service provider that I wrote that says hey after you're done handling routes the old way.

[47:01] Handle them the new way to but again the new way won't work unless you're on PHP e it won't break but if but if you're not on PHP 8 by the next seven months but it doesn't matter anyway because if you're not an eight you're not going to be using the new way anyway
it's going to be a service provider that you would have to enable or say I want to use a service provider right
it won't break anything by starting to use it as the end user if I'm stiff I'm Distributing libraries for laravel that use the new attribute based routing then yeah that'll break for people who trying to run laravel eight on seven for but I can set the requirement for PHP 8 in my composure Json
and that solves itself so I mean this is going to be a very Swift transition everything is in place for it to happen very quickly and we want to keep pushing people to upgrade.
Sooner than later anyway don't want to get in there
PHP 4 and 5 to issues that we've had in the past yeah cool kind of along that same lines
I put it in the trailer board have we talked we talked a while back about PHP the right way that website and
how it's really not relevant anymore yeah well I have a Twitter.

[48:15] Kind of back and forth with somebody who called about he's another podcaster he does a coder radio
um and he sleeps he's one of these people who will slam PHP and I gave him a little bit of a hard time about it in my article quit a you know he was like we'll get your tell me what's what's new I said I haven't used PHP and probably the last.
I think it's a decade ago man somebody's where do I start and I thought about PHP the right way my God that's sites that.
Really relevant anymore but I went there and click on the link man I think
well I know it's been updated because it tells you at the very top it was updated on April April much nicer layout Ike I still feel confident recommending this site.

[49:01] The site to people if if you're out there and you're curious it's still a very relevant site in my opinion I think we were a little premature and in our judgment before but I
do you understand what you were saying at a lot of the concepts that were in the original website probably didn't apply as much anymore
but please be the right way they see it they seem to be keeping the same fairly current it's its current but it's referencing like
yeah use the PDO extension to make queries and its current but it's not necessarily relevant anymore because of how people are using laravel Symphony
cake I would I don't know I mean I think it's so relevant
talking about yeah you're right it doesn't really apply to fight the Frameworks but the concepts a lot of the concepts that have changed over the years it's still pretty relevant with that stuff yeah does it handle the gang of four stuff
the Gang of Five I don't know do a quick search for gang against.
See I'm not seeing anything about it does talk about solid I'd add a solid in here that's the thing is it patterns have become so fundamental to basic PHP development and.

[50:14] Design patterns under coding practices yeah auto loading only shows up.
Twice in the entire thing yeah the handling dependencies dependency injections not there yeah it is.

[50:28] Let's write in the the top of the middle column dependency injection
it's in the big bold letters maybe that's what through yes of going blind my eyes are I realized my eyes have been bad for.
Couple decades and I just never knew it might have gotten so bad in the past it seems like all of a sudden.

[50:47] They're bad I'm ready I'm so annoyed I read a novel but I started wearing glasses the moment I start wearing glasses I went downhill like my my eyes just gave up on trying I put glasses on and they kind of think it's again I don't think it's glasses that did that because
mine I haven't worn glasses and man it is so horrible he's talking he's not talking about his eyeglasses he's talking about his whiskey glass just as he goes through that whiskey glass the vision just gets worse and worse.
It's really weird no I'm bottle day you know I have you know I have a agoraphobia.
Which if you want to look it up it's not one definition it's a definite 10 different things but I was reading an article by a ophthalmologist who said hey it turns out that people who get
sudden tunnel vision that causes their heart to palpitate often have misaligned pupils and just never knew
so they're seeing their seeing literal tunnel vision and their body is always compensating for that so they get headaches and their neck hurts and they get anxiety attacks randomly and
I looked at my wife and realize that if I relaxed my eyes if I didn't Focus specifically.

[51:56] At her and and strain my eyes I have normally very very good Vision it's like 30 20 I can see very well but I have to focus to do it I have to pay attention to do it and that's causing a bunch of.
Medical issues that I just never acknowledged because I'm so used to it so I'm going to an ophthalmologist and getting my eye alignment checked and possibly getting glasses to correct it so yeah that's medical concern of the week.

[52:24] Yeah I realize I can't see just two feet in front of me it's like I'm constantly now
start move things away from me to see better once I start wearing glasses it was it was all over I couldn't I couldn't I couldn't read my watch anymore without my glasses on I couldn't read my my monitor anymore that my glasses on.
I mean it just once I put those glasses on I just well I've been wearing them ever since my wife was very upset this week because
she had gotten an email from one of our kids teachers which a was upsetting but be.

[52:57] She had to hold the phone up to her eyes like this and then move it back and forth to get it into focus and as she realized she was doing this she just started going God damn it God damn no I can't be the sold yet.

[53:12] So you wouldn't you wouldn't hear one of the most horrifying stories I have as a parent
as a yes as a father the the school called us in to when our children was were really young I mean they might have even still been in kindergarten it couldn't have been passed first grade.

[53:29] But they were very young school calls us in there like like yeah you know we did an eye exam and we're pretty sure you should
take your daughter have twin daughters and twins are actually notorious for bad eyesight because of the way they develop
but there were there were like we think you should take your daughters and have their eyes examined and find out if they need glasses because they showed signs of the glasses and I'm like I'm like no my kids I my kids read like crazy
I mean from from the moment they could open a book they were reading
em and they were excelling in school and like kids don't need glasses here you crazy so we take we take them in and it's the
the classic Stan here read the chart and they're like on the second line and they can't read the letter and I'm like standing there like come on give it a try what are you talking about
don't the donkey there do duckies on there what are you talking about read the letter man I felt like the most neglectful parent in the entire world but like you said there were young they were compensating they.

[54:45] They didn't think it wasn't even an issue for them right but boy did they need glasses man and but yeah you feel.
If you feel like an inch ties as a parent because you know that doctors thinking how could you not known this like why did your school have to send them to the dock.
Yeah I felt so bad that just reminds me of the time my son laid down on the soccer field you just started grab your hair and go come on dude there's other parents here.

[55:15] What are you doing
like a man what iswhat inhaler I don't know what you're talking about he's always a color that's the of the purple it's just that matches that usually does.

[55:31] Nothing is hard
got one more thing update from Derrick Ray Athens the current
current person creating handling xdebug all that stuff just start currently he's not the original well
he started by saying how much work he got paid for versus how much work he did so I'm saying current because he might just give up
he got he got funded for 45 hours of work from the community and he did 75 hours of work in October so it really like give him a subscription
that guy needs some money for now maybe not in the future
because he started talking about xdebug Cloud which he didn't give a lot of information and said that it's.
It's currently completely private he will be opening up a private Alpha but xdebug being completely handled through the cloud connecting to local phpstorm Integrations
doing all the work for you he's also still working on PHP 8 functionality because that's a huge rewrite for him because of just-in-time compiler and a lot of other changes.

[56:40] But 3.0 is in beta now so if you're on PHP a you can start banging around with the xdebug 3 beta and it appears that there are some benchmarks
that show that xdebug 3 Performance is up quite a bit so Derek has a patreon GitHub sponsor.
Paige and he's currently only at 66% of his $1,000 monthly goal which is not a lie
we need to move so Diego they have sponsors and which is the company giant Ray we need we should move our sponsorship over to GitHub so we can get a little logo on your gym hmm yeah we'll talk about that later.
All right you're talking about and my last thing.
I'm going to handle I'm going to hand it all over to you I wanted to end on an up note this week a really really big up note bigger lay it on me December second the McRib is back.

[57:36] I've never had a McRib it doesn't even interest me that bad it doesn't it doesn't interest me at all either
no wonder why kind of shits on my up note I just met crib has never appealed to me on any level McDonald's actually doesn't appeal to me
I'm very few level it didn't appeal John Till I had the teenagers and then it's like all the time you'd be interested to know that I guess they're coming out with a boy yes Burger Nick plant.
Plants I'm sure it won't be vegan it will be why do you say that because it's McDonald's
they would have called it they would have called it Mick vegan if it weren't Bound by egg or something it's just probably probably valid it's gonna be it's gonna be
with bacon on top yeah that was me I bacon bits are vegan actually so is that so is my beer of the day bacon bits are not vegan eggnog naked beko beko bits are vegan
most most bacon bits on
no most bacon bits on the market are not bacon yeah they're usually just compressed and flavored soy no all right fine that's that's my up note I guess that doesn't count what do you guys have what is Breeze.

[58:56] Laravel eat the release of larvae eat there was a big hubbub about jet stream if you remember that was the new
also system that he put in place that layer of open and place Taylor put in place and.
It's probably is probably one of the topics that he get the most push back on and so he's now released Breeze which is more of a light weight off system more
lights are traditional auth UI package that you used to add to laravel that just does some
your basic off stuff and I think he still uses tail when I forget actually know the times it does it does you sell them and I guarantee you the name came first that he was sitting on the toilet trying to think of clever names
and he thought Tailwind off I'll call it Breeze
and that's when the idea happened I don't follow that thinking but I don't doubt threes wind of Jesus with you.
That's the name Helen tell him freeze all right sure I'll give that one to you thank you something thank you I'm not putting the McDonald's article and show notes man come on.
You don't have to I'm not going to it's already been roundly shot down mostly from murder and my
abject celebration of it now I now I don't want one I thought this was gonna be like a Rick and Morty thing with the with the Mulan sauce that I didn't get.

[1:00:21] Yeah not only crib K never understood the appeal yellow doesn't even look good you know of all the articles that are left on here John has the one that interests me the most let's do it let's do one more John which one try hack me.
It was just an interesting article I came across or aside I came across if you're really interested in.

[1:00:41] Hacking and learning how to hack mostly to help prevent things from happening within your system it's a great little tutorial it
you know it takes you down the road of pentesting I had an absolute blast doing this at conferences where you can do.
Capture the Flag where you get introduced to some of the some of the concepts around how to hack a site and then you are given
a virtual virtual machine that you can access and then you figure out how to capture the flag or find.
Whatever data is necessary to complete that challenge so try hack me is a basically a learning platform to learn how to do these things.
And there's a free version and a subscription version and it just looks really interesting yeah there have been a couple of these in the past that I've used in this one definitely.
Looks like it takes it up a notch yeah it's free it actually gives you a whole Linux machine that you can access yeah they've got a Kali machine if you're not familiar with hacking Kali is the hacker.

[1:01:41] Framework Linux distribution that's very cool I like side like a lot of this in a.
There's a lot of different concepts of there's you know your traditional web application but there's also looks like Network hacking just different different things to learn
yeah and and this is something that I haven't
spoken on in a long time which is that I started out as a security expert in in the roughest sense that I managed to get better grades than I should have in high school but
that Foundation gives me a lot of insight when I'm developing as to what I need to do to secure our content from hackers if you're developing and you don't know how to hack then you're missing a very big
portion of the knowledge that you need for divided designing a secure system even just the minimal version of hacking right right even if you're just
just handling cross-site xss or understanding data so go more no go more basic than that it wasn't that long ago
I would I was able to buy a product on a competitor's website for free.
Right so I would go to that website I would say I don't want to pay for this and they would ship it to me they found that I took it a step further.
Oh crap they fix that oh but if I make the shipping negative amounts I can still get it for free.
So knowing those types of things one you can prevent it from happening to you.

[1:03:10] And not that you should exploit that but I was young and dumb and I took advantage of that yeah and just a minute to a federal crime on.
Public Enemy matter it's not a fetish not a crime it's not a crime to modify values that are being sent to your system and sending them back.

[1:03:26] It's a crime to modify values on someone else's machine but modifying values on your machine is protected
so they have to show Criminal Intent and they have to show activity that why I don't know why I would know this stuff that's ridiculous guy who gets in the law like that
around Herring also oddly enough the movie hackers still surprisingly accurate likes epistle fun to watch it's still fun to watch and there's still a lot of real world examples.

[1:03:57] Of how hacking works most specifically dressing up in a uniform and entering a place you're not supposed to be that state they do that a couple times in the movie.

[1:04:07] And it's a hundred percent accurate they say yeah it's just last night I watched Johnny Mnemonic.
That's that's still holds up pretty good no I did not I did not follow fun.

[1:04:21] That is so much fun to watch he had a terabyte of data in his brain and it was causing it to melt I don't think it was terribly talking about
classic trying to Mommy's it was I think that might have been that might have been the first like serious role I saw Keanu Reeves them.

[1:04:38] Okay that's that guy from boom Ted was that his know he did a drama before that where he was Star-Crossed lover in.

[1:04:48] Time long forgotten yeah I don't know why I wouldn't have seen that movie but I would have seen this one.

[1:04:55] Yeah my mother was The Matrix before the Matrix yeah it's but it's.

[1:05:01] It's got a lot of super no longer okay racial references specifically to the Japanese they have transgender in there which was like yeah absolutely crazy back then it was
actually I don't know man that holds up pretty well but I think about it I guess I just watched it last night as far as like the cyberpunk future you know these.
Pretty good what do you got there this is random babbling brought to you by our patrons on patreon hey patrons on patreon patreon patreon I guess are we patreons because we're
users were members of patreon and so the paint their patreons to their patrons to our patreon patrons the patrons to our patreon thank you very much you guys it's awesome to have
people supporting us like this and supporting the incredibly well-developed visual effects we now have on the YouTube stream he couldn't have had it without you
one of these days I'll have an Elgato stream deck will go even smoother one of these days I don't know when like three years from now but that's okay my birthday is coming up
um that's that's it for me like it's another information packed episode of good one I feel like ever since we got called out by
fucking Steve our quality has gotten much better.

[1:06:27] We realize people are listening and stepped it up a little bit oh god what have we been doing see well how do you think buttery crumpets feels he's been listening to this whole time he doesn't feel like you know he's brought us quality.
Here we don't feel like we need to step up from buttery no but we need to stand up reflecting Steve now because buttery soft buttery signed up when
when we had episodes where one of us was too high to even speak and he.

[1:06:52] And he got into the patreon game after that he saw it happen and said I want to pay for this I want a piece of this right there is several several episodes where where Eric and I were both
hammered by the end of oh my gosh he's early on in all the only way we can even start his if I had a pretty good Buzz going
I see nothing's changed really all right well I think that's it episode.

[1:07:24] Teen is in the book I'm Eric I'm John I'm Tom.
Keep it ugly what to what toe coming off the top y'all know how we do listen I'ma drop a free side you can cherish I'ma send a shout-out to the hostname are
yo he's never on some average shit you know every
he stays loud and passionate I am about to break it down for y'all with the clever Sonia Schott the host name Thomas cause he's never wrong and shout out to John you know that these smart and quiet
unlike my freestyles which caused the riot I'm about to do it like this because the people love me shouts out to PHP the.
Delete it it's called ugly cuz it's not professional but I'm about to come
doing blessing with style so let's do it when I spit in a perfume the room you'll the segment of the show is called Doom and Gloom that came from Thomas yeah can't nobody go beyond this I get the mic and then I.

[1:08:17] Keep it like a promise yeah and y'all know we fill them up with anguish we talking about the PHP the programming language about to break it down no exaggeration what do y'all do for a living web applications okay I can dig.
My words great tight they're getting together on the Thursday night yet when it comes to Ramen you can call me the new dude that's few truly breaks while your broadcast on.
Tilt so let's get it you know my liver enzyme major all up in the comments I got.