php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #14405 strict type control ability
Submitted: 2001-12-10 10:38 UTC Modified: 2010-12-29 11:53 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: foobardotcom at poczta dot onet dot pl Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 4.1.0 OS: all
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
37 + 7 = ?
Subscribe to this entry?

 
 [2001-12-10 10:38 UTC] foobardotcom at poczta dot onet dot pl
Now:

define("E_TYPE", "Invalid type of argument");
function dbexec($connObject, $query) {
  if (is_object($connObject)) {
    if (get_class($connObject) == "dbconn") {
      if (is_string($query)) {
        return $connObject->execute($query);
      } else {
        trigger_error(E_TYPE, E_USER_ERROR);
      }
    } else {
      trigger_error(E_TYPE, E_USER_ERROR);
    }
  } else {
    trigger_error(E_TYPE, E_USER_ERROR);
  }
}

I want to be:

function dbexec((dbconn) $connObject, (string) $query) {
  return $connObject->execute($query);
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-29 11:53 UTC] jani@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2010-12-29 11:53 UTC] jani@php.net
See http://wiki.php.net/rfc/typechecking for more information.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 22:01:27 2024 UTC