Re: Ternary operators

From: Date: Thu, 16 Feb 2006 09:40:27 +0000
Subject: Re: Ternary operators
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-230525@lists.php.net to get a copy of this message
sorry - I have had a php5 CLI at hand for so long I forgot that 'php -r' is not available in v4. that said the 'php -a' option also works (although I always find the interactive mode odd to work with) Kevin Kinsey wrote:
Carl Furst wrote:
Well, I tried something simple... $ php -r 'echo "hello world\n";' Error in argument 1, char 2: option not found r Error in argument 1, char 2: option not found r Usage: php [-q] [-h] [-s] [-v] [-i] [-f <file>]
      php <file> [args...]
 -a               Run interactively
 -C               Do not chdir to the script's directory
-c <path>|<file> Look for php.ini file in this directory
 -n               No php.ini file will be used
 -d foo[=bar]     Define INI entry foo with value 'bar'
 -e               Generate extended information for debugger/profiler
 -f <file>        Parse <file>.  Implies `-q'
 -h               This help
 -i               PHP information
 -l               Syntax check only (lint)
 -m               Show compiled in modules
 -q               Quiet-mode.  Suppress HTTP Header output.
 -s               Display colour syntax highlighted source.
 -v               Version number
 -w               Display source with stripped comments and whitespace.
 -z <file>        Load Zend extension <file>.
This means my install can't run inline stuff like this? Guess it wasn't set up to do that. So no I won't say that I will use php -r to test anything.. lol :)
Actually run "php -v" and let's see if it's not version 4 ... in which there is no "r" option available IIRC ....
please say your going start using "php -r" to test stuff like this. :-)
Not unless he upgrades, apparently. Still, not too hard to open an editor, code a tiny script, and run it from the CLI in either PHP4 or PHP5. Let's all learn to test things, eh? Kevin Kinsey


« previous php.general (#230525) next »