|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-06-22 19:05 UTC] tony2001@php.net
[2006-06-22 21:17 UTC] colder@php.net
[2006-07-18 11:27 UTC] colder@php.net
[2020-02-07 06:11 UTC] phpdocbot@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 20 06:00:01 2025 UTC |
Description: ------------ I cannot seem to initialize a multi-line assoc array in the declaration part of a class. The work around I am using is to do it in the constructor. If this is the normal behavior it problaly should be stated in the manual. thanks frank Reproduce code: --------------- <?php class RDBMSLoginDataSource { private $_dsn; private $_mdb2 = 2; private $_sql = array( 'isUserLocked'=>"SELECT users.is_locked FROM users where ". "user_name='$user' LOCK IN SHARE MODE", 'userLogin' =>"SELECT users.user_name,COUNT(*) FROM " . "users WHERE users.user_name='$user' && ". "users.pass='$pass' GROUP BY " . "users.user_name LOCK IN SHARE MODE" ); } ?> Expected result: ---------------- na Actual result: -------------- Parse error: syntax error, unexpected '.', expecting ')' in /home/fmadero/public_html/classes/RDBMSLoginDataSource.php on line 8