I watched much tutorial for interface multi languages .. and i never understand why be should to use interface expect your tutorial I understand now, thank you so much ❤️
Ok, this makes me look stupid but the truth is that I am a PHP developer for over a decade and never understood the purpose of interfaces. Yes, I have read a dozen of tutorials and stuff but yeah, it never broke into my skull. Your payment example just did the click in my brain. It further consolidated when you said at the end that there is no need for a bunch of if statements. Thank you mate!!!!
Hey I'm glad I could help. This is the reason I do these videos. It took a long time for me to understand OOP interfaces and it didn't instantly 'click' until I tried many examples. Now I use them on a regular basis. If you have any questions or suggestions for future videos then let me know.
Thank You Peter Fisher, I do very rarely subscribe to channels. But this video forced me to subscribe to your channel because this explained me in a simple and practical way of using interfaces in the real world environment. Thank you Jesus for leading me to this beautiful tutorial. God bless you. :-)
Thats was great tutorial. It made better understanding about interface in OOP. I wish to see more such clear and extended with good examples tutorial. What I missed is just how to organize folders and files, because I have been taught that Class file should have only class, and in this example it seems too many classes, so it makes a little bit confusing. Great teaching approach.
Thank you very much. I’m part of the Live Coders team on Twitch and do a lot of these longer examples. I publish these to the Archive channel ua-cam.com/users/HowToCodeWellArchive you may find some helpful examples there
@@howtocodewell Thank you for additional info. I saw that you are on youtube already 8 years and I will definitely will check more your videos. By the way, maybe you have somewhere tutorial how to update old version php to php8. I use Apache/Xampp, windows. I find some tutorials on youtube, but reading some comments it seems some people get errors. Thank you again for your time and lessons : )
You actually helped me a lot in understanding not only interface.. But the true purpose of it which focusses on cohesion and coupling. I knew a good principle of design is to have high cohesion, low coupling.. but still don’t know how to implement it in a system... thank you for your explanation. By doing this way, it will be easier to modify the system in the future. Better lecturer than my university’s lol
Great lesson, though 1 confusion. Where you implemented the third interface just to implement the process(), so that fraudCheck() could be housed, would it not have been easier to include fraudcheck() inside pay() function for MintFee class Like public function pay() { $this->fraudcheck(); } thanks.
I have tried to understand bits of "oop" whenever I came accross them. Most high level presentations left me with "When would I ever want THAT?". This particular film took me to the point I was really interested in. It just remains to say "Thanks for publishing it"
Hii.. I have a doubt on 16th line.. why we add circle on "public function addshape(circle $shape){}" ? If i remove that circle it will also work without issues...
@@vijayanpn446 Imagine this - We all have to pay bills and so I have a whole development team to handle this. They tell me they can interface to EVERYONE I need to pay. I send them off to write the servers and produce a single version of a client that contacts them all in the same way. For example, my generic interface accepts user-questions so I will call it "ItemToPay". Here are some examples: * Who are you? * What is my payment history? * When was last payment due? * When was it paid? * Did it go through? The whole project succeeded, so for the past two years, "Bill Explorer" takes many (pre-tested) servers such as "gas", "telephone" and "newspapers ". Now along comes a "seriously expensive" Hardware Shop. Do I rewrite the "Bill Explorer"? No, someone finds out to talk to the Hardware Shop, so that they fully support the same "ItemToPay". Once that works, there will be new instances of "ItemToPay" that I can provide to my client and NOT rewrite anything else!
What I captured very well in this tutorial is that interfaces are mainly setting rules for your classes, but from the code you wrote about the payment gateway, don't you think I can decide not to use interface as I will write all the methods that is needed for the different classes and call the methods inside the process method for each of the classes. I will now call the process method for any of the classes in the paymentGateway Class because they already all have process
Hi Solomon, I'm not exactly sure what you mean. An interface defines the contract between two or more classes. An interface does not define the behaviour of the contract but defines the inputs and outputs.
@@howtocodewell then what’s the point of a contract if your code already agrees on how it’s classes would work since they have the same name methods. The process class seems to do what the implement class would do by passing the class you want into it since you already instantiate the class beforehand? Or Am I wrong to think that way.
Great explanation Sir . I watched some videos about SOLID principle and if I am not wrong , the example shown in this video is Interface Segregation . Waiting for full in-depth tutorials with examples about SOLID in PHP . thanks again for this video .
Yes this does (or at least the last example does) fall into the category of ISP or the interface segregation principle. I didn't label it as such because it's quite an advanced topic and this was meant for beginners. I do plan to do a whole course on the solid principles at some point but first I want to lay the foundations.
I have similar situation like this. Question is: when to use constructor and accept object to do the job instead of local method? For example, instead of threeDCheck and fraudCheck to pass their objects?
@@howtocodewell Thank you for answering. I agree with this. But what I mean is this: new SomeClass(ThreeDSecureCheckInterface $threedCheck), constructor accepts $this->threedChecker = $threedCheck and than we have local method doSomething(){$this->threedChecker->ThreeDCheck()} This is what I meant. Instead of example in PayFee class where we implemented Interface on 24:46. What if we have to implement threeDCheck interface in multiple classes? We repeat code? SRP, interfaces... I am trying to understand this things...
Thank you! Very helpful example! I'm quite new to the matter but after implementing "PaymentProcessInterface" shouldn't we get rid of the other three interfaces as I don't see any reason to use them in this case? Maybe we could declare them as normal classes and extend them in the payment type classes if needed? Many thanks for your help!
Coming from Swift, this is basically Protocols. The idea is pretty much the same, the naming is obviously different, interfaces sounds very tricky. But thank you for the explanation, i watched that in other classes and yikes, didnt really get it
@Peter Fisher I wonder if is a good idea to use a trait instead of 2 more interfaces to give the extra functionality FraudCheck to the class that need it ? I would appreciate it if you reply me
Great question. An interface cannot define the method body whereas a trait can. An interface is used to define the contractual obligations between multiple classes. We couldn't use a trait in this case as the body of fraudCheck was different between the classes however the implementation was the same. This has given me a great idea for a trait Vs interface video so I can demonstrate this
Today's tutorial covers PHP interfaces! Interfaces are the very important for object oriented programming. Let me know what other OOP subjects you wish me to cover in future videos
This is a great explanation. Just one thing. In the first 10 minutes with the shape example, you added ‘shape interface’ as a parameter in the addShape method. What does this do as I believe this would still work with only $shape as the argument?
Yes just having $shape as the parameter would work in that instance but you are losing out on DataType checking and IDE hinting. Plus You are allowing any type of shape into the method. If this class was in another file and created by another developer you would probably get confused as to what $shape represents. Interfaces make the code more readable as you know exactly how that interface should behave (What methods that class implements)
Peter Fisher that’s great. I get what you mean - it’s just like really strapping down your code and making sure it really works well to a fixed set of rules that are made flexibly by enforcing good usage of interfaces. Thanks again.
Hi +Sean Kelly yes I sure do. Tuesdays I do a tutorial like this Friday's I talk about web development/career/freelance Certain Paterons get early access to videos and can join my discord server to get coding help www.patreon.com/howToCodeWell
Thanks for the great tutorial. There is a confusion I am having about the object you declared for the payment gateway example. Since you created an object only for mintfee and passed it how will other 2 class methods will be code. I tried to run the code you have given and only the mintfee class methods are called. Can you explain that and clear the doubt?
Hi Thomas, have you compared your code to what is on GitHub: github.com/pfwd/how-to-code-well-tutorials/blob/master/tutorials/php/oop-beginners/interface/example_2.php It should work as each Payments type has a process method.
I'm just seeing this video and I appreciate your simplified explanation, I just read a source on Dependency Injection and how ir eliminates tight coupling. This looks quite similar to what was implemented in the source I read. Could your example be likened to a somewhat implementation of Dependency Injection.
Here is the link to the post php-di.org/doc/understanding-di.html My next question is this, instead of using Interfaces, could we have used Traits? I was assuming that, since Traits also helped in solving the limitations of PHP not supporting multiple inheritance. Thank you.
Great question. An interface is like a contract between two people. The contract states what is required by the class to fulfill its responsibilities. A trait cannot be instantiated and nor can it implement interfaces. It is simply telling PHP to drop a set of functionality into a class. So its a question of design. Both have pros and cons. ... There is an RFC about traits with interfaces wiki.php.net/rfc/traits-with-interfaces
i thought duplication was a bad thing..is there a better way to put the three shapes in the same class or call them with the same attributes somehow? i like the format of code and you on same screen..alot easier to concentrate. thx
Duplication is a code smell but that doesn't mean the method names of each class needs to be unique. Using interfaces we can segregate our classes whilst enforcing the behaviours of those classes.
so do you need to name circle, square, line as seperate classes or cant you put them into 1 class if they do the same thing? tbf it doesnt really matter ha
Hi yes it's here: github.com/pfwd/how-to-code-well-tutorials/tree/master/tutorials/php/oop-beginners/interface I need to think about how to link to the code better. I was thinking of having one repo per tutorial series/course but that would be a huge amount of repo's.
Thanks very much for this. And, since I didn't say so earlier, thanks for this tutorial. I've been looking for an explanation of interfaces for quite some time and this is by far the best example I've come across.
you know you use an interface to be able to swap between different classes... wouldnt a drop down menu on the users side do the same? or is this what the interface allows you to do on the users side?
i always see these tutorials as apps with a real user at tother end of the code.. so i see users side as if this was an app you were designing where a real person is using the app to create shapes.. does that make sense. so a drop down menu would dynamically change circle square line on select of one of these shapes the code would fire, thus taking away need for an interface
You should still use interfaces as these will enforce the behaviours of future shapes (From a code perspective). I would think more about designing the classes in OOP and less about the overall GUI.
The question is to perform a research on any emerging trends with respect to creating PHP interfaces and use this knowledge to add luster to your interface
Sorry for the delay. I'm not really sure what you mean by luster. Soon I will be creating a tutorial using PHP interfaces with Symfony services which may be of interest
@@howtocodewellmainly bc. of the lack of typing, as soon as you hit array like structures you don't even have a chance despite IDE and PHP 7. Also php lacks a lot of useful features. The community seems to have shrunk.
Can I ask where you are from? In the UK the PHP community is still buzzing. Perhaps it's different in other countries. I'm a Python and a PHP dev (I also dip my toes into other/more strictly typed languages from time to time) Tuples and lists can also be frustrating to use at times. Especially if they are not cleanly defined. But I best what you are saying about PHP arrays.
@@howtocodewellI am from Germany - but I was not talking about the local community, but the online one. I feel like there is really little content about php later than 5 or modern concepts in general. I switched from arrays to github.com/php-ds/ext-ds ;) (Unfortunately still not typed, but without generics and code generation this is probably the best one can get) And I come mainly from C++, C#, Go, TypeScript (in descending order)
I watched much tutorial for interface multi languages .. and i never understand why be should to use interface expect your tutorial I understand now, thank you so much ❤️
That's great to hear. I've got loads of programming tutorials on a bunch of languages so stick around. Please ask of you have any questions
Ok, this makes me look stupid but the truth is that I am a PHP developer for over a decade and never understood the purpose of interfaces. Yes, I have read a dozen of tutorials and stuff but yeah, it never broke into my skull.
Your payment example just did the click in my brain. It further consolidated when you said at the end that there is no need for a bunch of if statements.
Thank you mate!!!!
Hey I'm glad I could help. This is the reason I do these videos. It took a long time for me to understand OOP interfaces and it didn't instantly 'click' until I tried many examples. Now I use them on a regular basis.
If you have any questions or suggestions for future videos then let me know.
Contabilidade 00 Império Contábil
Thank You Peter Fisher, I do very rarely subscribe to channels. But this video forced me to subscribe to your channel because this explained me in a simple and practical way of using interfaces in the real world environment. Thank you Jesus for leading me to this beautiful tutorial. God bless you. :-)
Thank you
I have watched many of these - but this is the best video about interfaces in PHP.
Thank you for saying that. 👍
Excellent example and explanation!
Thank you! :)
Nice tutorial! very straight forward in explaining Interface!
Great. glad you found it helpful
Thats was great tutorial. It made better understanding about interface in OOP. I wish to see more such clear and extended with good examples tutorial. What I missed is just how to organize folders and files, because I have been taught that Class file should have only class, and in this example it seems too many classes, so it makes a little bit confusing.
Great teaching approach.
Thank you very much. I’m part of the Live Coders team on Twitch and do a lot of these longer examples. I publish these to the Archive channel
ua-cam.com/users/HowToCodeWellArchive you may find some helpful examples there
@@howtocodewell Thank you for additional info. I saw that you are on youtube already 8 years and I will definitely will check more your videos. By the way, maybe you have somewhere tutorial how to update old version php to php8. I use Apache/Xampp, windows. I find some tutorials on youtube, but reading some comments it seems some people get errors.
Thank you again for your time and lessons : )
Very good explained - thank you!
You actually helped me a lot in understanding not only interface.. But the true purpose of it which focusses on cohesion and coupling. I knew a good principle of design is to have high cohesion, low coupling.. but still don’t know how to implement it in a system... thank you for your explanation. By doing this way, it will be easier to modify the system in the future. Better lecturer than my university’s lol
This is exactly why I do these tutorials. Thank you so much for your kind words. This inspires me to do more tutorials and courses
Very much useful and helpful great video
Glad it was helpful!
Great lesson, though 1 confusion.
Where you implemented the third interface just to implement the process(), so that fraudCheck() could be housed, would it not have been easier to include fraudcheck() inside pay() function for MintFee class
Like
public function pay() {
$this->fraudcheck();
}
thanks.
I have tried to understand bits of "oop" whenever I came accross them. Most high level presentations left me with "When would I ever want THAT?".
This particular film took me to the point I was really interested in.
It just remains to say "Thanks for publishing it"
Thanks Lawrence! I'm glad you found it useful
Hii.. I have a doubt on 16th line.. why we add circle on "public function addshape(circle $shape){}" ?
If i remove that circle it will also work without issues...
@@vijayanpn446 Imagine this -
We all have to pay bills and so I have a whole development team to handle this. They tell me they can interface to EVERYONE I need to pay.
I send them off to write the servers and produce a single version of a client that contacts them all in the same way.
For example, my generic interface accepts user-questions so I will call it "ItemToPay". Here are some examples:
* Who are you?
* What is my payment history?
* When was last payment due?
* When was it paid?
* Did it go through?
The whole project succeeded, so for the past two years, "Bill Explorer" takes many (pre-tested) servers such as "gas", "telephone" and "newspapers ".
Now along comes a "seriously expensive" Hardware Shop. Do I rewrite the "Bill Explorer"?
No, someone finds out to talk to the Hardware Shop, so that they fully support the same "ItemToPay".
Once that works, there will be new instances of "ItemToPay" that I can provide to my client and NOT rewrite anything else!
It helped me now to understand the reason why to use interfaces. Thank you! :)
Thats great. I'm glad it helped. Is there anything that you would like me to cover in future tutorials?
What is the theme you are using for your IDE? The coloring looks kind of neat and clean:)
This is a dark theme in phpStorm. I think it’s called Dracula 🧛♂️
2:52 the genuine way is always The English way.❤
What I captured very well in this tutorial is that interfaces are mainly setting rules for your classes, but from the code you wrote about the payment gateway, don't you think I can decide not to use interface as I will write all the methods that is needed for the different classes and call the methods inside the process method for each of the classes. I will now call the process method for any of the classes in the paymentGateway Class because they already all have process
please I need a reply peter fisher, thanks
Hi Solomon, I'm not exactly sure what you mean.
An interface defines the contract between two or more classes. An interface does not define the behaviour of the contract but defines the inputs and outputs.
@@howtocodewell good one, understood, thanks very much
@Solomon nweze you're most welcome.
@@howtocodewell then what’s the point of a contract if your code already agrees on how it’s classes would work since they have the same name methods. The process class seems to do what the implement class would do by passing the class you want into it since you already instantiate the class beforehand? Or Am I wrong to think that way.
Excellent example to explain the principles.
Thank you
thanks for great lesson
You’re most welcome
Great explanation Sir . I watched some videos about SOLID principle and if I am not wrong , the example shown in this video is Interface Segregation . Waiting for full in-depth tutorials with examples about SOLID in PHP . thanks again for this video .
Yes this does (or at least the last example does) fall into the category of ISP or the interface segregation principle.
I didn't label it as such because it's quite an advanced topic and this was meant for beginners. I do plan to do a whole course on the solid principles at some point but first I want to lay the foundations.
yes...I will be waiting for that series .
@@howtocodewell this vid is super great. Have you published the whole course regarding the solid principles?
No not yet. I've been working on other projects but it's on the list of things to teach 👍
@@howtocodewell willing to wait. :) Thanks && Goodluck!
Thank you very much! It helped me understand interfaces.. Great tutorial!
Great, I'm glad it helped
Thank you. This was good.
I have similar situation like this. Question is: when to use constructor and accept object to do the job instead of local method? For example, instead of threeDCheck and fraudCheck to pass their objects?
I wouldn't use the constructor to do any business logic if that's what you mean. Make the methods do the hard work.
@@howtocodewell Thank you for answering. I agree with this. But what I mean is this: new SomeClass(ThreeDSecureCheckInterface $threedCheck), constructor accepts $this->threedChecker = $threedCheck and than we have local method doSomething(){$this->threedChecker->ThreeDCheck()} This is what I meant. Instead of example in PayFee class where we implemented Interface on 24:46. What if we have to implement threeDCheck interface in multiple classes? We repeat code? SRP, interfaces... I am trying to understand this things...
Thanks, brah. I understand interfaces now.
No worries. Glad it helped
me too thank you
Very useful tutorial! Thanks
You're very welcome. Please let me know if you have any questions
Thank you! Very helpful example! I'm quite new to the matter but after implementing "PaymentProcessInterface" shouldn't we get rid of the other three interfaces as I don't see any reason to use them in this case? Maybe we could declare them as normal classes and extend them in the payment type classes if needed? Many thanks for your help!
Excellent tutorial, thank you very much!
I'm glad you find this helpful. :)
Coming from Swift, this is basically Protocols. The idea is pretty much the same, the naming is obviously different, interfaces sounds very tricky. But thank you for the explanation, i watched that in other classes and yikes, didnt really get it
Thank you. I've never used Swift before so I couldn't comment on the comparison
@Peter Fisher I wonder if is a good idea to use a trait instead of 2 more interfaces to give the extra functionality FraudCheck to the class that need it ? I would appreciate it if you reply me
Great question. An interface cannot define the method body whereas a trait can. An interface is used to define the contractual obligations between multiple classes.
We couldn't use a trait in this case as the body of fraudCheck was different between the classes however the implementation was the same.
This has given me a great idea for a trait Vs interface video so I can demonstrate this
Thanks for your explanation! Only interface tutorial I have understood :D
That's great to hear. Do let me know if you have suggestions for future tutorials. Happy coding
Thanks for replying! Do you have any tutorials on using OOP with databases?
I have course/playlist on using MYSQLi which is the PHP OOP way of accessing MYSQL: ua-cam.com/video/wA2GL0aVjPA/v-deo.html
RUN PHP!!! Awesome Mug!
Yep great mug. I'm drinking tea from it now!
Today's tutorial covers PHP interfaces! Interfaces are the very important for object oriented programming. Let me know what other OOP subjects you wish me to cover in future videos
you could also make videos about different paradigms, if available for php
Good idea I will look into to that
Great lesson, thank you for sharing.
Great to hear you found it helpful.
This is a great explanation. Just one thing. In the first 10 minutes with the shape example, you added ‘shape interface’ as a parameter in the addShape method. What does this do as I believe this would still work with only $shape as the argument?
Yes just having $shape as the parameter would work in that instance but you are losing out on DataType checking and IDE hinting. Plus You are allowing any type of shape into the method. If this class was in another file and created by another developer you would probably get confused as to what $shape represents. Interfaces make the code more readable as you know exactly how that interface should behave (What methods that class implements)
Peter Fisher that’s great. I get what you mean - it’s just like really strapping down your code and making sure it really works well to a fixed set of rules that are made flexibly by enforcing good usage of interfaces. Thanks again.
Really really great stuff. Do you do more of this?
Hi +Sean Kelly yes I sure do.
Tuesdays I do a tutorial like this
Friday's I talk about web development/career/freelance
Certain Paterons get early access to videos and can join my discord server to get coding help www.patreon.com/howToCodeWell
Thanks for the great tutorial. There is a confusion I am having about the object you declared for the payment gateway example. Since you created an object only for mintfee and passed it how will other 2 class methods will be code. I tried to run the code you have given and only the mintfee class methods are called. Can you explain that and clear the doubt?
Hi Thomas, have you compared your code to what is on GitHub: github.com/pfwd/how-to-code-well-tutorials/blob/master/tutorials/php/oop-beginners/interface/example_2.php
It should work as each Payments type has a process method.
2020 and PHP is not dead and it's more alive than some other technologies! Has anyone heard anything of ruby for a while?!
Sometimes I miss the old Ruby days
I'm just seeing this video and I appreciate your simplified explanation, I just read a source on Dependency Injection and how ir eliminates tight coupling. This looks quite similar to what was implemented in the source I read. Could your example be likened to a somewhat implementation of Dependency Injection.
Without reading it myself I cannot say for sure. However this does help to reduce coupling of code, features and responsibilities within a system.
Here is the link to the post php-di.org/doc/understanding-di.html My next question is this, instead of using Interfaces, could we have used Traits? I was assuming that, since Traits also helped in solving the limitations of PHP not supporting multiple inheritance. Thank you.
Great question. An interface is like a contract between two people. The contract states what is required by the class to fulfill its responsibilities. A trait cannot be instantiated and nor can it implement interfaces. It is simply telling PHP to drop a set of functionality into a class. So its a question of design. Both have pros and cons.
... There is an RFC about traits with interfaces wiki.php.net/rfc/traits-with-interfaces
i thought duplication was a bad thing..is there a better way to put the three shapes in the same class or call them with the same attributes somehow? i like the format of code and you on same screen..alot easier to concentrate. thx
Duplication is a code smell but that doesn't mean the method names of each class needs to be unique. Using interfaces we can segregate our classes whilst enforcing the behaviours of those classes.
so do you need to name circle, square, line as seperate classes or cant you put them into 1 class if they do the same thing? tbf it doesnt really matter ha
In this example they can all be in a single file but you would normal have one class per file
@@howtocodewellhe asked about classes, not files -> of course, if they do the same thing, then omit the redundant classes :)
In the case of shapes, couldnt you just use an abstract inheritance with abstract functions instead of interface?
Yes you could.
nice video man
Peter, Is the code in this tutorial available on github? Searched for it and didn't find anything?
Hi yes it's here:
github.com/pfwd/how-to-code-well-tutorials/tree/master/tutorials/php/oop-beginners/interface
I need to think about how to link to the code better. I was thinking of having one repo per tutorial series/course but that would be a huge amount of repo's.
Thanks very much for this. And, since I didn't say so earlier, thanks for this tutorial. I've been looking for an explanation of interfaces for quite some time and this is by far the best example I've come across.
Your very welcome. If you have any suggestions for future tutorials hen let me know
where do these functions go in your code?..do you use 'includes' to call them?
You could use PHP autoloading and/or require_one
require_one 'function.php' ;
thx for term.this explains it.
ua-cam.com/video/VC5HM0J0_Vo/v-deo.html
you know you use an interface to be able to swap between different classes... wouldnt a drop down menu on the users side do the same? or is this what the interface allows you to do on the users side?
I'm not sure what you mean by the 'users side'?
i always see these tutorials as apps with a real user at tother end of the code.. so i see users side as if this was an app you were designing where a real person is using the app to create shapes.. does that make sense.
so a drop down menu would dynamically change
circle
square
line
on select of one of these shapes the code would fire, thus taking away need for an interface
You should still use interfaces as these will enforce the behaviours of future shapes (From a code perspective). I would think more about designing the classes in OOP and less about the overall GUI.
Hi, do you know a few emerging trends respect to php interfaces?
Hi, How do you mean emerging trends? A PHP interface is normally used to define how other classes should integrate with the rest of the application
The question is to perform a research on any emerging trends with respect to creating PHP interfaces and use this knowledge to add luster to your interface
Can you help me with that?
Sorry for the delay. I'm not really sure what you mean by luster. Soon I will be creating a tutorial using PHP interfaces with Symfony services which may be of interest
Traits, its as simple as that.
Why don't you just put the fraud checking method inside pay method?
Fraud checking and payment are two separate processes and have their own responsibilities. Also having them separate makes testing easier.
Make sense. Thank you.
😑 omg I m so confused between abstract and inteface
Jump on a live stream or the Discord server and we a can discuss it.
@@howtocodewell link ?
You were confused about this yourself, it's obvious from your hesitant explanation, not very good.
oh dear - php is just awfull.
Why do you say that?
@@howtocodewellmainly bc. of the lack of typing, as soon as you hit array like structures you don't even have a chance despite IDE and PHP 7.
Also php lacks a lot of useful features.
The community seems to have shrunk.
Can I ask where you are from? In the UK the PHP community is still buzzing. Perhaps it's different in other countries.
I'm a Python and a PHP dev (I also dip my toes into other/more strictly typed languages from time to time)
Tuples and lists can also be frustrating to use at times. Especially if they are not cleanly defined. But I best what you are saying about PHP arrays.
@@howtocodewellI am from Germany - but I was not talking about the local community, but the online one. I feel like there is really little content about php later than 5 or modern concepts in general.
I switched from arrays to github.com/php-ds/ext-ds ;) (Unfortunately still not typed, but without generics and code generation this is probably the best one can get)
And I come mainly from C++, C#, Go, TypeScript (in descending order)
I've never heard or used that extension. I may check it out. Thanks.