×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Sayel Fujael
Added: Mar 16, 2021 1:54 PM
Modified: Mar 16, 2021 2:25 PM
Views: 4772
Tags: getter setter
  1. public function __set($name, $value) {
  2.         $this->$name = $value;
  3.     }
  4.     public function __get($name) {
  5.         return $this->$name??null;
  6.     }