php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cnlyzy at qq dot com
New email:
PHP Version: OS:

 

 [2017-05-12 07:41 UTC] cnlyzy at qq dot com
Description:
------------
---
From manual page: http://www.php.net/class.mysqli-sql-exception
---

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

Test script:
---------------
<?php
mysqli_report(MYSQLI_REPORT_STRICT);
try {
    $mysqli = new mysqli('127.0.0.1','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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-12 07:48 UTC] peehaa@php.net
-Status: Open +Status: Not a bug
 [2017-05-12 07:48 UTC] peehaa@php.net
The only sample code that uses that is a user supplied note and *not* in the actual manual.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 12:01:36 2025 UTC