{"id":78,"date":"2006-09-21T15:53:30","date_gmt":"2006-09-21T07:53:30","guid":{"rendered":"http:\/\/blog.lmf.idv.hk\/?p=78"},"modified":"2006-09-21T15:53:30","modified_gmt":"2006-09-21T07:53:30","slug":"phpunserializeobject%e4%b9%8b%e5%be%8c%e5%be%97%e5%88%b0incompleteobject","status":"publish","type":"post","link":"https:\/\/blog.lmf.idv.hk\/?p=78","title":{"rendered":"PHP: unserialize object \u4e4b\u5f8c\u5f97\u5230 INCOMPLETE OBJECT?"},"content":{"rendered":"<p>\u4f7f\u7528 PHP \u7de8\u5beb\u7db2\u8def\u7a0b\u662f\u5f88\u65b9\u4fbf\u7684\uff0c\u56e0\u70ba\u5f88\u591a\u7db2\u8def\u529f\u80fd\u90fd\u5df2\u7d93\u5167\u7f6e\u3002<br \/>\u5176\u4e2d\u4e00\u6a23\u65b9\u4fbf\u7684\u6771\u897f\u5c31\u662f Session \u3002<br \/>\u5229\u7528 Session \u53ef\u4ee5\u7db2\u9801\u4e4b\u9593\u50b3\u9001\u8cc7\u6599\u800c\u4e0d\u7528\u64d4\u5fc3\u7d66\u4f7f\u7528\u8005\u5bdf\u89ba\uff08\u56e0\u70ba\u90fd\u5728\u4f3a\u670d\u5668\u90a3\u908a\u9032\u884c\uff09\uff0c\u751a\u81f3\u9023\u4e00\u6574\u500b\u7269\u4ef6\uff08Object\uff09\u90fd\u53ef\u4ee5\u50b3\u904e\u53bb\u3002<br \/><!--more--><br \/>\u4e0d\u904e\u7531\u65bc\u7269\u672c\u8eab\u53ef\u4ee5\u542b\u6709\u4e8c\u9032\u4f4d\uff08Binary\uff09\u7684\u8cc7\u6599\uff0c\u6240\u4ee5\u5148\u8981\u7d93\u904e serialize \u7684\u7a0b\u5e8f\uff0c\u7136\u5f8c\u518d\u5728\u76ee\u6a19\u9801\u9762 unserialize \u4ee5\u53d6\u5f97\u7269\u4ef6\u3002<br \/>\u4f46\u4eca\u5929\u9047\u5230\u4e00\u500b\u554f\u984c\uff0c\u5728\u63a5\u6536\u9801\u9762\u7684\u7269\u4ef6 unserialize \u4e4b\u5f8c\uff0c\u5168\u90e8\u8b8a\u6210 INCOMPLETE OBJECT \uff0c\u90a3\u6839\u672c\u4e0d\u80fd\u4f7f\u7528\u3002<br \/>\u539f\u4f86\uff0c\u53ea\u662f\u72af\u4e86\u4e00\u500b\u5f88\u57fa\u672c\u7684\u932f\u8aa4\uff1a<br \/><coolcode><br \/>\/\/ \u50b3\u9001\u4e00\u65b9<br \/>session_start();<br \/>class obj{<br \/>  function obj(){};<br \/>}<br \/>$object = new obj();<br \/>$_SESSION&#91;&#039;object&#039;&#93; = serialize($object);<\/p>\n<p>\/\/ \u63a5\u6536\u4e00\u65b9<br \/>session_start();<br \/>$object = unserialize($_SESSION&#91;&#039;object&#039;&#93;);<br \/><\/coolcode><\/p>\n<p>\u554f\u984c\u51fa\u5728\u90a3\uff1f<\/p>\n<p>\u5176\u5be6\u5f88\u7c21\u55ae\uff0e\uff0e\uff0e\uff0e<br \/><coolcode><br \/>session_start();<br \/>class obj{<br \/>  function obj(){};<br \/>}<\/p>\n<p>$object = unserialize($_SESSION&#91;&#039;object&#039;&#93;);<br \/><\/coolcode><\/p>\n<p>\u53ea\u8981\u5728\u9084\u539f\u7269\u4ef6\u524d\u8a02\u7fa9\u7269\u4ef6\u5c31\u597d\u4e86\uff0e\uff0e\uff0e<br \/>\u5c31\u9019\u500b\u5c0f\u5c0f\u7684\u5931\u8aa4\uff0c\u5bb3\u6211\u6d6a\u8cbb\u4e86\u500b\u591a\u5c0f\u6642\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528 PHP \u7de8\u5beb\u7db2\u8def\u7a0b\u662f\u5f88\u65b9\u4fbf\u7684\uff0c\u56e0\u70ba\u5f88\u591a\u7db2\u8def\u529f\u80fd\u90fd\u5df2\u7d93\u5167\u7f6e\u3002\u5176\u4e2d\u4e00\u6a23\u65b9\u4fbf\u7684\u6771\u897f\u5c31\u662f Session \u3002\u5229\u7528 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.lmf.idv.hk\/?p=78\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008PHP: unserialize object \u4e4b\u5f8c\u5f97\u5230 INCOMPLETE OBJECT?\u3009<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[7],"tags":[49],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3E7Rv-1g","_links":{"self":[{"href":"https:\/\/blog.lmf.idv.hk\/index.php?rest_route=\/wp\/v2\/posts\/78"}],"collection":[{"href":"https:\/\/blog.lmf.idv.hk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.lmf.idv.hk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lmf.idv.hk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lmf.idv.hk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=78"}],"version-history":[{"count":0,"href":"https:\/\/blog.lmf.idv.hk\/index.php?rest_route=\/wp\/v2\/posts\/78\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.lmf.idv.hk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lmf.idv.hk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lmf.idv.hk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}