-
Notifications
You must be signed in to change notification settings - Fork 724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add array destructuring example to language.types.array #19
Conversation
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347412 c90b9560-bf6c-de11-be94-00142212c4b1
Patch provided by Michal Brzuchalski git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347416 c90b9560-bf6c-de11-be94-00142212c4b1
… assume marking this as optional is incorrect. If this is not the case feel free to revert the change. - girgias -------------- Clarifying the type declaration for the $idx parameter. I encountered a Fatal error: PHP Fatal error: Uncaught TypeError: Argument 1 passed to ParleParser::sigil() must be of the type integer, array given In PHPStorm, looking at the stub for Parle/Parser.php it declares the type of $idx as an array instead of int. I'm planning to submit a patch to JetBrains once this documentation has been updated :) -- Provided by anonymous 97393 (me@rowles.ch) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347417 c90b9560-bf6c-de11-be94-00142212c4b1
Provided by anonymous 75058 (michal.brzuchalski@gmail.com) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347419 c90b9560-bf6c-de11-be94-00142212c4b1
Provided by anonymous 75058 (michal.brzuchalski@gmail.com) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347420 c90b9560-bf6c-de11-be94-00142212c4b1
…atch the same style guide. -- Provided by anonymous 75058 (michal.brzuchalski@gmail.com) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347421 c90b9560-bf6c-de11-be94-00142212c4b1
…r between file extensions in the list. Closes #67701 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347422 c90b9560-bf6c-de11-be94-00142212c4b1
…nown encoding value is passed in as the 2nd parameter. -- Provided by anonymous 96370 (mbniebergall@gmail.com) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347424 c90b9560-bf6c-de11-be94-00142212c4b1
…revent xss. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347426 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347430 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347431 c90b9560-bf6c-de11-be94-00142212c4b1
For all practical purposes, the default value is actually an empty array. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347436 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347439 c90b9560-bf6c-de11-be94-00142212c4b1
This integrates user note 13441. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347443 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347449 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347452 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347459 c90b9560-bf6c-de11-be94-00142212c4b1
…ple showing that array-map returns the original array if only one array is provided with a NULL callback. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347462 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347465 c90b9560-bf6c-de11-be94-00142212c4b1
Provided by sergey git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347472 c90b9560-bf6c-de11-be94-00142212c4b1
… confusion git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347473 c90b9560-bf6c-de11-be94-00142212c4b1
…rror() git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347475 c90b9560-bf6c-de11-be94-00142212c4b1
…ative precision). Added more information to the return value of the function. Added a specific example demonstrating various precision on a float. Improved other examples. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347481 c90b9560-bf6c-de11-be94-00142212c4b1
-- Provided by anonymous 98113 (michel@michelmaas.com) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347486 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347493 c90b9560-bf6c-de11-be94-00142212c4b1
Patch provided by anonymous user. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347496 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347499 c90b9560-bf6c-de11-be94-00142212c4b1
c.f. php/php-src@77cf3d7 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347500 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347501 c90b9560-bf6c-de11-be94-00142212c4b1
…unctions return an empty array if called without any arguments. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347508 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348273 c90b9560-bf6c-de11-be94-00142212c4b1
This addresses several user notes. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348286 c90b9560-bf6c-de11-be94-00142212c4b1
Since the latter is not marked as being unmaintained on the respective PECL page, we refrain from adding a deprecated warning (yet). This integrates user note 124378. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348288 c90b9560-bf6c-de11-be94-00142212c4b1
Patch by BenMorel. Closes #16. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348296 c90b9560-bf6c-de11-be94-00142212c4b1
Patch by BenMorel. Closes #17. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348297 c90b9560-bf6c-de11-be94-00142212c4b1
strip_tags() is *not* a security feature. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348311 c90b9560-bf6c-de11-be94-00142212c4b1
See <https://news-web.php.net/php.doc.cvs/17002>. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348313 c90b9560-bf6c-de11-be94-00142212c4b1
Cf. <https://news-web.php.net/php.doc.cvs/17007>. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348314 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348315 c90b9560-bf6c-de11-be94-00142212c4b1
The function works as getter and setter, respectively. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348317 c90b9560-bf6c-de11-be94-00142212c4b1
This integrates user note 124413. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348333 c90b9560-bf6c-de11-be94-00142212c4b1
Integrates user note 124350. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348334 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348336 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348339 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348340 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348349 c90b9560-bf6c-de11-be94-00142212c4b1
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@348353 c90b9560-bf6c-de11-be94-00142212c4b1
@salathe Is that a reasonable place to put this? |
I would prefer a new page on the topic of destructuring (though I'm not sure the best place for that), which can then be referenced from the array-related pages and other pages like However, in the interest of just having this written down somewhere (other than the migration guide, or user contributed notes) being better than nowhere, including the proposed section in the array page would be a good starting point. |
Agreed, the topic is large enough to warrant a separate page in my opinion as well. This PR is mainly to just have it visible somewhere as stated. My inspiration was a PHP veteran using latest PHP saying "wtf since when has that been possible" when I showed them an example, and they said no amount of search returned results in the manual for it. Is the position on the page OK or would it work better somewhere else? |
@rask this PR has gotten all out of shape due to the forced pushes on the php/doc-en master branch. Is this still something you want to pursue, or should we just lay this PR to rest? |
Hello. Sorry, the new GitHub notification center is seemingly broken and I can't see any notifications anywhere. Or maybe I just don't understand how it works haha. I stumbled on this on the GitHub frontpage, which I see maybe once a year. I'll see if I can remold this to fit the new base. |
You know what, the base has changed so much a simple master to master rebase is giving me tons and tons of merge conflcts for no good reason. I shall refork and redo the commit manually and create a new PR. |
New one at #145. |
I'm not sure if PRs are accepted here, but here goes:
Simple example of the PHP 7.1 array destructuring feature.
There seems to be no official manual page/section for this, so adding it here with the rest of the array syntax-y things.