3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ public function __get($name){ return "A"; } public function __set($name,$value){ $this->{$name} = $value; return "C"; } } $a = new A(); // The return value of __set() is ignored // because of the way PHP processes the assignment operator $k = $a->b = "B"; var_dump($a,$k);

preferences:
75.72 ms | 402 KiB | 5 Q