Re: CLI - php shell script worked under php4, breaks under php5

From: Date: Wed, 28 Jun 2006 19:26:33 +0000
Subject: Re: CLI - php shell script worked under php4, breaks under php5
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-238840@lists.php.net to get a copy of this message
On Mon, Jun 26, 2006 at 01:53:31PM +1000, David Tulloh wrote: > > weston@leary2.csoft.net wrote: > > A while back I wrote a little read-eval-print loop that essentially constituted a very > > basic php shell: > > > > http://weston.canncentral.org/misc/phpsh.txt > > > > However, I just recently tried to use this with PHP 5.1.2, and found that it doesn't > > work. > > Works for me, PHP 5.1.4. Perhaps you have some kind of output > buffering enabled. Using the -n command line switch will disable > your php.ini which should stop anything like that. Thank you! It is apparently exactly as you say. :) Adding a -n makes it run just fine. > The syntax error you are getting is caused by not entering > any input. > Your line 23 becomes: > $returnval = eval("return();"); > Return expects some value to be provided, hence the syntax error. Makes sense. Thanks again! -WEston

« previous php.general (#238840) next »