Getters & Setters | PHP | Tutorial 32

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

КОМЕНТАРІ • 16

  • @ranjanadissanayaka5390
    @ranjanadissanayaka5390 16 днів тому +1

    amazingly clear explanation. Thank you so much Mike, You are awesome.

  • @clementk.2561
    @clementk.2561 6 років тому +5

    Could you please expand this series and teach about magic methods, encapsulation, polymorphism and other advanced topics?

  • @predragradojicic5829
    @predragradojicic5829 Рік тому

    Very good explanation!

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

    Excellent! This is the explanation I was looking for.

  • @tenzindorjee7689
    @tenzindorjee7689 2 роки тому

    Thank you so much mike

  • @ΓιώργοςΠαπακώστας-ι6υ

    amazing video!

  • @m.d.3220
    @m.d.3220 4 роки тому

    great explanation, thank you

  • @starlyvil
    @starlyvil 5 років тому +3

    Thanks for your tutorial, i was looking forward to seeing getters and setter special function being called in a property-like manner instead of being called like a method.
    For example, in JavaScript, a setter named "color" would be called this way: Obj.color = "red", which would set a private property member (e.g. fontColor) that needs the set value, instead of Obj.color("red"). The getter as well would be called the same way but without assignment, that is: Obj.color.
    The getter and setter functions are special because they are used internally by the language kernel, and not in application level. This automatically means that PHP has no getter and setter function. Any other public method could be used to implement the getRating() and setrating() functionality.
    If this doesn't exist in PHP, then PHP is backward in this OOP feature, they should implement it.

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

      Though there is a public function __set() {} and public function __get() {} available for any class.

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

    your tutorials are great :)

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

    Does anyone know which Atom package needs to be installed in order to get the error output on the browser? like here: 6:18

    •  4 роки тому

      that error is from php, not by IDE. any IDE will work. even simple notepad

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

    It deosn't works with me the first code it didn'e print anything

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

    I understand it now. Kinda got confused when you had a property called $rating and you create an argument for setrating calling it $rating also. but maybe its just me that didn't get the whole arguments passing into function idea yet.

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

    even though I changed it to private I could still edit and display the rating

  • @gabehcuodsuoitneterp203
    @gabehcuodsuoitneterp203 2 роки тому

    1:50 there are some other ratings. 😅