SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2011
    Location
    Northern Ireland
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Disable PHP strict standards warnings in MAMP?

    Does anyone know how to turn off the strict standards warnings when using MAMP?

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,608
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Why would you want to do that? Those warnings are letting you know which commands in your code will break when the next version of PHP is released.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2011
    Location
    Northern Ireland
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because i am working with an MVC that another developer wrote. I'm just using it to get used to the framework, and as such strict standards warnings appearing at the top of the rendered view is highly annoying. The developer is looking into whats causing the errors, but in the mean time i would like to be able to explore without seeing them

  4. #4
    SitePoint Enthusiast
    Join Date
    Dec 2011
    Location
    Northern Ireland
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The warning that appears is

    Strict Standards: Declaration of db::connect() should be compatible with mysqli::connect($host = NULL, $user = NULL, $password = NULL, $database = NULL, $port = NULL, $socket = NULL) in /Applications/MAMP/htdocs/library/classes/database.php on line 258

    However line 258 in that file is the end of the script. In the mean time it would be nice to be able to hide this

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,622
    Mentioned
    413 Post(s)
    Tagged
    7 Thread(s)
    You can edit the php.ini file, but it can be tricky to work out where that is. See if this helps: http://serverfault.com/questions/235...rror-reporting

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,608
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Zany90 View Post
    The warning that appears is

    Strict Standards: Declaration of db::connect() should be compatible with mysqli::connect($host = NULL, $user = NULL, $password = NULL, $database = NULL, $port = NULL, $socket = NULL) in /Applications/MAMP/htdocs/library/classes/database.php on line 258

    However line 258 in that file is the end of the script. In the mean time it would be nice to be able to hide this
    So the error wasn't detected until the end of the file was reached. This means that you need to search back through the file to see where db::connect() is declared in order to correct the way it works so that it will continue to work in PHP 6 and does not continue to rely on things that have been obsolete since PHP 4.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  7. #7
    SitePoint Evangelist
    Join Date
    Oct 2005
    Location
    Michigan, USA
    Posts
    434
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure about the particulars of MAMP so I can't help you there, but I'll defend you a little. I have strict off. I found that strict was unexpectedly too strict when we turned it on for our project. Here is an example of valid code which gave similar warnings.

    PHP Code:
    class Something_Else extends Something {}

    class 
    {
      public function 
    do_itSomething $something ) {}
    }

    class 
    extends {
      public function 
    do_itSomething_Else $something ) {}

    It complained that b::do_it needs to be declared to take a Something object. I'm not going to make my code unnecessarily less specific just to pass a standards check.
    - Robert


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •