I know nothing about php but what is wrong with this bit of code

Discussion in 'PHP' started by burghboy, Apr 21, 2008.

  1. #1
    
    
    * Add a 2-D array of messages by lang. Useful for extensions.
    	 *
    	 * @param array $messages The array to be added
    	 */
    	function addMessagesByLang( $messages ) {
    		wfProfileIn( __METHOD__ );
    		foreach ( $messages as $key => $value ) {
    			$this->addMessages( $value, $key );
    		}
    		wfProfileOut( __METHOD__ );
    	}
    
    	/**
    
    Code (markup):

     
    burghboy, Apr 21, 2008 IP
  2. Rory M

    Rory M Peon

    Messages:
    1,020
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You are missing a / before the first asterisk, so the comment is being treated as code to be excecuted
     
    Rory M, Apr 21, 2008 IP
  3. Martindale

    Martindale Well-Known Member

    Messages:
    440
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Also, when posting to a forum, you'll want to use the
     tag.  Just put it around your code, so it looks like this:
    
    [code]* Add a 2-D array of messages by lang. Useful for extensions.
    *
    * @param array $messages The array to be added
    */
    function addMessagesByLang( $messages ) {
    wfProfileIn( __METHOD__ );
    foreach ( $messages as $key => $value ) {
    $this->addMessages( $value, $key );
    }
    wfProfileOut( __METHOD__ );
    }
    
    /**
    Code (markup):
     
    Martindale, Apr 21, 2008 IP