Friday, August 3, 2007

Libraries

PHP includes a large number of free and open source libraries with the core build. PHP is a fundamentally Internet-aware system with modules built in for accessing FTP servers, many database servers, embedded SQL libraries such as embedded MySQL and SQLite, LDAP servers, and others. Many functions familiar to C programmers such as those in the stdio family are available in the standard PHP build.

Objects

Basic Object-oriented programming functionality was added in PHP 3. Handling of objects was completely rewritten for PHP 5, allowing for better performance and more features. In previous versions of PHP, objects were handled like primitive types. The drawback of this method was that the whole object was copied when a variable was assigned, or passed as a parameter to a method. In the new approach, objects are referenced by handle, and not by value. PHP 5 introduced private and protected member variables and methods, along with abstract classes and abstract methods. It also introduced a standard way of declaring constructors and destructors similar to that of other object-oriented languages, such as C++, and an exception handling model similar to that of other programming languages.

The static method and class variable features in Zend Engine 2 do not work the way some expect. There is no virtual table feature in the engine, so the static variables are bound with a name at compile time instead of with a reference.

class foo extends bar
{
  function __construct()
  {
  }
  public static function mystaticfunc()
  {
  }
}

The above very basic example shows how to define a class, foo, that inherits from class bar. Additionally, the function, mystaticfunc, is a public static function that is called with foo::mystaticfunc();.

If the developer asks to create a copy of an object by using the reserved word clone, the Zend engine will check if a __clone() method has been defined or not. If not, it will call a default __clone() which will copy all of the object's properties. If a __clone() method is defined, then it will be responsible for setting the necessary properties in the created object. For convenience, the engine will supply a function that imports all of the properties from the source object, so that they can start with a by-value replica of the source object, and only override properties that need to be changed.

Data types

PHP stores whole numbers in a platform-dependent range. This range is typically that of 32-bit signed integers. Integer variables can be assigned using decimal (positive and negative), octal and hexadecimal notations. Real numbers are also stored in a platform-specific range. They can be specified using floating point notation, or two forms of scientific notation.

PHP has a native Boolean type, named "boolean", similar to the native Boolean types in Java and C++. Using the Boolean type conversion rules, non-zero values can be interpreted as true and zero as false, as in Perl.

The null data type represents a variable that has no value. The only value in the null data type is NULL.

Variables of the "resource" type represent references to resources from external sources. These are typically created by functions from a particular extension, and can only be processed by functions from the same extension. Examples include file, image and database resources.

Arrays support both numeric and string indices, and are heterogeneous. Arrays can contain elements of any type that PHP can handle, including resources, objects, and even other arrays. Order is preserved in lists of values and in hashes with both keys and values, and the two can be intermingled.

Syntax

PHP primarily acts as a filter. The PHP program takes input from a file or stream containing text and special PHP instructions and outputs another stream of data for display. From PHP 4, the PHP parser compiles input to produce bytecode for processing by the Zend Engine, giving improved performance over its interpreter predecessor. The Zend Engine II is at the heart of PHP 5.

The usual Hello World code example for PHP is:

echo 'Hello, World!';
?>

PHP only parses code within its delimiters, such as . Anything outside its delimiters is sent directly to the output and not parsed by PHP. The example above is equivalent to the following text (and indeed is converted into this form):

Hello, World!

Variables are prefixed with a dollar symbol and a type does not need to be specified in advance. Unlike function and class names, variable names are case sensitive. Both double-quoted ("") and heredoc strings allow the ability to embed the variable's value into the string.

PHP treats new lines as whitespace, in the manner of a free-form language (except when inside string quotes). Statements are terminated by a semicolon, except in a few special cases.

PHP has three types of comment syntax: /* */ which serves as block comments, and // as well as # which is used for inline comments.

Usage

PHP generally runs on a web server, taking PHP code as its input and creating Web pages as output, however it can also be used for command-line scripting and client-side GUI applications. PHP can be deployed on most web servers and on almost every operating system and platform free of charge. The PHP Group also provides the complete source code for users to build, customize and extend for their own use.

Server-side scripting

Originally designed to create dynamic web pages, PHP's principal focus is server-side scripting. While running the PHP parser with a web server and web browser, the PHP model can be compared to other server-side scripting languages such as Microsoft's ASP.NET system, Sun Microsystems' JavaServer Pages, mod_perl and the Ruby on Rails framework, as they all provide dynamic content to the client from a web server. To more directly compete with the "framework" approach taken by these systems, Zend is working on the Zend Framework - an emerging (as of June 2006) set of PHP building blocks and best practices; other PHP frameworks along the same lines include CakePHP, PRADO and Symfony.

The LAMP architecture has become popular in the Web industry as a way of deploying inexpensive, reliable, scalable, secure web applications. PHP is commonly used as the P in this bundle alongside Linux, Apache and MySQL, although the P can also refer to Python or Perl. PHP can be used with a large number of relational database management systems, runs on all of the most popular web servers and is available for many different operating systems. This flexibility means that PHP has a wide installation base across the Internet; over 19 million Internet domains are currently hosted on servers with PHP installed.

Examples of popular server-side PHP applications include phpBB, WordPress, and MediaWiki.

Command-line scripting

PHP also provides a command line interface SAPI for developing shell and desktop applications, daemons, log parsing, or other system administration tasks. PHP is increasingly used on the command line for tasks that have traditionally been the domain of Perl, Python, awk, or shell scripting.

Client-side GUI applications

PHP provides bindings to GUI libraries such as GTK+ (with PHP-GTK), Qt (with PHP-Qt) and text mode libraries like ncurses in order to facilitate development of a broader range of cross-platform GUI applications.

History

PHP was written as a set of CGI binaries in the C programming language by the Danish/Greenlandic programmer Rasmus Lerdorf in 1994, to replace a small set of Perl scripts he had been using to maintain his personal homepage. Lerdorf initially created PHP to display his résumé and to collect certain data, such as how much traffic his page was receiving. Personal Home Page Tools was publicly released on 8 June 1995 after Lerdorf combined it with his own Form Interpreter to create PHP/FI (this release is considered PHP version 2).

Zeev Suraski and Andi Gutmans, two Israeli developers at the Technion IIT, rewrote the parser in 1997 and formed the base of PHP 3, changing the language's name to the recursive initialism PHP: Hypertext Preprocessor. The development team officially released PHP/FI 2 in November 1997 after months of beta testing. Public testing of PHP 3 began and the official launch came in June 1998. Suraski and Gutmans then started a new rewrite of PHP's core, producing the Zend Engine in 1999. They also founded Zend Technologies in Ramat Gan, Israel, which actively manages the development of PHP.

In May 2000, PHP 4, powered by the Zend Engine 1.0, was released. The most recent update released by The PHP Group, is for the older PHP version 4 code branch which, as of May 2007, is up to version 4.4.7. PHP 4 will be supported by security updates until 31 December 2007.

On July 13, 2004, PHP 5 was released powered by the new Zend Engine II. PHP 5 included new features such as:[

  • Improved support for object-oriented programming
  • The PHP Data Objects extension, which defines a lightweight and consistent interface for accessing databases
  • Performance enhancements
  • Better support for MySQL
  • Embedded support for SQLite
  • Integrated SOAP support
  • Data iterators
  • Error handling via exceptions

The latest stable version, PHP 5.2.3, was released on June 1, 2007.

About

PHP is a reflective programming language originally designed for producing dynamic web pages. PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

The main implementation is produced by The PHP Group and released under the PHP License. It is considered to be free software by the Free Software Foundation. This implementation serves to define a de facto standard for PHP, as there is no formal specification.

Currently, two major versions of PHP are being actively developed: 5.x and 4.4.x; on July 13, 2007, the PHP group announced that active development on PHP4 will cease by December 31, 2007, however, critical security updates will be provided until August 8, 2008.

tonya truman capote wikepedia www.foxnews.com cheap textbooks edgar cayce ghost stories i believe las vegas coupons make money business opportunities rolex watches bucci twins farting i hope you dance plumper quads ryan univision.com baby jesus dvd recorder funny images honky tonk international iriver montgomery bus boycott motorcycle jackets need for speed most wanted cheats new balance shoes nikki cappelli nirvana mp photographs reading rite aid the legend of zelda time zone map women of walmart wow gold www.circuitcity.com amy grant kit cars lethal bizzle media player psp wallpaper renaissance art sigourney weaver air soft guns american diabetes association bono cartoon characters charles schwab cooper tires element skateboards grasslands jfk assassination leisure suit larry star magazine anime pics bees card tricks dvd transfer family crest kitchen tile lana wood landroller skates pan prednisone raphael sirens super bowl tickets action al-a blur dunkin donuts fur elise goo lucille ball sales shooting star the early november usenet cuckold stories fasting j. crew coupons leaning tower of pisa nursery rhymes polish relacore staph infection acer from fort lauderdale internet business ps cheats rube goldberg see through lingerie sharp the gap band aid comforters egyptian pyramids eva airways facts about abortion home based business opportunities i robot search engine optimization firm atlanta braves dog search euro trip freckles lewis and clark expedition metal mulisha walmart coupons wham avalon cia world factbook d cup ecstacy free translator inca instrumentals nbc news pc magazine pretty feet sandals spanish american war splits veronika chariots of fire great danes gta san andreas holding out for a hero lakers mla t shirts word games anti virus automobile big fish can you feel the love tonight confucianism fat man land rover maria menounos metric my humps remix nes roms parties pisces queen the rock band you're beautiful james blunt cc danger dave diaper stories online pharmacy shapes six flags sound clips air france appendicitis dominoes pizza from tampa groove coverage jamie pressley love bugs midi files november rain nun patrick stump porche quiznos sloth uniform akita gangster netgear puff the magic dragon small business corn stoves curcuit city gwen stafani ipod lawsuit online home business opportunity restaurant recipes telescope that s show abcnews.com adrien brody cell phone directory italian charms kelly bluebook navy federal credit union self esteem st. patrick's day capricorn cuisinart english bulldogs free online rpg games kashmir kianna ltd commodities shaw webmail stephanie heinrich stevie ray vaughan thong song creative dog food don vito electric scooters forever futons ifo to mpg la bamba laser samus stocking trailer trash urban outfitters west wing 9 amp land ccleaner columbia house free legal forms kara monaco kitchen backsplash let me love you odyssey pretty women sewing machines sugar ray victoria pratt all night long axl rose bull burnout cookware macy sky microsoft access nick carter panda bears retro sedu coupon codes thandie newton ain't no mountain high enough akon locked up court tv el-ladies.com funbrain.com hypnotized intellicast jon stewart miniclips.com panic at the disco lyrics walk this way wierd albuquerque born to be wild hubble telescope lilly old men orchid restaurant reviews scuba singing fish the giver united healthcare white booty cleavage galleries emotion icons free avatars mary kate and ashley optonline quilt patterns rooney seven wonders of the world the white house usher mp when you say nothing at all asp directv.com folica coupons goodyear tires mountain lion nfl playoff schedule pre beach volleyball bmg music ethics frys lemony snicket nate dogg natural cures pocket pc thick anime angels beverly d'angelo cheap air flights business class travel die another day fiesta foreskin gallery free online radio grafitti older gals pocket bike pontoon boats search engine marketing firm seeds stacy moran thunder traffic information anime pictures arthur ashe backyard wrestling cotton dali dredg elsa benitez hamtaro june carter mobile homes terrell owens yeti air conditioning from idaho falls from seattle fsbo howard stern guests replacement windows science project sean paul we be burnin soccer balls topheavy dragon tattoo free printable calendars hillary swank marvel painting ramada inn sandals resorts skimpy thongs spells the wizard of oz western wear amanda wenk battery chargers conversions dragon ball gt elizabeth shue julia miles libraries lice microsoft outlook mortgages signs of pregnancy taiwan tiffany lang under valentines day gifts volcano eruptions british flag computer cases fat woman shrimp swimming pools tmj translate cheats codes xbox dire straits history of computers how+to+construct++pigtails+with+reverse+sma+using hummer h jerusalem lit moving numbers pat benatar scented jar candle stationary the wiggles web search engines arctic cat blindside george lopez heart of a champion las vegas real estate listings male underwear medline right here starting home business toy story atv parts carlos mencia centaur cincinnati bengals leela nudist colony party cove taylor lautner aim buddy icons everquest formal hairstyles gecko homeless people impetigo knitting patterns mammals mile high club pizza coupons rosamund pike wedding music world weather zoey 3 college spring break data recovery krystal steel xbox in stock xmen bikini wax everglades free passwords map of south america marshall mathers stargate atlantis sunflower under armour warsaw poland warsaw www.excite.com all inclusive resorts bank black sabbath iron man dell laptops groundhog day activities handcuffs school fights a thousand miles atlantic city chinese tattoo dr. martin luther king jr. express clothing store ghandi jay leno vodka weather radar canada map country music song lyrics emily procter food chain from miami game g unit jason statham jenna lewis video for free john spencer krayzie bone lollipop neighbor traffic amy miller apartment search bettie ballhaus department stores homework jonny cash lasermonks.com mindy rebecca romijn touch the sky trample united health care university of kentucky vanity boyhood paradise fishnet lil boosie simon and garfunkel sims cheats soma vampire the masquerade bloodlines no cd hack white trash flat chest fly fishing gamehouse j-kwon messenger python seroquel stacys mom www.webmd.com al lewis anger classical discount airline tickets huskies kristin cavalleri louisiana purchase nebraska toyo tires www.nfl.com you got served bathing beauties carmen electra topless