RE: [PHP] function issues in a class

From: Date: Tue, 06 Nov 2001 03:59:09 +0000
Subject: RE: [PHP] function issues in a class
Groups: php.general 
Request: Send a blank email to php-general+get-73535@lists.php.net to get a copy of this message
What happens if you break the line into two. ie. eg.: $ndx = substr($atemp, 0, 3); $month = $themonths[$ndx]; ?? Martin T -----Original Message----- From: Garett Nell [mailto:grn5@spam.cornell.edu] Sent: Tuesday, November 06, 2001 2:53 PM To: php-general@lists.php.net Subject: [PHP] function issues in a class Why is it that when I call an outside function (say a string routine like substr) from a class I've made, I'll always get an Internal Server Error (#500). That doesn't make much sense... Snippet: class xml { function tag_close($parser,$tag) { if ($tag == "ARTICLE") { if ($this->xmlInArticle) { $this->news[$this->newscount]->theURL = ($this->xmlURL); $atemp = ($this->xmlDate); $themonths = array('January'=>1, 'February'=>2, 'March'=>3, 'April'=>4, 'May'=>5, 'June'=>6, 'July'=>7, 'August'=>8, 'September'=>9, 'October'=>10, 'November'=>11, 'December'=>12, 'Jan'=>1, 'Feb'=>2, 'Mar'=>3, 'Apr'=>4, 'May'=>5, 'Jun'=>6, 'Jul'=>7, 'Aug'=>8, 'Sep'=>9, 'Oct'=>10, 'Nov'=>11, 'Dec'=>12); $month = $themonths[substr($atemp,0,3)]; ... } Runs fine with the substr line remmed... otherwise, Internal Server Error. Code works fine outside a class. Help? -- Garett Nell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#73535) next »