ID: 35932 User updated by: j dot gizmo at aon dot at Reported By: j dot gizmo at aon dot at -Status: Bogus +Status: Open -Bug Type: Documentation problem +Bug Type: PDO related Operating System: Windows 2000 -PHP Version: Irrelevant +PHP Version: 5.1.1 New Comment:
In fact, I just found out that according to the online documentation, the syntax used in the docs is in fact correct. However, the correct syntax does not work on PHP 5.1.1 on Win2K; so it is more a PDO related issue than documentation related. Previous Comments: ------------------------------------------------------------------------ [2006-01-08 16:59:13] [EMAIL PROTECTED] this is not a documentation problem surely. PHP 5 deprecates the use of '=& new' syntax, as objects are always references. Please try with latest PHP 5 version available and if the problem persists, reopen this bug, but not as a documentation problem. ------------------------------------------------------------------------ [2006-01-08 16:52:48] j dot gizmo at aon dot at Description: ------------ In code samples for the PDO object, objects are created with the assignment operator (=) instead of the reference operator (=&). Reproduce code: --------------- //Syntax used in code samples $conn = new PDO( $dsn ); //How it actually works $conn =& new PDO( $dsn ); Expected result: ---------------- The output shown below the corresponding code samples. Actual result: -------------- On windows, the first version doesn't report any errors, however any subsequent calls to methods of $conn results in the following warning: "SQL State [000000] No Error. PDO Constructor was not called." If you use the =& operator (and make $conn a reference to the newly created object) everything works as expected. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35932&edit=1