rfc:var-export-array-syntax
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:var-export-array-syntax [2020/03/29 17:56] – googleguy | rfc:var-export-array-syntax [2020/03/30 16:02] – googleguy | ||
---|---|---|---|
Line 12: | Line 12: | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | Instead of <code php> | + | Instead of |
+ | |||
+ | <code php> | ||
+ | |||
+ | '' | ||
+ | |||
+ | <code php>[1, 2, 3]</ | ||
+ | |||
+ | This will effect things like '' | ||
+ | |||
+ | So the following changes are also in effect: | ||
+ | |||
+ | <code php> | ||
+ | $obj = new stdClass; | ||
+ | $obj-> | ||
+ | $obj-> | ||
+ | |||
+ | var_export($obj); | ||
+ | |||
+ | /* | ||
+ | Gives us: | ||
+ | (object) array( | ||
+ | ' | ||
+ | ' | ||
+ | ) | ||
+ | |||
+ | With the new change it would be | ||
+ | |||
+ | (object) [ | ||
+ | ' | ||
+ | ' | ||
+ | ] | ||
+ | */ | ||
+ | </ | ||
+ | |||
+ | The same happens for classes: | ||
+ | |||
+ | <code php> | ||
+ | class Foo { | ||
+ | public $bar = " | ||
+ | } | ||
+ | |||
+ | var_export(new Foo); | ||
+ | |||
+ | /* | ||
+ | Gives us: | ||
+ | Foo:: | ||
+ | ' | ||
+ | )) | ||
+ | |||
+ | With the changes it would be: | ||
+ | Foo:: | ||
+ | ' | ||
+ | ]) | ||
+ | */ | ||
+ | </ | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
There shouldn' | There shouldn' | ||
+ | |||
+ | However, there are some tests that test the output of '' | ||
+ | |||
+ | I hope that's clear. | ||
+ | |||
+ | In the event that this RFC is voted through I will, however, be updating these tests. | ||
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
Line 39: | Line 100: | ||
===== Patches and Tests ===== | ===== Patches and Tests ===== | ||
- | The change only requires changing two lines in '' | + | The change only requires changing two lines in '' |
+ | |||
+ | See https:// | ||
===== Implementation ===== | ===== Implementation ===== | ||
Line 45: | Line 108: | ||
===== References ===== | ===== References ===== | ||
https:// | https:// | ||
+ | |||
https:// | https:// | ||
===== Rejected Features ===== | ===== Rejected Features ===== | ||
rfc/var-export-array-syntax.txt · Last modified: 2020/04/10 09:24 by guilliamxavier