Interpreting vs. Compiling

PHP uses a blend of interpretation and compilation in order to provide the best mix of performance and flexibility to programmers. Behind the scenes, PHP compiles your script down to a series of instructions (called opcodes) whenever it is accessed. These instructions are then executed one by one until the script terminates. This constant recompilation […]

Data types in php

PHP support eight primitive data types Scalar data types : 1. boolean 2. integer 3. float , double 4. string Compound data types : 1. array 2. object Special data types : 1. resource 2. NULL Beside this, there php introduces few pseudo-types 1. mixed 2. numbers 3. callback 4. array | object 5. void […]

What can PHP do?

PHP is mainly focussed on server side scripting so that you can do anything any other CGI language can do. There are three widely areas in which PHP is used 1. Server side scripting : PHP is server side scripting language in which the processing is done at the server end and response transferred as […]

Constructors and Destructors

Constructor :  void __construct ([ mixed $args = “” [, $… ]] ) PHP 5 allows developers to declare constructor methods for classes. Classes which have a constructor method call this method on each newly-created object, so it is suitable for any initialization that the object may need before it is used. Note: Parent constructors […]

How to setup virtual host in wamp

I will demonstrate how to host more then one site on WAMP. I believe that WAMP is up and running on your window machine. Suppose you want to host, say localhost my.localhost We will consider all the file one by one that need to be modified: host Go to “C:/Windows/System32/drivers/etc” and open the “hosts” file […]

Errors in PHP.

There are three basic types of runtime errors in PHP: Notices: These are small, non-critical errors that PHP encounters while executing a script – for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all – although the default behavior can be changed. […]

Explain the different types of errors in PHP.

E_ERROR: A fatal error that causes script termination E_WARNING: Run-time warning that does not cause script termination E_PARSE: Compile time parse error. E_NOTICE: Run time notice caused due to error in code E_CORE_ERROR: Fatal errors that occur during PHP’s initial startup (installation) E_CORE_WARNING: Warnings that occur during PHP’s initial startup E_COMPILE_ERROR: Fatal compile-time errors indication […]

What is PEAR in php?

PEAR(PHP Extension and Application Repository) is a framework and repository for reusable PHP components. PEAR is a code repository containing all kinds of php code snippets and libraries. PEAR also offers a command-line interface that can be used to automatically install “packages”.

What is PHP?

PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. PHP started out as a small open source project that evolved as more and more people found out how useful it was. Rasmus Lerdorf unleashed the first […]