Home  >  Article  >  Backend Development  >  What is the difference between php and ruby

What is the difference between php and ruby

WBOY
WBOYOriginal
2022-03-02 10:39:382380browse

The difference between php and ruby: 1. The parentheses can be omitted when calling functions in ruby, but the parentheses cannot be omitted in PHP; 2. proc and block are provided in ruby, but not in PHP; 3. ruby There are no interfaces or abstract classes in PHP, while there are interfaces and abstract classes in PHP.

What is the difference between php and ruby

The operating environment of this article: Windows 10 system, PHP version 7.1, Dell G3 computer.

What is the difference between php and ruby

Ruby is a simple and fast object-oriented (object-oriented programming) scripting language,

PHP is a way to create dynamic interactions Powerful server-side scripting language for sex sites.

php and ruby ​​are both object-oriented now. I feel that ruby ​​is more object-oriented. Everything in ruby ​​is an object, including numbers.

Their classes can be extended by other classes. Both Ruby and PHP support exception handling.

Ruby provides the symbol: var, but there is no such thing in PHP.

You can omit the parentheses when calling functions in ruby, but not in php. Personally, I feel that this is not standardized in ruby. At least it is written in a way that is inexplicable.

Provided in ruby Scope is not available in php.

Ruby provides proc and block; but it is not available in php.

There is no interface or abstract class in ruby, but it is available in php.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What is the difference between php and ruby. 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