What does this PHP error mean?

Discussion in 'PHP' started by Ruddo, Oct 10, 2009.

  1. #1
    I got this error when trying to edit and update a post on wordpress

    Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/root/public_html/wp-content/plugins/re/re.php on line 1648
    
    Warning: Invalid argument supplied for foreach() in /home/ruoot/public_html/wp-content/plugins/re/re.php on line 1650
    Code (markup):
    What does this mean and how can I fix it?
     
    Ruddo, Oct 10, 2009 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It means that the argument being given on line 1650 in the array_keys() isn't an array, and it needs to be
     
    JAY6390, Oct 10, 2009 IP
  3. Ruddo

    Ruddo Member

    Messages:
    821
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    43
    #3
    The same file was working a few days ago and all of a sudden I get the error today
     
    Ruddo, Oct 10, 2009 IP
  4. orionoreo

    orionoreo Peon

    Messages:
    145
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if the code hasn't been altered then there are input errors... you should have a way to verify input before processing
     
    orionoreo, Oct 11, 2009 IP
  5. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #5
    it all depends on where the array is getting its data from. it could be that it expects you to have at least one option for something and you don't. Say for instance it works off all the wp links for your sidebar and you delete them, then the array is going to be empty since you have no links

    Just because code breaks doesn't necessarily mean it is the code that has broken it, the input is just as crucial
     
    JAY6390, Oct 11, 2009 IP