Comments (12)
From @wapmorgan on February 20, 2014 19:52
Agree.
from php-zephir-parser.
From @lstrojny on February 20, 2014 23:34
Wouldn’t proper destructuring be more desirable?
left, right = getimagesize(...}
from php-zephir-parser.
From @nkt on February 21, 2014 0:1
@lstrojny 👍
I think there is no o need to add new keyword.
var a, b, c;
let c = [1, 2];
let a, b = c;
from php-zephir-parser.
From @nkt on September 7, 2014 13:20
So, i've added support in parser for syntax like:
let [a, b, c] = arr;
@phalcon, @ovr, @mruz what do you think about this syntax?
I've tried to add support for
let a, b, c = arr;
But failed.
from php-zephir-parser.
From @ovr on September 7, 2014 13:31
Vote for
let a, b, c = arr;
from php-zephir-parser.
From @nkt on September 7, 2014 13:33
@ovr I agree with your vote, but do u know how to add this in parser?
from php-zephir-parser.
From @ovr on September 7, 2014 13:40
@nkt
Nope 😄
from php-zephir-parser.
From @mruz on September 7, 2014 15:5
let [a, b, c] = arr;
Is enough for me.
from php-zephir-parser.
From @thaJeztah on September 7, 2014 15:58
I may actually prefer let [a, b, c] = arr
.
It may be just me, but I would (at a glance) interpret
let a, b, c = arr
as
let a = arr; let b = arr; let c = arr;
The extra brackets would hint at 'something extra is performed here' when scanning code.
from php-zephir-parser.
From @phalcon on September 7, 2014 19:49
I'd prefer
let (a, b, c) = arr;
We can use this syntax in the future to assign the same value to every index in the array:
let [0, 1, 2] = null;
from php-zephir-parser.
From @aschwin on November 26, 2014 15:52
Is there a decision already for this issue?
from php-zephir-parser.
Just want to add my bit..
Stolen from ECMAScript 6 (JS) :
http://es6-features.org/#ArrayMatching
let [item0, , item2] = arr; // => let item0 = arr[0], item[2] = arr;
http://es6-features.org/#ObjectMatchingDeepMatching
let { key1, key2{subkey} } = someObject; // => let key1 = someObject->key1, key2 = someObject->key2->subkey;
let { key1, key2[subIndex] } = someObject; // => let key1 = someObject->key1, key2 = someObject->key2["subIndex"];
That's if you want to reinvent the wheel, then please stay as close as some standardized language.
Otherwise stick as close as PHP as possible (using parenthesis) :
let [a, , c] = arr;
Edit: bracket []
is the new standard of PHP7
from php-zephir-parser.
Related Issues (20)
- need zephir to compile phalcon 4.x in Raspbian 10
- Publish extension on PECL HOT 3
- Grammar railroad diagram
- Migrate from disabled AppVeyor to Github Actions
- Cant concatenate strings HOT 1
- PHP 8.1 support
- [NFR] Add support for `yield` statement HOT 1
- [NFR] Add support for `mixed` return type (PHP >= 8.0)
- Rename extension name from `Zephir Parser` to `zephir_parser`
- Please provides tests in the pecl archive HOT 5
- Unify windows release assets with PECL ones
- Missing and bad files in archive HOT 1
- The Zephir Parser extension is outdated. HOT 3
- php7.2 An error occurred HOT 3
- Add support of `false` return type
- The Zephir Parser extension is outdated. HOT 1
- PHP 8.2 support
- Please add the TS version of the dll libraries HOT 1
- on windows 11 subsystem ubuntu got error profiling:/home/runner:Cannot create directory HOT 2
- PHP 8.3 support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-zephir-parser.