filmov
tv
#10 PHP - OOP (Object Oriented Programming) Concepts | Magic Methods
![preview_player](https://i.ytimg.com/vi/yBUsfxS585g/maxresdefault.jpg)
Показать описание
Hello friends! I've started this new web development series in which I'm showing about PHP - OOP (Object Oriented Programming) Approach. And this is the 10th video of this series in which I'm showing you about Magic Methods in PHP OOP.
PHP functions that start with a double underscore – a “__” – are called magic functions (and/or methods) in PHP. They are functions that are always defined inside classes, and are not stand-alone (outside of classes) functions. The magic functions available in PHP are: __construct(), __destruct(), __call(), __callStatic(), __get(), __set(), __isset(), __unset(), __sleep(), __wakeup(), __toString(), __invoke(), __set_state(), __clone(), and __autoload().
The definition of a magic function is provided by the programmer – meaning you, as the programmer, will actually write the definition. This is important to remember – PHP does not provide the definitions of the magic functions – the programmer must actually write the code that defines what the magic function will do. But, magic functions will never directly be called by the programmer – actually, PHP will call the function ‘behind the scenes’. This is why they are called ‘magic’ functions – because they are never directly called, and they allow the programmer to do some pretty powerful things.
#php_oop
#object_oriented_programming
#php_oop_concept
If you like my works and my video tutorials then you can donate me some amount.
**********************************************************
**********************************************************
Thanks for watching this video. If you like this video then hit like button, share this video, And Subscribe my Channel. Also like my Facebook page for latest updates.
**********************************************************
**********************************************************
PHP functions that start with a double underscore – a “__” – are called magic functions (and/or methods) in PHP. They are functions that are always defined inside classes, and are not stand-alone (outside of classes) functions. The magic functions available in PHP are: __construct(), __destruct(), __call(), __callStatic(), __get(), __set(), __isset(), __unset(), __sleep(), __wakeup(), __toString(), __invoke(), __set_state(), __clone(), and __autoload().
The definition of a magic function is provided by the programmer – meaning you, as the programmer, will actually write the definition. This is important to remember – PHP does not provide the definitions of the magic functions – the programmer must actually write the code that defines what the magic function will do. But, magic functions will never directly be called by the programmer – actually, PHP will call the function ‘behind the scenes’. This is why they are called ‘magic’ functions – because they are never directly called, and they allow the programmer to do some pretty powerful things.
#php_oop
#object_oriented_programming
#php_oop_concept
If you like my works and my video tutorials then you can donate me some amount.
**********************************************************
**********************************************************
Thanks for watching this video. If you like this video then hit like button, share this video, And Subscribe my Channel. Also like my Facebook page for latest updates.
**********************************************************
**********************************************************
Комментарии