Hi all! I've been off social media for a while (still peep at Discord though 😬), so have not been interacting much with dev communities. Grateful for this brilliant thread, thank you CodeNewbie & DEV!
Quite swamped with work these days; aside of day job I'm taking a short-term side gig this week, grateful but kind of drained. Unfortunately it also means I don't have the energy for personal projects and/or learning after some 8 + 3 hours of work!
Quick snippet of random stuff that tripped me up at day job where I work with Laravel (this applies to PHP in general though): We call static and public methods differently. 😶
// Define the methodsclassFoo{publicfunctiondoSomething(){/* something */};staticfunctiondoOtherThing(){/* other thing */};}// Call the methods from elsewhereuseFoo;// regardless of method type, make sure you call the class// Call public method$foo=newFoo();$foo->doSomething();// Call static methodFoo::doOtherThing();
If you copy-paste from one file/class to another without paying attention to that, you'll get 💀 aaaall the errors 💀.
You can also have private methods and... public static function (what the? 😆) but today I'm mainly learning to differentiate those two. Mind you I'm not strong at PHP, started from front-front-end (HTML, CSS, presentational JS) so I'm learning as I go.
Anyway hope you all have a good day!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi all! I've been off social media for a while (still peep at Discord though 😬), so have not been interacting much with dev communities. Grateful for this brilliant thread, thank you CodeNewbie & DEV!
Quite swamped with work these days; aside of day job I'm taking a short-term side gig this week, grateful but kind of drained. Unfortunately it also means I don't have the energy for personal projects and/or learning after some 8 + 3 hours of work!
Quick snippet of random stuff that tripped me up at day job where I work with Laravel (this applies to PHP in general though): We call static and public methods differently. 😶
If you copy-paste from one file/class to another without paying attention to that, you'll get 💀 aaaall the errors 💀.
You can also have
private
methods and...public static function
(what the? 😆) but today I'm mainly learning to differentiate those two. Mind you I'm not strong at PHP, started from front-front-end (HTML, CSS, presentational JS) so I'm learning as I go.Anyway hope you all have a good day!