OOPS concepts in PHP in Hindi (Late Static Binding) | Part-7

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 41

  • @Shanshu_blessed
    @Shanshu_blessed 2 роки тому +1

    I always come to this PHP tutorials when I prepare for interviews well simply explained concepts.

  • @bhawanisingh3671
    @bhawanisingh3671 3 роки тому

    Usefull video... Good video

  • @rajeshchauhan657
    @rajeshchauhan657 4 роки тому

    it was amazing

  • @amiyabhatta5180
    @amiyabhatta5180 5 років тому

    Very well exaplined

  • @lahoretech0781
    @lahoretech0781 5 років тому

    Rahul you are awesome seriously the way you deliver. Respect from Lahore, Pakistan.

  • @vijaysinhparmar9788
    @vijaysinhparmar9788 5 років тому

    Thanks sir for great job, I have read many documents to understand oops concept but I was not cleared, and your video did miracle for me with real time example, keep continue share knowledge 🙏

  • @TahirKhan-vp6pz
    @TahirKhan-vp6pz 6 років тому

    Outstanding , if someone to clear their concept then he is in right place

  • @abhishekdas149
    @abhishekdas149 6 років тому

    thank's a lot . It made the concept clear regarding why to use late_static_binding

  • @imjoker6460
    @imjoker6460 7 років тому

    I would like to say that you are really good in teaching. I get a lot of help from this tutorial series. I hope you will continue with more tutorials in future.

  • @Sunilkumar-gz2gx
    @Sunilkumar-gz2gx 9 років тому +2

    Good job Rahul. I will appreciate your way to teaching with real time example. The use of late static binding was not clear for me before watching this video but i came to know the actual use of it in PHP frameworks.
    Thanks a'lot Rahul....... :)

  • @SagarSharma_shaggy
    @SagarSharma_shaggy 7 років тому

    best tutorial ever

  • @hkpcnair
    @hkpcnair 8 років тому

    Amazing tutorial. well done mate. simple way to explain things

  • @faryadali01
    @faryadali01 7 років тому

    very useful. Thank You

  • @moneyharry
    @moneyharry 8 років тому +2

    Thanks for the video, I understood the concept of late static binding, that self keyword always relates to the class where it is mentioned, it is resolved at compile time, and static keyword relates to the class which is inheriting it, and it's resolved at run time:
    class Abc {
    public static function myStatic(){ return new static; }
    public static function mySelf(){ return new self; }
    }
    class Def extends Abc {}
    $def = new Def;
    echo get_class($def->myStatic()); //returns Def
    echo get_class($def->mySelf()); //returns Abc
    ---------------------------------------------------------------------
    But I have one question, the example you gave, the same result we can achieve without using static property and static keyword, like this:
    ---------------------------------------------------------------------
    class DB {
    protected $table = "defaultTable";
    public function getTable(){ return $this->table; }
    }
    class Abc extends DB{
    //needs default table to be set as table
    }
    class Def extends DB{
    protected $table = "def";
    }
    class Xyz extends DB{
    protected $table = "xyz";
    }
    $db = new DB;
    $abc = new Abc;
    $def = new Def;
    $xyz = new Xyz;
    echo $db->getTable(); //returns defaultTable
    echo $abc->getTable(); //returns defaultTable
    echo $def->getTable(); //returns def
    echo $xyz->getTable(); //returns xyz
    --------------------------------------------------------------------
    So I just want to know that does it make any difference in this case?
    --------------------------------------------------------------------

  • @amarsingh-gn2lw
    @amarsingh-gn2lw 7 років тому

    thanks for this video

  • @SandeepKumarsoftwaredeveloper
    @SandeepKumarsoftwaredeveloper 10 років тому +2

    very nice tutorials sir thanx a lot for this.

  • @JaskaranSingh-ro1cz
    @JaskaranSingh-ro1cz 8 років тому +1

    Nice Tutorial Thanks

  • @alokrai3920
    @alokrai3920 7 років тому

    Hi sir,
    I have Two Questions?
    1 ) The same thing can be achieved with simple class and objects like
    class base{
    public $_table='baseTable';
    public function get(){
    return 'Get Data From '.$this->_table;
    }
    }
    class model extends base{
    public $_table = 'Product';
    }
    class newmodel extends base{
    public $_table = 'Customer';
    }
    $obj = new model;
    echo $obj->get()."";
    $obj = new newmodel;
    echo $obj->get();
    OUTPUT //
    Get Data From Product
    Get Data From Customer
    Then what is the need of using late static binding?
    2) Does PHP allocate any memory to class if I don't create any object of that class. (Suppose If I include 50 Classes in file and don't create any objects so is it going to allocate memory?
    Please Reply...

  • @DefaultName-fi1cv
    @DefaultName-fi1cv 8 років тому

    Nice Tutorial. Can you do a tutorial on PHP call backs in OOPs.

  • @alpeshmakwana3497
    @alpeshmakwana3497 4 роки тому

    Sir self:: ka use kya he?
    Or static :: ka bhi mtlb kya hota he?

  • @ashishchoudhary1664
    @ashishchoudhary1664 8 років тому

    means "static" will hold the last modified value and not what its called upon.

    • @boravivek
      @boravivek 8 років тому +1

      For LateStatic Binding we use static keyword instead of self , static keyword makes the variable pending at the run time and after run time it checks that from which class the function is being called , and accordingly it picks the value of variable from the class the function has been called. So if the variable table is called from class DB then it will have Value baseTable and if it is called from table abc then it will have the value abc.

  • @AsifKhan-qj2rw
    @AsifKhan-qj2rw 7 років тому +2

  • @trimedu3187
    @trimedu3187 8 років тому

    nice one!!! But one question... We can do the same thing without using late static..
    for example

    • @ashishchoudhary1664
      @ashishchoudhary1664 8 років тому

      This is not a good example. What if you have two classes named Table1 and Table2 and both are extending DB class. Then how will you use the insert method from parent class on two different tabes without defining it again in child class. How ill you change the table name in DB class's insert method?

  • @affankagzi6845
    @affankagzi6845 9 років тому +1

    hi sir great tutorial....wht basic knowledge shd i have bfr learning laravel

    • @PHPinHindi
      @PHPinHindi  8 років тому +2

      +affan Kagzi you should learn the OOPs first ..

  • @igmtan
    @igmtan 7 років тому

    please upload late static function example

  • @amzadhussain8582
    @amzadhussain8582 6 років тому

    Why does we use static methods and variables?

  • @smartnavish2836
    @smartnavish2836 9 років тому +2

    Hello Sir,
    We can also handle this with simple functions then why we user late static binding?

  • @1986rajas
    @1986rajas 7 років тому

    when class is extended and both parent and child class has static functions, does the static functions doesnt override the base class function when we call the function by creating an object ?

  • @shahnawazkhan3960
    @shahnawazkhan3960 8 років тому +1

    insert query dynamic kesay bana saktay hain bcx har table ki fields different hoti hai plz uski koi video bana kay plz share karay :)

  • @mif9072
    @mif9072 6 років тому

    Sound bohat low aata hai

  • @teenasuresh9369
    @teenasuresh9369 9 років тому

    in abc class why does variable $table doesn't override?

  • @hgoraya
    @hgoraya 6 років тому

    php interpreter or compiler?

  • @lilasharma7060
    @lilasharma7060 6 років тому

    Apka voice kitna kam q sunai de rha hai?