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:48] – googleguy | rfc:var-export-array-syntax [2020/03/30 02:52] – googleguy | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2020-03-29 | * Date: 2020-03-29 | ||
* Author: Sherif Ramadan, googleguy@php.net | * Author: Sherif Ramadan, googleguy@php.net | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
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 ===== | ||
Line 45: | Line 100: | ||
===== References ===== | ===== References ===== | ||
https:// | https:// | ||
+ | https:// | ||
===== Rejected Features ===== | ===== Rejected Features ===== | ||
rfc/var-export-array-syntax.txt · Last modified: 2020/04/10 09:24 by guilliamxavier