|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #74578 Sample code error
Submitted: 2017-05-12 07:41 UTC Modified: 2017-05-12 07:48 UTC
From: cnlyzy at qq dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 7.1.5 OS: windows10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
22 + 30 = ?
Subscribe to this entry?

 [2017-05-12 07:41 UTC] cnlyzy at qq dot com
From manual page:

$e->errorMessage(); in the sample code; does not exist

Test script:
try {
    $mysqli = new mysqli('','uesr','password','testDB');
    echo 'connect success';
} catch (Exception $e) {
    echo 'ERROR:'.$e->getMessage();

Expected result:
Capture the exception of mysqli

Actual result:
Capture the exception of mysqli


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-12 07:48 UTC]
-Status: Open +Status: Not a bug
 [2017-05-12 07:48 UTC]
The only sample code that uses that is a user supplied note and *not* in the actual manual.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Oct 22 10:01:24 2020 UTC