I think how you design your code and what software architecture you use has a larger impact on your performance than the underlying language. In my opinion programmers and software architects make software fast or slow. Ruby and PHP are both interpreted languages which can make code slower than compiled code because a compiler does certain optimizations. But for both PHP and Ruby there exist bytcode caches and compilers.

Answer from Martin Fahl on Stack Overflow
🌐
Ruby-Doc.org
ruby-doc.org › home › ruby vs php: which is better?
Ruby vs PHP: Which is Better? - Ruby-Doc.org
July 16, 2025 - It can execute code much faster than its predecessors and has a low memory footprint. Combined with OPcache, PHP applications can achieve high throughput. Ruby, particularly with Rails, is often slower than PHP.
Discussions

Is ruby Slower than Php in performance benchmarking - Stack Overflow
I am hearing by lots of programmer that Ruby lacks in performance with comparison to php. So i try to find out the real picture behind that i saw this post Why do people say that Ruby is slow? . ... More on stackoverflow.com
🌐 stackoverflow.com
PHP/Laravel vs Ruby on Rails. Which one is more worth learning now?
Of those two I'd suggest Rails, though neither would be my top recommendation for a first backend framework. PHP is... a horrible language. It's badly designed in so many different ways. This classic article gives a breakdown of the many reasons PHP is a nightmare. In the old days, it was still worth using because the PHP+Apache runtime environment was so convenient. But in the modern world where Node, C# and Go all have high performance built in webservers and docker makes spinning up a server repeatable and easy, that advantage is gone. The only reason I'd focus on PHP is if there's a specific company you want to work for that uses it (Meta and Slack are two particularly high profile PHP shops, though both use the Hack dialect that mitigates many of PHPs flaws). Ruby is a much nicer, more consistent language. But Rails does have some real issues. Rails is an extremely opinionated framework. There's a 'Rails way of doing things' for almost every situation. Developers who learned Rails first do have a tendency to struggle when confronted with other frameworks that are less batteries included. That being said, Rails is still wildly used and is very easy to learn. If you wanted my opinion, my stack ranking of BE frameworks to pick up would be: Java/Spring Boot Javascript/Typescript/Node/Express ASP.NET Core Go with native HTTP server Python/Flask or Python/FastAPI Ruby/Rails Any other Java framework Any other Node framework Python/Django Anything in a 'obscure' language like Scala, Clojure, Elixir or (god help you) Haskell Any PHP framework. Anything in C++ But that's as much based on my language biases (I really like Typescript, C# and Go) as it is on skill marketability. More on reddit.com
🌐 r/learnprogramming
5
0
April 6, 2022
Switching from PHP to Ruby - is it the answer to performance? - Stack Overflow
I get more often the answer, when asking performance related stuff regarding PHP applications, that PHP really isn't the language for high-performance applications, and that a compiled language rea... More on stackoverflow.com
🌐 stackoverflow.com
Ruby or PHP Worth Learning? : r/cscareerquestions
🌐 r/cscareerquestions
🌐
Zend
zend.com › blog › php-vs-ruby-on-rails
PHP vs. Ruby vs. Ruby on Rails for Modern Web Apps | Zend
September 13, 2024 - So, for quick and single-purpose websites, Ruby or Ruby on Rails might make a lot of sense. As I tend support the enterprise space where one application is required to interact with a few dozen others, scalability is a top concern, and I think I'll stick to my PHP. ZendPHP provides fully-supported runtimes designed to keep your business-critical PHP applications performant...
🌐
Plesk
plesk.com › home › ruby on rails vs php: which one's right for your needs?
Ruby on Rails vs PHP: Which one's right for your needs?
April 16, 2024 - Ruby on Rails is a widely-used ... in the robust Ruby language. PHP 7.0 has built-in web development capabilities and has been configured to perform better, without gobbling up more memory....
🌐
GeeksforGeeks
geeksforgeeks.org › php › ruby-vs-php
Ruby vs PHP - GeeksforGeeks
July 23, 2025 - Additionally, techniques like code profiling and memory management strategies can help mitigate performance issues in Ruby applications. PHP generally exhibits good performance, particularly for simpler applications.
🌐
Quora
quora.com › If-PHP-is-faster-than-Ruby-then-why-is-Rails-faster-than-Laravel-curiosity
If PHP is faster than Ruby, then why is Rails faster than Laravel (curiosity)? - Quora
Answer (1 of 9): Well, a few years ago when I was learning Ruby. I was then an avid PHP programmer, pretty good. I wanted to show once and for all just how slow Ruby actually was. So I made benchmarks of common things to do. Merge arrays, split strings, form, serialize and deserialize json and a...
Find elsewhere
🌐
Programming Language Benchmarks
programming-language-benchmarks.vercel.app › ruby-vs-php
Ruby VS Php benchmarks, Which programming language or compiler is faster
Php · Python · Ruby · Rust · Swift · Typescript · V · Wasm · Zig · Current benchmark data was generated on Fri Aug 01 2025, full log can be found HERE · CONTRIBUTIONS are WELCOME! CPU INFO:[x86_64][4 cores] AMD EPYC 7763 64-Core Processor (Model 1) * -m in a file name stands for multi-threading or multi-processing ·
🌐
Railsware
railsware.com › home › engineering › ruby vs. php – in quest of the most suitable programming language for your startup
Ruby vs. PHP - in Quest of the Most Suitable Programming Language for Your Startup
January 31, 2025 - The focus was made at two parameters – the average runtime and the number of code lines. PHP leads in the first parameter, while Ruby gives shorter code. So, we can state that we have no winner in PHP vs.
🌐
Sloboda Studio
sloboda-studio.com › homepage › ruby vs php: the big battle
Ruby vs PHP: The Big Battle - Sloboda Studio
November 29, 2024 - 1.6 Round 6: Ruby vs PHP performance · 1.7 Round 7: Frameworks · 1.8 Round 8: Community · 1.9 Round 9: Syntax · 2 PHP vs Ruby · In the fight of two’s, only one can win. Who would it be: PHP or Ruby? Ruby and PHP programming languages have been competitors since day one of their first appearances.
Rating: 4 ​ - ​ 13 votes
🌐
Reddit
reddit.com › r/learnprogramming › php/laravel vs ruby on rails. which one is more worth learning now?
r/learnprogramming on Reddit: PHP/Laravel vs Ruby on Rails. Which one is more worth learning now?
April 6, 2022 -

I have interest in both of these languages / frameworks. So far I'm proficient in frontend but need a backend with my React projects. What I mean by worth learning, is which is more popular / widely used in companies? I've seen job listings with either or both. So I can't really tell from that standpoint. Asking people with more experience in the industry than me.

Also, what would you prefer and why? (This is more of a subjective question)

Top answer
1 of 2
3
Of those two I'd suggest Rails, though neither would be my top recommendation for a first backend framework. PHP is... a horrible language. It's badly designed in so many different ways. This classic article gives a breakdown of the many reasons PHP is a nightmare. In the old days, it was still worth using because the PHP+Apache runtime environment was so convenient. But in the modern world where Node, C# and Go all have high performance built in webservers and docker makes spinning up a server repeatable and easy, that advantage is gone. The only reason I'd focus on PHP is if there's a specific company you want to work for that uses it (Meta and Slack are two particularly high profile PHP shops, though both use the Hack dialect that mitigates many of PHPs flaws). Ruby is a much nicer, more consistent language. But Rails does have some real issues. Rails is an extremely opinionated framework. There's a 'Rails way of doing things' for almost every situation. Developers who learned Rails first do have a tendency to struggle when confronted with other frameworks that are less batteries included. That being said, Rails is still wildly used and is very easy to learn. If you wanted my opinion, my stack ranking of BE frameworks to pick up would be: Java/Spring Boot Javascript/Typescript/Node/Express ASP.NET Core Go with native HTTP server Python/Flask or Python/FastAPI Ruby/Rails Any other Java framework Any other Node framework Python/Django Anything in a 'obscure' language like Scala, Clojure, Elixir or (god help you) Haskell Any PHP framework. Anything in C++ But that's as much based on my language biases (I really like Typescript, C# and Go) as it is on skill marketability.
2 of 2
2
PHP is a lot more popular in job market, unless you live in some weird bubble, but you can just check that yourself. I'd prefer neither, mostly because i prefer not working on old code but developing something new, and php and ruby are not really the hot stuff right now. But if i'd have to choose i'd rather write ruby, it's pretty nice. Ruby is pretty much just rails jobs, php has a more variety other than laravel.
🌐
Ficus Technologies
ficustechnologies.com › home › blog › ruby vs. php: which....
Ruby vs. PHP: Which programming language is better? - Ficus Technologies
Ruby vs. PHP: Which programming language is better? - Ficus Technologies
Explore the pros & cons of Ruby vs. PHP to determine which programming language is best for web development. Analyze factors like performance, ease of use, and community support.
Rating: 5 ​
🌐
EngineYard
engineyard.com › engine yard blog › ruby on rails › ruby on rails vs php
Ruby on Rails vs PHP
March 18, 2022 - Auto scaling, boost performance · Private, fully-configured Kubernetes cluster · Linear pricing that scales, no surprises · Decades of Ruby and AWS experience · DEPLOY MY APP FOR FREE · 14 day trial. No credit card required. Deployment & Professional Services · Database Support · Use Cases · Cloud Application Hosting · Ruby Hosting · Node.js Hosting · PHP Hosting ·
🌐
Proxify
proxify.io › articles › comparing-php-and-ruby-languages
Comparing Php And Ruby Languages - Proxify
January 7, 2022 - While PHP may have the edge in terms of raw performance, Ruby’s focus on developer productivity and clean code can lead to faster development cycles and more maintainable applications.
🌐
Stepmedia Software
stepmediasoftware.com › home › blog › technology › ruby vs php: which language is the best for web development?
Ruby vs PHP: Which Language is Best for Web Development?
April 11, 2025 - In general, PHP is faster than Ruby in raw execution. It is lightweight and optimized for web application performance. However, with Ruby on Rails, Ruby can handle complex tasks efficiently.
🌐
eSparkBiz
esparkinfo.com › ruby on rails vs php
Ruby on Rails vs PHP: Which One You Should Opt For? - eSparkBiz
March 5, 2026 - With better speed and easier deployment, PHP offers great efficiency to the developers. However, with better handling of complex functions and more reliable performance, RoR is a great choice for the experienced developers.
Price   $12
Address   1001 - 1009 10th floor City Center 2, Sukan Mall Cross Road, Science City Rd, 380060, Ahmedabad
🌐
BairesDev
bairesdev.com › home › blog › software development
Ruby vs PHP: What to Consider Before Making a Decision
February 19, 2026 - Ruby’s developer-friendly features sometimes trade speed for simplicity. It’s not as competitive as high-performance alternatives like C++ or Go in resource-heavy applications. PHP has a clear win in rendering web pages fast.