PHP Magic faster than simply setting the class attribute?
I don’t get this… and I guess it doesn’t matter that much, but if someone has an explanation, let me know
[root@vm-202-167-238-17 ~]# cat test.php; for d in A B C; do echo "——"; ./test.php $d; done;
#!/usr/bin/php
<?php
$className = $argv[1];
class A
{
public function __get($a)
{
return 5;
}
}
class B
{
public $a = 5;
}
class C
{
public function __get($a)
{
$this->a = 5;
return 5;
}
}
$a = [...]
