What is php7?

What is php7?

PHP known as Hypertext Preprocessor is a widely used open source scripting language. PHP syntax is similar to c and perl.

It is completly free to use. It is used for following purposes:

  • Server side scripting embed with html
  • command line scripting
  • writing desktop apps

PHP can be used with different operating systems like mac, linux, windows etc... Using php you have a freedom to choose an operating system and a web server.

PHP can work with any modern servers like apache, nginx, IIS and many others.

PHP scripts are executed on server side and therefore it is a backend scripting language. PHP supports large number of different protocols like POP3, IMAP and LDAP.

PHP can easily output following things:

  • html
  • pdf
  • images
  • flash movies
  • xml doc
  • xhtml etc...

Writing database driven website is easily achieved using php extensions like mysql or pdo.

To run php from command line you need to follow the syntax below:

php [file.php]​

Why do I use php?

PHP can be used to perform following operations:

  • to perform file operations like opening a file, reading a file, writing to a file etc...
  • php can handle html forms to gather data
  • php can send emails
  • you can perform CRUD operations with databases
  • php can set different cookies on browser
  • php can be used to secure restricted pages using sessions
  • php can hash passwords
  • can generate dynamic page contents

What to learn before php?

Before you learn php you need to have knowledge of following things:

  • basic knowledge of different operating systems
  • basic knowledge of text editor to create, save and edit files
  • basic knowledge of html and css language
  • basic knowledge of web browser like chrome, firefox or safari
  • basic knowledge of internet and web

Why to learn php7?

PHP7 is considered as a major release that contains significant changes from php5.

Followings are some of the features of php7 language:

  • Improved performance
  • low memory consumption
  • scalar type declaration
  • 64-bit support
  • improved exception handling
  • many fatal errors now converted to proper exceptions
  • secured random number generation process
  • depricated extensions removed
  • the null calescing operator
  • return types and scalar type declarations
  • anonymous classes
  • spaceship operator
  • zero cost asserts
  • it uses new Zend Engine 3.0 to improve app performance

Interview Questions:

  • What is php?
    • PHP is a server side scripting language and used to generate dynamic web pages.
  • Can you send email using php?
    • Yes
  • What are some of the features of php7?
    • Scalar type declarations
    • Return type declarations
    • Null coalescing operator
    • Spaceship operator
    • Anonymous classes
  • What do the initials of PHP stands for?
    • PHP is known as Hypertext Preprocessor.
  • Which programming language does PHP resemble?
    • PHP syntax resembles Perl and C
  • How do you execute a PHP script from the command line?
    • php script_name.php