rfc:jsonserializable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
rfc:jsonserializable [2015/07/13 12:59] – created decanusrfc:jsonserializable [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== PHP RFC: JsonSerializable New Interface method Proposa ======+====== PHP RFC: JsonSerializable New Interface method Proposal ======
   * Version: 0.9   * Version: 0.9
-  * Date: 2013-02-24 (use today's date here)+  * Date: 2015-07-13
   * Author: Dean Eigenmann, dean.eigenmann@icloud.com   * Author: Dean Eigenmann, dean.eigenmann@icloud.com
   * Status: Under Discussion   * Status: Under Discussion
Line 23: Line 23:
 </code> </code>
  
-Within the class User there would then be function that recieves the decoded JSON.+Within the class User there would then be function that receives the decoded JSON.
  
 <code php> <code php>
Line 35: Line 35:
  
 Unlike the ArrayObject, an object like this would not be accessable like an array, and would have an easier support of private variables as the setters are in the class itself. The interface would just ensure that a json_decode would trigger the jsonUnserialize method with the json. Unlike the ArrayObject, an object like this would not be accessable like an array, and would have an easier support of private variables as the setters are in the class itself. The interface would just ensure that a json_decode would trigger the jsonUnserialize method with the json.
 +
 +===== Updated Proposal =====
 +
 +Due to discussions, it seems the best way to implement this method is with a new function.
 +
 +<code php>
 +
 +$user = json_decode_to_class($json, User::class);
 +
 +</code>
 +
 +===== Vote ======
 +<doodle title="jsonserializable" auth="decanus" voteType="single" closed="false">
 +   * Yes
 +   * No
 +</doodle>
 +
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
 next PHP 7.x next PHP 7.x
rfc/jsonserializable.1436792367.txt.gz · Last modified: 2017/09/22 13:28 (external edit)