Recent Notes

Displaying keyword search results 1 - 4
Created by jinx on April 28, 2011 20:52:45    Last update: April 29, 2011 13:27:31
This is normally a syntax error just before some variable. Try some of these: Missing operator before a variable: <?php $a = 'ab'; echo('Missing conca... Missing semicolon at end of line: <?php echo('Missing semicolon at end of lin... Missing ( and ) in for loop: <?php foreach $a as $i { echo "$i\n"; ... Missing keyword before class variable: <?php class A { // should be var $a; ...
Created by jinx on April 28, 2011 21:09:08    Last update: April 28, 2011 21:09:08
PHP global variables are defined outside of functions and classes. They are visible both in the current file and in any included/required files. Also, any global variables defined in required/included files are visible in the current file. But they are not visible in any functions or classes, unless specifically declared global . Test: Create file test.php : <?php ini_set('display_errors', 'stderr'); i... Create file test.inc : <?php echo '[', __FILE__, '] $a . $b = ', $... Run the PHP script in command line: php test.php 2>C:\tmp\stderr.out The result is: [C:\work\test.inc] $a . $b = ab [C:\work\test.p... stderr messages: PHP Notice: Undefined variable: b in C:\work\scra...
Created by Dr. Xi on September 29, 2008 23:05:12    Last update: September 29, 2008 23:06:16
These variables are set or used by the Unix shell to modify its behavior. Variable Description ENV=file Name of script that gets executed at startup; Usually, ENV=$HOME/.kshrc FCEDIT=file Editor used by fc (fix command) command. If $FCEDIT is not defined, use $EDITOR, otherwise use the default (vi or ed). FPATH=dirs Directories to search for function definitions; undefined functions are set via typeset -fu . FPATH is searched when these functions are first referenced. HISTFILE=file File in which to store command history. Default is $HOME/.sh_history for Korn shell, $HOME/.bash_history for Bash. If not set, history is lost after logout. HISTSIZE=n Max number of commands to keep in history. HOME=dir Home directory; set by login from passwd file. IFS='chars' Internal field separators. Default is space, tab, and...
Created by Dr. Xi on September 29, 2008 23:03:40    Last update: September 29, 2008 23:04:08
Variables set automatically by shell: Variable Description $# Number of command-line arguments. $- Options currently in effect (arguments supplied to sh or to set). $? Exit value of last executed command. $$ Process number of current process. $! Process number of last background command. $0 First word; that is, command name. $n Individual arguments on command line (positional parameters). The Bourne shell allows only nine parameters to be referenced directly (n = 1-9); the Korn shell allows n to be greater than 9 if specified as ${n}. $* All arguments on command line ("$1 $2..."). $@ All arguments on command line, individually quoted ("$1" "$2" ...). Variables set automatically by Korn shell: Variable Description ERRNO Error number of last system call that failed. LINENO Current...