Jump to content

Search the Community

Showing results for tags '#php #error'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hello everyone. Sorry for my bad English, i am from east Europe. So working on my site i have this error, evertything should work but i do not understand what is wrong. I am just learning php and working with code and script. Maybe someone have a solution for noob like me. Error: -[RECOVERABLE ERROR]-[2016.08.18 в (14:26:06)]{1} Message: Argument 5 passed to ShipType::__construct() must be of the type array, integer given, called in /calculateAttack.php on line 417 and defined File: /models/ShipType.php Line: 70 URL: Debug Backtrace: The ShipType.php file: public function __construct($id, $count, $rf, $shield, array $cost, $power, $weapons_tech = null, $shields_tech = null, $armour_tech = null) { parent::__construct($id, 0); $this->rf = $rf; $this->lastShots = 0; $this->lastShipHit = 0; $this->cost = $cost; $this->originalShield = $shield; $this->originalPower = $power; $this->singleShield = $shield; $this->singleLife = COST_TO_ARMOUR * array_sum($cost); $this->singlePower = $power; $this->increment($count); $this->setWeaponsTech($weapons_tech); $this->setArmourTech($armour_tech); $this->setShieldsTech($shields_tech); } This is the line 70 in ShipType.php file. And the error is given by the array $cost! public function __construct($id, $count, $rf, $shield, array $cost, $power, $weapons_tech = null, $shields_tech = null, $armour_tech = null) { And the /calculateAttack.php line 417: if ($id > ID_MIN_SHIPS && $id < ID_MAX_SHIPS) { return new Ship($id, $count, $rf, $shield, $restoreShields, $cost, $power, NULL, NULL, NULL, $rig, $skils); } return new Defense($id, $count, $rf, $shield, $restoreShields, $cost, $power, NULL, NULL, NULL, $rig, $skils); } And this is line 417 what give error. return new Ship($id, $count, $rf, $shield, $restoreShields, $cost, $power, NULL, NULL, NULL, $rig, $skils); Hope someone will help me figure this out. Thanx!
×
×
  • Create New...