|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80488 ReflectionParameter->getDefaultValue() throws for dbase_create()
Submitted: 2020-12-06 17:37 UTC Modified: 2020-12-06 23:25 UTC
From: Assigned: cmb (profile)
Status: Closed Package: dbase (PECL)
PHP Version: 8.0.0 OS:
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:
35 - 7 = ?
Subscribe to this entry?

 [2020-12-06 17:37 UTC]
------------ references the C constant name `"DBH_TYPE_NORMAL"`, but should instead reference the PHP constant `"DBASE_TYPE_NORMAL"`

in dbase.c:

ERROR: Error: Undefined constant "DBH_TYPE_NORMAL" is seen when calling ReflectionParameter->getDefaultValue() for the parameter of `dbase_create`

See - possibly outdated, but 

Test script:
var_export((new ReflectionFunction('dbase_create'))->getParameters()[2]->getDefaultValue());
Warning: Uncaught Error: Undefined constant "DBH_TYPE_NORMAL" in php shell code:1
Stack trace:
#0 php shell code(1): ReflectionParameter->getDefaultValue()
#1 {main}
  thrown in php shell code on line 1

Expected result:
Returns the default value

Actual result:
Throws an Error


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-06 17:40 UTC]
I misread the code - it should instead reference the PHP constant `"DBASE_TYPE_DBASE"` as mentioned in, not NORMAL
 [2020-12-06 17:40 UTC]
-Assigned To: +Assigned To: cmb
 [2020-12-06 23:20 UTC]
-Status: Assigned +Status: Verified
 [2020-12-06 23:20 UTC]
Thanks for reporting!
 [2020-12-06 23:21 UTC]
Automatic comment from SVN on behalf of cmb
Log: Fix #80488: ReflectionParameter->getDefaultValue() throws for dbase_create()
 [2020-12-06 23:25 UTC]
-Status: Verified +Status: Closed
 [2021-04-06 10:18 UTC]
Automatic comment on behalf of 
Log: Fix #80488: ReflectionParameter->getDefaultValue() throws for dbase_create()
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 28 23:01:31 2024 UTC