Home>Article>Backend Development> What is the difference between php and c language?

What is the difference between php and c language?

青灯夜游
青灯夜游 Original
2019-10-10 13:41:10 4428browse

The core of PHP language is written in C language, but are there still differences between PHP and C language? The following article will introduce to you the differences between php and c languages. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

What is the difference between php and c language?

PHP is "Hypertext Preprocessor" and is a general open source scripting language. PHP is a scripting language executed on the server side. It is similar to C language and is a commonly used website programming language. PHP's unique syntax mixes C, Java, Perl, and PHP's own syntax. It is conducive to learning and widely used. It is mainly suitable for the field of web development.

C language is a process-oriented, abstract, general-purpose programming language that is widely used in low-level development. C language can compile and process low-level memory in a simple way. C language is an efficient programming language that only generates a small amount of machine language and can run without any operating environment support.

The difference between php and c language

1. PHP is a server scripting language and must be run on a server that can parse PHP

2 , C language is a low-level language, and PHP is a high-level language

3. C language is a strongly typed language, and PHP is a weakly typed language. This can be seen from the difference in syntax between the two

4 , PHP is mainly used for web applications, and C language is mainly used for low-level computer applications. In addition, C language is much more powerful than PHP. You should know that PHP is written in C language.

5. PHP does not support Multi-threading

6. PHP removes the difficult operations on pointers in C language, making PHP easier to learn and master than C

7. The basic variable types of PHP include integers (Integer ), floating point type (Float), string (String) (this is not available in C, but C has the String class) and Boolean (Boolean) (not available in C, but C has the String class). Constructed types include arrays and objects. In addition, there are two special types: NULL (also available in C) and Resource.

8. The way to define constants in PHP is a bit incredible to people who are learning C. It is actually implemented using a define function. PHP's functions are really powerful. We will see how to define arrays later. It is also done by functions. We really have to thank PHP for its extremely rich function library, which makes PHP easy to use and powerful.

define function prototype:

bool define(string name,value,[,bool case_insensitive])

If the third parameter is TRUE, it means that the constant name is case-insensitive, otherwise it is sensitive, and the default is sensitive. Let’s follow the custom and keep constant names case-sensitive.

The above is the detailed content of What is the difference between php and c language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Is php easy? Next article:Is php easy?