05.05.2013 Views

Programming PHP

Programming PHP

Programming PHP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ASCII letter (uppercase or lowercase), the underscore character (_), or any of the<br />

characters between ASCII 0x7F and ASCII 0xFF. After the initial character, these<br />

characters and the digits 0–9 are valid.<br />

Variable names<br />

Variable names always begin with a dollar sign ($) and are case-sensitive. Here are<br />

some valid variable names:<br />

$bill<br />

$head_count<br />

$MaximumForce<br />

$I_HEART_<strong>PHP</strong><br />

$_underscore<br />

$_int<br />

Here are some illegal variable names:<br />

$not valid<br />

$|<br />

$3wa<br />

These variables are all different:<br />

$hot_stuff $Hot_stuff $hot_Stuff $HOT_STUFF<br />

Function names<br />

Function names are not case-sensitive (functions are discussed in more detail in<br />

Chapter 3). Here are some valid function names:<br />

tally<br />

list_all_users<br />

deleteTclFiles<br />

LOWERCASE_IS_FOR_WIMPS<br />

_hide<br />

These function names refer to the same function:<br />

howdy HoWdY HOWDY HOWdy howdy<br />

Class names<br />

Class names follow the standard rules for <strong>PHP</strong> identifiers and are not case-sensitive.<br />

Here are some valid class names:<br />

Person<br />

account<br />

The class name stdClass is reserved.<br />

Constants<br />

A constant is an identifier for a simple value; only scalar values—boolean, integer,<br />

double, and string—can be constants. Once set, the value of a constant cannot<br />

22 | Chapter 2: Language Basics<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!