{"action":"created","issue":{"url":"https://api.github.com/repos/1c7/VideoList/issues/50","labels_url":"https://api.github.com/repos/1c7/VideoList/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/1c7/VideoList/issues/50/comments","events_url":"https://api.github.com/repos/1c7/VideoList/issues/50/events","html_url":"https://github.com/1c7/VideoList/issues/50","id":101414093,"number":50,"title":"php 魔术方法试验","user":{"login":"1c7","id":1804755,"avatar_url":"https://avatars.githubusercontent.com/u/1804755?v=3","gravatar_id":"","url":"https://api.github.com/users/1c7","html_url":"https://github.com/1c7","followers_url":"https://api.github.com/users/1c7/followers","following_url":"https://api.github.com/users/1c7/following{/other_user}","gists_url":"https://api.github.com/users/1c7/gists{/gist_id}","starred_url":"https://api.github.com/users/1c7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1c7/subscriptions","organizations_url":"https://api.github.com/users/1c7/orgs","repos_url":"https://api.github.com/users/1c7/repos","events_url":"https://api.github.com/users/1c7/events{/privacy}","received_events_url":"https://api.github.com/users/1c7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-17T12:54:10Z","updated_at":"2015-08-17T13:19:27Z","closed_at":null,"body":"__construct()，类的构造函数\r\n__destruct()，类的析构函数\r\n__call()，在对象中调用一个不可访问方法时调用\r\n__callStatic()，用静态方式中调用一个不可访问方法时调用\r\n__get()，获得一个类的成员变量时调用\r\n__set()，设置一个类的成员变量时调用\r\n__isset()，当对不可访问属性调用isset()或empty()时调用\r\n__unset()，当对不可访问属性调用unset()时被调用。\r\n__sleep()，执行serialize()时，先会调用这个函数\r\n__wakeup()，执行unserialize()时，先会调用这个函数\r\n__toString()，类被当成字符串时的回应方法\r\n__invoke()，调用函数的方式调用一个对象时的回应方法\r\n__set_state()，调用var_export()导出类时，此静态方法会被调用。\r\n__clone()，当对象复制完成时调用"},"comment":{"url":"https://api.github.com/repos/1c7/VideoList/issues/comments/131816046","html_url":"https://github.com/1c7/VideoList/issues/50#issuecomment-131816046","issue_url":"https://api.github.com/repos/1c7/VideoList/issues/50","id":131816046,"user":{"login":"1c7","id":1804755,"avatar_url":"https://avatars.githubusercontent.com/u/1804755?v=3","gravatar_id":"","url":"https://api.github.com/users/1c7","html_url":"https://github.com/1c7","followers_url":"https://api.github.com/users/1c7/followers","following_url":"https://api.github.com/users/1c7/following{/other_user}","gists_url":"https://api.github.com/users/1c7/gists{/gist_id}","starred_url":"https://api.github.com/users/1c7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1c7/subscriptions","organizations_url":"https://api.github.com/users/1c7/orgs","repos_url":"https://api.github.com/users/1c7/repos","events_url":"https://api.github.com/users/1c7/events{/privacy}","received_events_url":"https://api.github.com/users/1c7/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T13:19:26Z","updated_at":"2015-08-17T13:19:26Z","body":"### __set()\r\n##### 在给不可访问属性赋值时，__set() 会被调用。\r\n<br/>\r\n\r\n\r\n\tclass A{\r\n\r\n\t\tfunction __set($a,$b){\r\n\t\t\techo $a;\r\n\t\t\techo $b;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t$a = new A();\r\n\r\n\t$a->bbbb = 3;\r\n\r\n\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1804755/9305642/8ee2bb22-4525-11e5-8809-67e8d0ffdc9c.png)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1804755/9305647/95e912ae-4525-11e5-8a26-4f6a17117dc2.png)\r\n\r\n\r\n"}}