php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74413 Wrong reflection on SQLite3::enableExceptions
Submitted: 2017-04-11 10:50 UTC Modified: -
From: fabien dot villepinte at gmail dot com Assigned:
Status: Closed Package: SQLite related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2017-04-11 10:50 UTC] fabien dot villepinte at gmail dot com
Description:
------------
The parameter of SQLite3::enableExceptions is optional (see: http://php.net/manual/fr/sqlite3.enableexceptions.php ), but it is described as required by reflection.

Test script:
---------------
<?php

$rm = new ReflectionMethod(SQLite3::class, "enableExceptions");
printf("%d\n%d\n", $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters());
foreach ($rm->getParameters() as $param) {
    printf("Parameter #%d %s OPTIONAL\n", $param->getPosition(), $param->isOptional() ? "IS" : "IS NOT");
}

Expected result:
----------------
1
0
Parameter #0 IS OPTIONAL

Actual result:
--------------
1
1
Parameter #0 IS NOT OPTIONAL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-11 11:17 UTC] krakjoe@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b74b325aea79b281aff5369d461f5e2d748b0cfc
Log: fixed bug #74413 wrong reflection on SQLite3::enableExceptions
 [2017-04-11 11:17 UTC] krakjoe@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 05:01:29 2024 UTC