Waren
Waren

Reputation: 143

What language are inbuilt PHP functions written in?

This may sound like a stupid question but I'm a beginner not just to PHP but to programming in general, so in that context:

What language are inbuilt PHP functions written in?

For example the inbuilt function "date("l")" when echoed will dislay the current day on the browser. But obviously this isn't done by magic, some one had to write this function, I am merely calling it.

A function as I understand it, is a way to contain a lot of PHP commands inside one call, and all those containing commands are written in PHP as well. But when it comes to the inbuilt function libraries, are these written in PHP or some other language?

And secondly, I have been told that the core of PHP 5 is written in C++ is this true?

Upvotes: 14

Views: 3462

Answers (4)

R Sun
R Sun

Reputation: 1671

You can see it's source code on GitHub - https://github.com/php/php-src

Upvotes: 1

Itay Moav -Malimovka
Itay Moav -Malimovka

Reputation: 53597

PHP is in C, parts of it and some of is extension are written in C++.

Upvotes: 1

Sarfraz
Sarfraz

Reputation: 382696

PHP has been written in what I call the mother of languages ^C^

Upvotes: 18

Elle H
Elle H

Reputation: 12217

PHP was written in C. Any language above machine code for the specific processor architecture is written in a lower-level language. These abstractions into higher-level languages are an effort to make programming simpler and more productive.

Upvotes: 5

Related Questions