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
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: foobardotcom at poczta dot onet dot pl
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 21:01:30 2025 UTC