8: Static Properties And Methods In OOP PHP | Object Oriented PHP Tutorial | PHP Tutorial | mmtuts

  Рет қаралды 108,266

Dani Krossing

Dani Krossing

Күн бұрын

Пікірлер: 135
@Dani_Krossing
@Dani_Krossing 5 жыл бұрын
Before any comments! Yes episode 9 is missing! I decided to remove my lesson about the "toString" PHP method, and instead I will upload an episode on "type declaration" soon enough.
@fr3fou
@fr3fou 5 жыл бұрын
You should pin this :)
@UnboxTek
@UnboxTek 5 жыл бұрын
can you please post the "PLAYLIST" link on the description as well? :) Thanks!
@khaledal-falihi7311
@khaledal-falihi7311 5 жыл бұрын
❤😘👌
@RedBunny
@RedBunny 5 жыл бұрын
Dear fellow students/web developers, Make this channel grow and donate. These videos are better than a lot of the paid ones on Udemy and this guy is making it for free. I would pay for videos this qualitative in a heartbeat. Keep on going man!
@user-rx8lz6yz4f
@user-rx8lz6yz4f 5 ай бұрын
Thanks for being one of the few KZbinrs to explain this properly. 👍
@yungifez
@yungifez 4 жыл бұрын
It is so joyful seeing mmtuts making mistakes. It reminds us that even the best makes mistakes so we should not be frustrated and think little of ourselves when we do so
@karolispetrikas7798
@karolispetrikas7798 4 жыл бұрын
This is how you teach. Relax, don't stress you students, don't use complex sentences and acronyms just to show-off how cool your are. I came here from a PHP bootcamp, where they thought they taught entire OOP in 3 hours... complete and utter joke. You a role model teacher!
@sistemasuniverso1461
@sistemasuniverso1461 2 жыл бұрын
Son impresionantes tus lecciones. Jamás me fue tan claro este tema. Te agradezco infinitamente. Sos excelente educador!
@Ольга-ж5к4й
@Ольга-ж5к4й 5 жыл бұрын
Dude, I'm in love with you, sooo good explanations - that's a talent...
@uchihamadara4340
@uchihamadara4340 Жыл бұрын
I wish I had a teacher like you back then; it would have saved me a lot of time. Thank you, Daniel, for this amazing course. Keep up the great work!
@Michael-lo3ht
@Michael-lo3ht 11 ай бұрын
Love this series so far. At first, on this one you caught me off guard for a second. I thought it sounded like you said Stetic. lol But then realized you said Static. After hearing you say it more it was clear. I love how you explain the reason why you stuff, instead of just telling you to do it. It helps to know why. Thanks
@kodelagi-daniel
@kodelagi-daniel 5 жыл бұрын
hi daniel. Im really grateful for your lessons. i learned more from you than from my school, thanks
@stefano5146
@stefano5146 4 жыл бұрын
Your videos and teaching style is perfect for me, thank you!!
@khusamalfas2121
@khusamalfas2121 3 жыл бұрын
Dani, you are very simplifying it, and that's awesome, Do not worry most of the senior developers misspelling things and that normal in process. Keep it up it's worth the time you are spending.
@ינוןאלבז-כ1ז
@ינוןאלבז-כ1ז 5 жыл бұрын
Wow you've done amazing work in this playlist. For a long time I've been trying to understand object-oriented programming and you're making it easy to understand for me. thank you dear!!!
@0Apostata0
@0Apostata0 5 жыл бұрын
Hi there, love your vids! But could you also include real life practical examples in your tuts? Like creating user objects on register forms and saving them into a db or something like that? Often simplified tutorials just explain the concepts but never show real life examples of using OOP. It makes it a lot harder to apply, there need to be more practical examples. Thank you and great work!
@AnimalChannelTube
@AnimalChannelTube 3 жыл бұрын
Very good teacher. Good Tutorial
@ThatoJChere
@ThatoJChere 4 жыл бұрын
You changed my programming life for the better...Big up
@quasarkid4256
@quasarkid4256 2 жыл бұрын
This explanation was excellentl. Thanks for helping me understand this topic clearly
@GarTheStar
@GarTheStar 5 жыл бұрын
you are a legendary teacher
@mariavictoria5435
@mariavictoria5435 2 жыл бұрын
Good job and explanation! Thanks a lot!
@MB-zj3er
@MB-zj3er Жыл бұрын
Thank you for your videos, I have found them very helpful. 👍
@smartwolf9045
@smartwolf9045 4 жыл бұрын
wow...thanks very mutch man, exactly what I needed. You don't imagine how mutch it helps.
@osraneslipy
@osraneslipy 4 жыл бұрын
OOP is so freakin confusing, luckily we have you :)
@oghenevwefepeace2501
@oghenevwefepeace2501 2 жыл бұрын
You are awesome man.. God bless you
@michaelbruce5415
@michaelbruce5415 4 жыл бұрын
An excellent series on PHP OO Programming.
@bjornarmar2462
@bjornarmar2462 5 жыл бұрын
I just facepalmed because I got this far without having subscribed yet. Fixed that issue!
@jaibodele6363
@jaibodele6363 5 жыл бұрын
video is really good and the content is also good.
@ivnstudios6135
@ivnstudios6135 4 жыл бұрын
like a lot the tutorials, you explain very well Sr. Thanks a lot for making them, finally I am understanding PHP !!
@jackt6112
@jackt6112 2 жыл бұрын
Great explanation.
@programmingtestsandproje
@programmingtestsandproje 3 жыл бұрын
thank you so much
@geneartista9714
@geneartista9714 4 жыл бұрын
Awesome tutorial as always!!
@sumanbd77
@sumanbd77 Жыл бұрын
Awesome Thanks a lot ❤❤❤❤❤
@srdjagunjic
@srdjagunjic 5 жыл бұрын
Awesome tutorials Daniel! Keep it up
@GarryThakur07
@GarryThakur07 5 жыл бұрын
Hey man, new subscriber here. Great course, Great way of teaching and setup. Am really gonna show these videos to my friends too as it's so good and clears up most of the problems we face. Also you look very much like Luka Jović :P
@tonygonzalez125
@tonygonzalez125 5 жыл бұрын
Thanks man! Greetings from Brazil :)
@abolfazl3273
@abolfazl3273 11 ай бұрын
Nice ❤‍🔥
@0x1stvan
@0x1stvan 4 жыл бұрын
8:35 Best cut ever :D
@daniel71626
@daniel71626 4 жыл бұрын
Thank you, i really got it clear now.
@ChangeYourLifeForever
@ChangeYourLifeForever Жыл бұрын
the first time after many years i understand the purpose of the STATIC in PHP
@davidvaho
@davidvaho 5 ай бұрын
I'm wondering, If it is good usage to have non-static method checkDrinkingLegality() which compares private property age and static property drinkingAge, so after object initialisation with age 18, method returns false (18 >= 21), but then you can use that static method setDrinkingAge(18) and then, calling checkDrinkingLegality on that object returns true, because meanwhile value of static property of Class changed to 18.
@Coda02
@Coda02 3 жыл бұрын
Thanks a lot I think I understand it now, so like a static is almost kind of like a global variable within a certain class
@vaishakhkp5612
@vaishakhkp5612 5 жыл бұрын
Really helpful budd, keep it up.
@ChandraTech52
@ChandraTech52 5 жыл бұрын
Thank you so much things making so easy, learned a lot ❤️❤️❤️
@mangeshsathe
@mangeshsathe 4 жыл бұрын
Good explanation!
@siriusgd4753
@siriusgd4753 5 жыл бұрын
I learned something today!
@prsion1925
@prsion1925 5 жыл бұрын
Thanks for your sharing with us
@birdhousegypsy3655
@birdhousegypsy3655 4 жыл бұрын
no drinking age! That sounds awesome! haha!
@hayatzee8830
@hayatzee8830 2 жыл бұрын
Thank you!
@issaissifou4959
@issaissifou4959 2 жыл бұрын
Thank you so mach.
@thomask.7978
@thomask.7978 4 жыл бұрын
I wonder what your technical setting is for such brilliant presentations. Clear voice, big HD screen, you standing in front of the screen i. e. one can hear and see everything easily. I'd appreciate it if you told us how you do this?!
@bigdog3386
@bigdog3386 5 жыл бұрын
You are an awesome guy!
@alexv_web_dev
@alexv_web_dev 4 жыл бұрын
Keep up the good work!
@srijanlama6446
@srijanlama6446 5 жыл бұрын
nice work brother keep up the good work love from nepal
@perfect.stealth
@perfect.stealth 5 жыл бұрын
Super gode og lærerige videoer
@hitzjoshi1875
@hitzjoshi1875 5 жыл бұрын
Hy Is It Possible in Php when internet is not available then it will save as local system data and when ever internet is access then it will sync data to database phone admin?
@srijanlama6446
@srijanlama6446 5 жыл бұрын
if u would make the video series in dependency injection and modular programming in php then that would be super great
@bikramneupane1818
@bikramneupane1818 5 жыл бұрын
You tutorial is very well
@AxxionMarketPlace-iu6ri
@AxxionMarketPlace-iu6ri Жыл бұрын
Thank you
@Annak942
@Annak942 Жыл бұрын
Oooohh *frontend dev taking notes*
@nawalnitsua8893
@nawalnitsua8893 6 ай бұрын
@Dani_krossing can I summarize by saying static methods and properties are those that do not vary from object to object at instantiation from the class? As in it's said to be static because it's same for any object instantiated from that class
@BigStance
@BigStance 5 жыл бұрын
Can I ask you to film a series of php oop register form programming? :)
@Jay-eg7yt
@Jay-eg7yt 5 жыл бұрын
Two thumbs up on the video. In the static example being used the property is public. I am curious to know if it is possible to do this using a private static property and if so, in what type of situation would it best be suited for?
@talkohavy
@talkohavy 5 жыл бұрын
Question: What about Static Classes? What do I do when I have several classes which all need access to the same Static Class that holds all the information?
@khatau
@khatau 5 жыл бұрын
I don't think there is anything like Static Class. The concept of Static is to access properties and methods without creating an object, or without inheriting an entire class just to access one property/method. Separately, if you have several classes that need access from one class (that one class is a 'parent' class by the way... you don't have to declare it a parent class though), then you need to inherit. Check mmtuts' 4th video on "visibility and inheritance".
@taet6882
@taet6882 5 жыл бұрын
hi dear thank you for your great tutorials! appreciate it ! because i couldn`t find anyone in whole internet and tutorials who can teach like you! will you gonna make videos about : namespace ,abstract, autoloader ..... and other oop functions and concepts that are in php manual ???? thank you!
@Dani_Krossing
@Dani_Krossing 5 жыл бұрын
Thank you! autoloader is already created and scheduled for upload on Monday :) Abstract classes and methods will also soon be a video. I am going to wait a bit with Namespace.
@taet6882
@taet6882 5 жыл бұрын
@@Dani_Krossing thank you very much .i will wait !
@flifluflofli
@flifluflofli 5 жыл бұрын
There is something i miss cause i tested to call static method and actually I can call them from the instance Object build from the Class ( so the static is not static ?) and I can also go with static way as u say calling inside the class I reach both with no problem.. but when it is a proprety it react differently ?
@paulbrugger9610
@paulbrugger9610 3 жыл бұрын
If you change a static property to a regular class variable then each derived object could have a different value....
@autopilot7953
@autopilot7953 5 жыл бұрын
hi, have been subbed a while now and i can say you are the best teacher and you talk so clear and understandable,thanks!I am having some problems with my website (php, js) and i want a little help from you,could you help me?
@leonf.7893
@leonf.7893 3 жыл бұрын
I don't feel so bad about creating static classes any more. I used to only create helper methods as static because I had this notion that static methods were some kind of bad thing.
@webteches
@webteches 5 жыл бұрын
thanks sir
@priyranjansingh2792
@priyranjansingh2792 4 жыл бұрын
Nice video
@juulmorten
@juulmorten 4 жыл бұрын
I think the way i remember static is that it affects all objects of that class, so if you change the drinking age then it will be changed for every object.
@lesastucesinternetdemuriel1026
@lesastucesinternetdemuriel1026 5 жыл бұрын
good job
@spiderangelo
@spiderangelo 3 жыл бұрын
Good Tutorial... But want to inform you about some errors. there are errors where you create function getDA, also when you are accessing it!
@tdias25
@tdias25 4 жыл бұрын
you look like elon musk, great tuto btw
@ademottoman962
@ademottoman962 5 жыл бұрын
hi can you nake a live stream the last one i loved it
@Mehrdad_Manouchehri
@Mehrdad_Manouchehri 5 жыл бұрын
THanks
@ehtishamjadoon2003
@ehtishamjadoon2003 5 жыл бұрын
Sir kindly make a vedio on CRUD system in oop php
@Marxone
@Marxone 2 жыл бұрын
I don't get it. I mean, i can call non static method with (new Class)->method(); , but when I don't need the rest of the context, it is cleaner to just use Class::method() ? For example if I have just some support functions that are used across the project?, and the inheritance structure isn't suited to have it just once on the highest level?
@tloulehlohonolo06
@tloulehlohonolo06 4 жыл бұрын
Good day may you please explain to me when do you use public, private and protected in php
@moldovandorin6187
@moldovandorin6187 5 жыл бұрын
what a nice guy :)
@TheJDieJ
@TheJDieJ 5 жыл бұрын
is public static similar to const in js?
@astrosoup
@astrosoup Жыл бұрын
One point of confusion. If you update a static property, will it go back and update the same property for $person1, $person2, etc.. Will it also use the new value for any newly created $person objects after this?
@Dani_Krossing
@Dani_Krossing Жыл бұрын
A static property isn't object specific, and will change all existing or future objects, since they reference to the same data. 🙂
@UnboxTek
@UnboxTek 5 жыл бұрын
where's the link of the PLAYLIST of these tutorials? :)
@Dani_Krossing
@Dani_Krossing 5 жыл бұрын
On my channel page there is a link to all my courses. But you might be right about that there should be links under the video as well, so I will do that :)
@UnboxTek
@UnboxTek 5 жыл бұрын
@@Dani_Krossing yes please :) for us to bookmark it, cause currently what is indexed or displayed on your YT page is the older version of the tutorials. TIA!
@dfordemo981
@dfordemo981 4 жыл бұрын
"we cannot use the static property inside nonstatic method" right??
@selimeneskaraduman6935
@selimeneskaraduman6935 4 жыл бұрын
How can I thank you man :( ? You taught me lots of things thanks!!! really
@Mercio2
@Mercio2 4 жыл бұрын
nice
@WideEyesChannel
@WideEyesChannel 5 жыл бұрын
Dude I like you're teaching method.. do you have a Twitter account?
@arsalarsi7858
@arsalarsi7858 3 жыл бұрын
What if i want to know how many objects were created for the class without using "__construct" maybe with get_called_class???
@alsur272
@alsur272 4 жыл бұрын
by the way :: in Php is called "Scope resolution operator"
@augischadiegils.5109
@augischadiegils.5109 3 жыл бұрын
@calin6327
@calin6327 5 жыл бұрын
You moved such a long way
@trravelog-t5
@trravelog-t5 4 жыл бұрын
Hey Daniel, you have awesome courses, I got a very good understanding of OOPs from your video. I was trying something locally and not able to crack it, i know its simple but for some reason its not working. I have an index page and a class file. In class, I have defined it something like this Class ABS{ private $var1 private $var2 private $var3 public function function1(){ Some SQL query which return an iD //from the array i get the below ID, and when i do an echo here it shows the id as well echo $ID = $this->var3 = ID['SrID']; } public function function2(){ echo $ID; //doesnt work //basically trying another SQL here with the ID I get in function1// } ) so how can I get this variable from function1 to function2, I tried a lot but did not work, so for now what I did is, in the index file I got a return from function one and then I have passed that ID to function2 in index, something like below $classvalue = new ABS(); $ID=$classvalue-> function1(); echo $classvalue-> function2($ID); wondering if there is an easy way to it.
@PanlasangMotour
@PanlasangMotour 5 жыл бұрын
Do you have a tutorial on How to Create A Membership System Using PHP and MySQL Tutorial with email verification ?? Thanks a lot :D
@mahdisharifi5989
@mahdisharifi5989 5 жыл бұрын
thanks for this video , but i did not understand that when we must use static keyword
@ademottoman962
@ademottoman962 5 жыл бұрын
Hi can make some flutter videos
@edieperdana2101
@edieperdana2101 4 жыл бұрын
I can't find video number 7
@rohankhode4200
@rohankhode4200 4 жыл бұрын
When i run these code it shows me error: Notice: Undefined variable: setDrinkingAge in C:\xampp\htdocs\oop\index.php on line 20 Fatal error: Uncaught Error: Function name must be a string in C:\xampp\htdocs\oop\index.php:20 Stack trace: #0 {main} thrown in C:\xampp\htdocs\oop\index.php on line 20 public static $drinkingAge = 23; public static function setDrinkingAge($newda){ self::$drinkingAge = $newda; } echo Student::$drinkingAge; echo Student::$setDrinkingAge(93); echo Student::$drinkingAge;
@MhmmDonuts
@MhmmDonuts 5 жыл бұрын
Can u make a tutorial about how to upload files in MVC pattern using ajax on a action controller? Or how can I pass the file I get from ajax for example $model->fileUpload($thjs->getPost['file']) argument to any function in any class? I couldn't find anything help me plss haha
@maxiequa567
@maxiequa567 5 жыл бұрын
Would you be interested in making a video on Paypal integration? Seems a lot of people are looking for it these days.
@zehnagel6556
@zehnagel6556 5 жыл бұрын
You should be aware that public static variables ($drinkingAge) can be changed from anywhere (during code execution), and this change affects all instances that use this static variable. They are some kind of scope-less.
@Dani_Krossing
@Dani_Krossing 5 жыл бұрын
That's right! You tell them Zeh! ;)
@f0ru0l0rd
@f0ru0l0rd 4 жыл бұрын
@@Dani_Krossing So... maybe I'm dense, but question: Why use this instead of a hard coded property? I'm thinking (though it WASN'T explicity said, so I could be wrong), is that if say I had an object of Dog, and it's latin name changed, if I did Static, all my objects (old and new would be updated automagically? Is that correct, or am I misunderstanding this?
@mwgmedia2378
@mwgmedia2378 5 жыл бұрын
First comment here :)
@romeoasif
@romeoasif 5 жыл бұрын
that colon colon is actually called a scope resolution operation -_-
@yungifez
@yungifez 4 жыл бұрын
I'm suspecting mmtuts. He always keep using the same set of names . Are you sure those are not his siblings
Who is More Stupid? #tiktok #sigmagirl #funny
0:27
CRAZY GREAPA
Рет қаралды 10 МЛН
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
Static Properties & Methods In Object Oriented PHP -  Full PHP 8 Tutorial
12:58
Static properties and methods in PHP - OOP in PHP | Part 3
8:24
The Codeholic
Рет қаралды 10 М.
Static vs Non-Static Variables and Methods In Java - Full Simple Tutorial
11:29
Should You Learn Object Oriented PHP?
13:48
Dani Krossing
Рет қаралды 12 М.
When to use Traits, Interfaces, and Abstract Classes in PHP
15:08
Andrew Schmelyun
Рет қаралды 25 М.
Who is More Stupid? #tiktok #sigmagirl #funny
0:27
CRAZY GREAPA
Рет қаралды 10 МЛН