note 48612 deleted from language.functions by tularis

From: Date: Sat, 01 Jan 2005 22:22:34 +0000
Subject: note 48612 deleted from language.functions by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-82548@lists.php.net to get a copy of this message
Note Submitter: nothingcanfulfill at gmail dot com ---- It seems as if, with the coming of version 5, PHP no longer supports functions split over multiple blocks of code. *lines are numbered* 01: <?php 02: function example($str) { 03: ?> 04: <B>The string passed was "<?php echo($str); ?>".</B> 05: <?php 06: } 07: 08: example("Hello, world!"); 09: ?> The above code would provide the following error: <BR /><B>Parse error</B>: parse error, unexpected '}' in <B>/your/document/root/some/folders/file.php5</B> on line <B>6</B><BR /> Although the above example is very basic, making it pointless to escape from the function to print it out, imagine a case where you have a large chunk of code where there would be a lot to escape for only a few variables if you wanted to simply echo it. ---- Reason: spam

« previous php.notes (#82548) next »