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.
The operating environment of this article: Windows 10 system, PHP version 7.1, Dell G3 computer.
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!