php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45578 Extending mysqli_stmt "bind_param" method causes strict warning
Submitted: 2008-07-21 10:02 UTC Modified: 2008-07-21 21:08 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: basilio dot vera at softonic dot com Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.2CVS-2008-07-21 OS: Linux RH
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:
MUST BE VALID
Solve the problem:
5 + 6 = ?
Subscribe to this entry?

 
 [2008-07-21 10:02 UTC] basilio dot vera at softonic dot com
Description:
------------
Can't extend the method "bind_param" of the mysqli_stmt class without strict errors.

Through reflection I see that the method declaration has one declared and needed parameter:

-- Parameter #0: { Class: NULL Allows NULL: false Passed to by reference: false Is optional?: no }

What can I do to avoid this notice?

Reproduce code:
---------------
class myTry1 extends mysqli_stmt
{
    public function bind_param()
    {
    }
}
 
class myTry2 extends mysqli_stmt
{
    public function bind_param( $types )
    {
    }
}
 
class myTry3 extends mysqli_stmt
{
    public function bind_param( $types, $var1 )
    {
    }
}
 
class myTry4 extends mysqli_stmt
{
    public function bind_param( $types, &$var1 )
    {
    }
}

Expected result:
----------------
No errors with at least one ot these new classes.

Actual result:
--------------
Strict Notice Declaration of myTry1::bind_param() should be compatible with that of mysqli_stmt::bind_param() in...
Strict Notice Declaration of myTry2::bind_param() should be compatible with that of mysqli_stmt::bind_param() in...
Strict Notice Declaration of myTry3::bind_param() should be compatible with that of mysqli_stmt::bind_param() in...
Strict Notice Declaration of myTry4::bind_param() should be compatible with that of mysqli_stmt::bind_param() in...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-21 16:36 UTC] basilio dot vera at softonic dot com
After test it with the windows zip, I see "PHP Version => 5.2.7-dev" with a phpinfo()...

I'm getting the same errors.


Strict Standards: Declaration of myTry1::bind_param() should be compatible with that of mysqli_stmt::bind_param() in...
Strict Standards: Declaration of myTry2::bind_param() should be compatible with that of mysqli_stmt::bind_param() in...

Strict Standards: Declaration of myTry3::bind_param() should be compatible with that of mysqli_stmt::bind_param() in...

Strict Standards: Declaration of myTry4::bind_param() should be compatible with that of mysqli_stmt::bind_param() in...
 [2008-07-21 16:38 UTC] basilio dot vera at softonic dot com
Obviously you must activate in the error reporting the strict errors.

error_reporting  =  E_ALL | E_STRICT
 [2008-07-21 17:27 UTC] jani@php.net
Please don't change the summary..
 [2008-07-21 21:08 UTC] jani@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See bug #44043
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 21:01:29 2024 UTC