function call before declaration

From: Date: Tue, 07 Oct 2003 11:03:17 +0000
Subject: function call before declaration
Groups: php.general 
Request: Send a blank email to php-general+get-165287@lists.php.net to get a copy of this message
Hi! I got a problem with functions which I call before they're defined. I get the error message: Fatal error: Call to undefined function: view() in /daten/www/midgard/cache/62.php on line 470 The code snippet: ----------------8<----------------- switch($argv[0]) { case 'view': view((int)$argv[1]); break; default: view(); break; } // ---------------------------------------------------- function view($mgd_eid = 0) { global $self, $eventtypes; if($mgd_eid) { if(!$event = mgd_get_event($mgd_eid)) die("Ungültige Event-ID"); $start = date(" ... ----------------8<----------------- It worked before (Suse 7.2 php 4.2.0) and now it won't (Debian Woody php 4.1.2) I reckon it should work since php4. Perhaps a misconfiguration? The functions are not conditionally defined! Any Ideas? Thanks in advance! M. Hochstraßer

« previous php.general (#165287) next »