|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-06-03 13:34 UTC] tony2001@php.net
[2005-06-03 13:34 UTC] phpbug at munaw dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
Description: ------------ Hello, As I know, array() should not accept comma after the last element but it does and var_export generates it the same way. If it accepts this syntax, it could be mentioned in the documentation. Reproduce code: --------------- echo phpversion()."\n"; $array = array( '1' => 'one', '2' => 'two', '3' => 'three', // <-comma ); var_export($array); Expected result: ---------------- Parse error saying unexpected '(' or something like this. Actual result: -------------- 4.3.11 array ( 1 => 'one', 2 => 'two', 3 => 'three', )