This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// once you add the magical setter and getter | |
// you can can access any private fields as usual | |
// but you can also develop custom setter and getter if you want | |
$user = new MagicUser(); | |
$user->username = "test"; | |
$user->password = "pass"; | |
echo $user->username; // will print Test not test. |