PHP vs TypeScript

Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

PHP
PHP

58.9K
14.8K
+ 1
4.3K
TypeScript
TypeScript

10.3K
7.6K
+ 1
400
Add tool

PHP vs TypeScript: What are the differences?

What is PHP? A popular general-purpose scripting language that is especially suited to web development. Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.

What is TypeScript? A superset of JavaScript that compiles to clean JavaScript output. TypeScript is a language for application-scale JavaScript development. It's a typed superset of JavaScript that compiles to plain JavaScript.

PHP belongs to "Languages" category of the tech stack, while TypeScript can be primarily classified under "Templating Languages & Extensions".

"Large community", "Open source" and "Easy deployment" are the key factors why developers consider PHP; whereas "More intuitive and type safe javascript", "Type safe" and "JavaScript superset" are the primary reasons why TypeScript is favored.

PHP and TypeScript are both open source tools. TypeScript with 50.5K GitHub stars and 6.98K forks on GitHub appears to be more popular than PHP with 23.7K GitHub stars and 5.5K GitHub forks.

Slack, Lyft, and MIT are some of the popular companies that use PHP, whereas TypeScript is used by Slack, Clever, and Repro. PHP has a broader approval, being mentioned in 8868 company stacks & 2867 developers stacks; compared to TypeScript, which is listed in 954 company stacks and 1390 developer stacks.

What is PHP?

Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.

What is TypeScript?

TypeScript is a language for application-scale JavaScript development. It's a typed superset of JavaScript that compiles to plain JavaScript.
Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Why do developers choose PHP?
Why do developers choose TypeScript?

Sign up to add, upvote and see more prosMake informed product decisions

    Be the first to leave a con
    Jobs that mention PHP and TypeScript as a desired skillset
    What companies use PHP?
    What companies use TypeScript?

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with PHP?
    What tools integrate with TypeScript?

    Sign up to get full access to all the tool integrationsMake informed product decisions

    What are some alternatives to PHP and TypeScript?
    JavaScript
    JavaScript is most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB. It is a prototype-based, multi-paradigm scripting language that is dynamic,and supports object-oriented, imperative, and functional programming styles.
    Python
    Python is a general purpose programming language created by Guido Van Rossum. Python is most praised for its elegant syntax and readable code, if you are just beginning your programming career python suits you best.
    Java
    Java is a programming language and computing platform first released by Sun Microsystems in 1995. There are lots of applications and websites that will not work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere!
    HTML5
    HTML5 is a core technology markup language of the Internet used for structuring and presenting content for the World Wide Web. As of October 2014 this is the final and complete fifth revision of the HTML standard of the World Wide Web Consortium (W3C). The previous version, HTML 4, was standardised in 1997.
    Node.js
    Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
    See all alternatives
    Decisions about PHP and TypeScript
    React Native
    React Native
    Java
    Java
    Flow (JS)
    Flow (JS)
    TypeScript
    TypeScript

    I use TypeScript for Web Applications and for both frontend and backend because it has a lot of tooling around it and they really got the types and type safety right. Flow (JS) on the other hand lacks tooling and most of the times I scramble to find the right way of building my contracts in which TypeScript is very intuitive and natural. Additionally TypeScript is very similar to Java so your backend engineers and full stack engineers can work with it without much of context switch.

    The only time I think Flow shines is (based on probably my outdated knowledge) Flow is/was the only option if you want/wanted to build a React Native application mainly because React Native transpiler at the time I was working with it would only work with flow.

    See more
    Flow (JS)
    Flow (JS)
    TypeScript
    TypeScript

    I use TypeScript because it isn't just about validating the types I'm expecting to receive though that is a huge part of it too. Flow (JS) seems to be a type system only. TypeScript also allows you to use the latest features of JavaScript while also providing the type checking. To be fair to Flow (JS), I have not used it, but likely wouldn't have due to the additional features I get from TypeScript.

    See more
    David Koblas
    David Koblas
    VP Engineering at Payment Rails · | 9 upvotes · 6.4K views
    atPayment RailsPayment Rails
    TypeScript
    TypeScript
    Flow (JS)
    Flow (JS)
    JavaScript
    JavaScript

    We originally (in 2017) started rewriting our platform from JavaScript to Flow (JS) but found the library support for Flow was lacking. After switching gears to TypeScript we've never looked back. At this point we're finding that frontend and backend libraries are supporting TypeScript out of the box and where the support is missing that the commuity is typically got a solution in hand.

    See more
    Forrest Norvell
    Forrest Norvell
    engineering manager at self-employed · | 6 upvotes · 9K views
    Visual Studio Code
    Visual Studio Code
    Flow (JS)
    Flow (JS)
    ESLint
    ESLint
    TSLint
    TSLint
    TypeScript
    TypeScript

    I use TypeScript because the tooling is more mature (the decision to discontinue TSLint in favor of moving all its checks to ESLint is a thoughtful and mature decision), there's a ton of examples and tutorials for it, and it just generally seems to be where the industry is headed. Flow (JS) is a fine tool, but it just hasn't seen the uptake that TS has, and as a result is lacking a lot of the nicer small things, like thorough Visual Studio Code integration, offered by TS.

    See more
    JavaScript
    JavaScript
    Flow (JS)
    Flow (JS)
    TypeScript
    TypeScript

    If you will start a project from scratch I recommend to use TypeScript. But, If you work with legacy projects written in JavaScript I recommend Flow (JS). Both tools have the same objective: reduce the bad code (which create illegible code, generate bugs e problems to maintenance). Flex helps you to avoid fall in bad codes, but TypeScript prevent you to c you to create bad codes. I believe cause this some JavaScript fans don't like TS, because TS block you to write some types o code. This is the fundamental difference between TS and Flow: Flow avoid problems, but no force. TS force you to prevent problems.

    See more
    .NET Core
    .NET Core
    React
    React
    AngularJS
    AngularJS
    TypeScript
    TypeScript

    I use TypeScript because it's adoption by many developers, it's supported by many companies, and it's growth. AngularJS, React, @ASP.NET Core. I started using it in .NET Core, then for a job. Later I added more Angular experience and wrote more React software. It makes your code easier to understand and read... which means it makes other people's code easier to understand and read.

    See more
    TypeScript
    TypeScript

    I use TypeScript because:

    • incredible developer tooling and community support
    • actively developed and supported by Microsoft (yes, I like Microsoft) ;)
    • easier to make sense of a TS codebase because the annotations provide so much more context than plain JS
    • refactors become easier (VSCode has superb support for TS)

    I've switched back and forth between TS and Flow and decided a year ago to abandon Flow completely in favor of TS. I don't want to bash Flow, however, my main grievances are very poor tooling (editor integration leaves much to be desired), a slower release cycle, and subpar docs and community support.

    See more
    Tom Klein
    Tom Klein
    CEO at Gentlent · | 4 upvotes · 24.7K views
    atGentlentGentlent
    Python
    Python
    Electron
    Electron
    Socket.IO
    Socket.IO
    Google Compute Engine
    Google Compute Engine
    TypeScript
    TypeScript
    ES6
    ES6
    Ubuntu
    Ubuntu
    PostgreSQL
    PostgreSQL
    React
    React
    nginx
    nginx
    Sass
    Sass
    HTML5
    HTML5
    PHP
    PHP
    Node.js
    Node.js
    JavaScript
    JavaScript

    Our most used programming languages are JavaScript / Node.js for it's lightweight and fast use, PHP because everyone knows it, HTML5 because you can't live without it and Sass to write great CSS. Occasionally, we use nginx as a web server and proxy, React for our UX, PostgreSQL as fast relational database, Ubuntu as server OS, ES6 and TypeScript for Node, Google Compute Engine for our infrastructure, and Socket.IO and Electron for specific use cases. We also use Python for some of our backends.

    See more
    Gustavo Muñoz
    Gustavo Muñoz
    Web UI Developer at Globant · | 2 upvotes · 5K views
    CoffeeScript
    CoffeeScript
    JavaScript
    JavaScript
    Flow (JS)
    Flow (JS)
    React
    React
    TypeScript
    TypeScript
    Angular 2
    Angular 2
    #ECMA
    #Angular

    Long ago when Angular 2 evolved I had to decide between the new #Angular and TypeScript or React. I really love typing my code, but forced to use TypeScript was a bit too much. I prefer the new #ECMA standard and the evolution of the old and reliable JavaScript. So finding Flow (JS) was an incredible milestone in my career as a developer. Finally, I could use types in my code, and JavaScript with the new standard. I already had the experience of CoffeeScript, so TypeScript was not an option.

    See more
    Labinator Team
    Labinator Team
    at Labinator · | 13 upvotes · 45.1K views
    atLabinatorLabinator
    Debian
    Debian
    Manjaro
    Manjaro
    Visual Studio Code
    Visual Studio Code
    Sublime Text
    Sublime Text
    WordPress
    WordPress
    PHP
    PHP
    Vanilla.JS
    Vanilla.JS
    Sass
    Sass
    CSS 3
    CSS 3
    HTML5
    HTML5

    At labinator.com, we use HTML5, CSS 3, Sass, Vanilla.JS and PHP when building our premium WordPress themes and plugins. When writing our codes, we use Sublime Text and Visual Studio Code depending on the project. We run Manjaro and Debian operating systems in our office. Manjaro is a great desktop operating system for all range of tasks while Debian is a solid choice for servers.

    WordPress became a very popular choice when it comes to content management systems and building websites. It is easy to learn and has a great community behind it. The high number of plugins as well that are available for WordPress allows any user to customize it depending on his/her needs.

    For development, HTML5 with Sass is our go-to choice when building our themes.

    Main Advantages Of Sass:

    • It's CSS syntax friendly
    • It offers variables
    • It uses a nested syntax
    • It includes mixins
    • Great community and online support.
    • Great documentation that is easy to read and follow.

    As for PHP, we always thrive to use PHP 7.3+. After the introduction of PHP 7, the WordPress development process became more stable and reliable than before. If you a developer considering PHP 7.3+ for your project, it would be good to note the following benefits.

    The Benefits Of Using PHP:

    • Open Source.
    • Highly Extendible.
    • Easy to learn and read.
    • Platform independent.
    • Compatible with APACHE.
    • Low development and maintenance cost.
    • Great community and support.
    • Detailed documentation that has everything you need!

    Why PHP 7.3+?

    • Flexible Heredoc & Nowdoc Syntaxes - Two key methods for defining strings within PHP. They also became easier to read and more reliable.
    • A good boost in performance speed which is extremely important when it comes to WordPress development.
    See more
    Tassanai Singprom
    Tassanai Singprom
    Slack
    Slack
    BrowserStack
    BrowserStack
    Sentry
    Sentry
    Kibana
    Kibana
    Visual Studio Code
    Visual Studio Code
    npm
    npm
    GitLab
    GitLab
    GitHub
    GitHub
    Git
    Git
    Elasticsearch
    Elasticsearch
    Postman
    Postman
    Google Analytics
    Google Analytics
    MariaDB
    MariaDB
    GraphQL
    GraphQL
    Amazon RDS
    Amazon RDS
    Lumen
    Lumen
    Laravel
    Laravel
    Firebase
    Firebase
    Vue.js
    Vue.js
    Sass
    Sass
    Ubuntu
    Ubuntu
    Amazon EC2
    Amazon EC2
    Redis
    Redis
    jQuery
    jQuery
    HTML5
    HTML5
    PHP
    PHP
    JavaScript
    JavaScript

    This is my stack in Application & Data

    JavaScript PHP HTML5 jQuery Redis Amazon EC2 Ubuntu Sass Vue.js Firebase Laravel Lumen Amazon RDS GraphQL MariaDB

    My Utilities Tools

    Google Analytics Postman Elasticsearch

    My Devops Tools

    Git GitHub GitLab npm Visual Studio Code Kibana Sentry BrowserStack

    My Business Tools

    Slack

    See more
    Flow (JS)
    Flow (JS)
    JavaScript
    JavaScript
    CoffeeScript
    CoffeeScript
    TypeScript
    TypeScript

    From a StackShare community member: "We are looking to rewrite our outdated front-end with TypeScript. Right now we have a mix of CoffeeScript and vanilla JavaScript. I have read that adopting TypeScript can help enforce better code quality, and best practices. I also heard good things about Flow (JS). Which one would you recommend and why?"

    See more
    Jason Barry
    Jason Barry
    Cofounder at FeaturePeek · | 4 upvotes · 8.8K views
    atFeaturePeekFeaturePeek
    npm
    npm
    Yarn
    Yarn
    Babel
    Babel
    Sublime Text
    Sublime Text
    JavaScript
    JavaScript
    React
    React
    TypeScript
    TypeScript
    Flow (JS)
    Flow (JS)
    #Frontend

    I think our #Frontend stack is pretty standard – but we have taken some deviations from a typical modern stack:

    • Flow (JS) instead of TypeScript. Flow was an easy choice 2+ years ago, as both flow and React were (and still are) maintained by Facebook. Today, it seems that the JavaScript community has settled on TypeScript as the winner. For new projects, I'd choose TS, but I don't see the point in migrating an existing project from flowtype to TS, when the end result will be roughly the same. Sure, memory usage is a bit high, and every now and then I have to kill some zombie processes, but our text editors (Sublime Text), CI scripts, and Babel are already set up to take advantage of the type safety that flow offers. When/if the React team writes React itself in TS, then I'll take a closer look – until then, flow works for us.

    • Yarn instead of npm. When yarn debuted, we never looked back. Now npm has pretty much caught up with speed and lockfiles, but yarn gives me confidence that my dependency installs are deterministic. Really interested in the plug-n-play (PnP) feature that removes the need for a node_modules folder, but haven't implemented this yet.

    See more
    Ali Soueidan
    Ali Soueidan
    Creative Web Developer at Ali Soueidan · | 16 upvotes · 48.3K views
    npm
    npm
    Babel
    Babel
    PHP
    PHP
    Adobe Illustrator
    Adobe Illustrator
    Asana
    Asana
    ES6
    ES6
    GitHub
    GitHub
    Git
    Git
    JSON
    JSON
    Sass
    Sass
    Pug
    Pug
    JavaScript
    JavaScript
    vuex
    vuex
    Vue.js
    Vue.js

    Application and Data: Since my personal website ( https://alisoueidan.com ) is a SPA I've chosen to use Vue.js, as a framework to create it. After a short skeptical phase I immediately felt in love with the single file component concept! I also used vuex for state management, which makes working with several components, which are communicating with each other even more fun and convenient to use. Of course, using Vue requires using JavaScript as well, since it is the basis of it.

    For markup and style, I used Pug and Sass, since they’re the perfect match to me. I love the clean and strict syntax of both of them and even more that their structure is almost similar. Also, both of them come with an expanded functionality such as mixins, loops and so on related to their “siblings” (HTML and CSS). Both of them require nesting and prevent untidy code, which can be a huge advantage when working in teams. I used JSON to store data (since the data quantity on my website is moderate) – JSON works also good in combo with Pug, using for loops, based on the JSON Objects for example.

    To send my contact form I used PHP, since sending emails using PHP is still relatively convenient, simple and easy done.

    DevOps: Of course, I used Git to do my version management (which I even do in smaller projects like my website just have an additional backup of my code). On top of that I used GitHub since it now supports private repository for free accounts (which I am using for my own). I use Babel to use ES6 functionality such as arrow functions and so on, and still don’t losing cross browser compatibility.

    Side note: I used npm for package management. 🎉

    *Business Tools: * I use Asana to organize my project. This is a big advantage to me, even if I work alone, since “private” projects can get interrupted for some time. By using Asana I still know (even after month of not touching a project) what I’ve done, on which task I was at last working on and what still is to do. Working in Teams (for enterprise I’d take on Jira instead) of course Asana is a Tool which I really love to use as well. All the graphics on my website are SVG which I have created with Adobe Illustrator and adjusted within the SVG code or by using JavaScript or CSS (SASS).

    See more
    John Datserakis
    John Datserakis
    Node.js
    Node.js
    PHP
    PHP
    Go
    Go

    For the backend of https://www.rsvpkeeper.com I went with Go.

    My past few project have been built with Go and I'm really loving it. It was my first statically typed language after many years with PHP and Node.js - and honestly I couldn't be happier to have made the switch.

    The biggest thing for me, is that with the forced declaration of types - it's made me feel like I've made a more solid backend. Sometimes with PHP I felt like a stiff breeze could knock the whole thing down. I know that's an exaggeration - but it's kinda how it feels.

    Anyways, everyone knows that it almost doesn't even matter what an app is actually made with - what really matters are the design decisions you make a long the way.

    See more
    Interest over time
    Reviews of PHP and TypeScript
    Review ofPHPPHP

    source: w3techs.com

    Rants about PHP are everywhere, but during the last years the language and the whole ecosystem has evolved.

    The lastest versions support namespaces, closures, traits, generators and with composer a dependency manager that changed the way PHP developers work and collaborate.

    Avatar of lpellegr
    Noticeable
    Review ofTypeScriptTypeScript

    Typed JavaScript is just fantastic for medium to large size projects. The type system is well thought and compatible with standard JavaScript. Almost any new Javascript-based development should use TypeScript to save time and prevent technical debt over time.

    How developers use PHP and TypeScript
    Avatar of NewCraft
    NewCraft uses TypeScriptTypeScript

    Typescript has been a win because, in general, it makes codebase maintenance less brittle. It's significantly easier to refactor in TS than JS, which encourages incremental improvements, file re-organizing, etc. Our developers are happier with the overall development experience.

    The downside is that TS sometimes exacerbates problems caused by Node's fragmented ecosystem. Sometimes @types/ don't work, other times types are outdated. This can lead to problems with newly-installed libraries.

    If your project is big enough, I'd say TS is nearly always worth it, but it can make selecting libraries a pain.

    Avatar of Vladislav Moshynec
    Vladislav Moshynec uses PHPPHP

    Use the ipwhois.io IP lookup API to quickly and simply integrate IP geolocation into your script or website. Save yourself the hassle of setting up local GeoIP libraries and having to remember to regularly update the data.

    GitHub

    Avatar of Matt Welke
    Matt Welke uses TypeScriptTypeScript

    Used for Node.js personal projects that I think will have a longer lifetime than others, or that are combined with a web front end component like Angular (to share types).

    Generally a poor developer experience. Usage decreasing recently compared to other preferred programming languages/platforms.

    Avatar of ShadowICT
    ShadowICT uses PHPPHP

    We use PHP as our main backend preprocessor. Being a well established language, it is supported by a large community as well as a dedicated team of developers. It is used for much heavier projects that do not require realtime processes as well as being used in a hybrid system alongside NodeJS.

    Avatar of Andrew Gatenby
    Andrew Gatenby uses PHPPHP

    PHP has been the backbone of what we've done at Visualsoft for years. We have lots of experienced people who have used it and know how to get the best out of it. It's come on leaps and bounds over recent years, and is the basis of pretty much everything we'll build with.

    Avatar of Ordius IT Solutions Pvt Ltd
    Ordius IT Solutions Pvt Ltd uses PHPPHP

    The reason being they are simple to learn and easy to implement apps on any size.

    The learning curve for PHP and MySQL is less compared to MEAN. It’s advisable to learn PHP and MySQL if you want to have a taste of web-development or you are in a hurry.

    Avatar of Marc3842h
    Marc3842h uses TypeScriptTypeScript

    TypeScript is used in Kuro (https://github.com/Marc3842h/kuro).

    Kuro is the browser facing portion of shiro. Typescript is the language in which the web server and the frontend scripts are written in. They later get compiled down to vanilla JavaScript.

    Avatar of IPWHOIS.io - IP Geolocation API
    IPWHOIS.io - IP Geolocation API uses PHPPHP

    Use the ipwhois.io IP lookup API to quickly and simply integrate IP geolocation into your script or website. Save yourself the hassle of setting up local GeoIP libraries and having to remember to regularly update the data.

    Avatar of John Harris
    John Harris uses TypeScriptTypeScript

    Excellent design-time type checking and the ability for the Typescript compiler to attach typing information to metadata at compile time allows for relatively simple type checking at run-time as well.

    Avatar of Blood Bot
    Blood Bot uses TypeScriptTypeScript

    We, our team can sleep comfortable at night know "x is undefined" will not occur in production. It's also really helpful as IDE help in code completion when they know types.

    How much does PHP cost?
    How much does TypeScript cost?
    Pricing unavailable
    Pricing unavailable