When comparing Scratch vs PHP, the Slant community recommends Scratch for most people. In the question“What is the best programming language to learn first?” Scratch is ranked 25th while PHP is ranked 35th. The most important reason people chose Scratch is:
Code is represented as [visual building blocks](http://www.instructables.com/id/How-to-use-Scratch/) that makes it easy to understand how a program is put together.
Ranked in these QuestionsQuestion Ranking
Code is represented as visual building blocks that makes it easy to understand how a program is put together.
Pro Great starting point for kids
Scratch was developed specifically for kids ages 8 and up as an exciting way to introduce them to technology. It's designed to be easy to learn, but still provides good depth in computational thinking.
Pro Easy to learn
Scratch is designed to teach computational thinking rather than focus on specific syntax. It was designed specifically to be easy to learn for anyone over the age of 8.
Pro No need to be able to type
Pro Can be used to create games
Pro Highly structured
The language is highly structured. Therefore, it gives you the essentials of how to think like a programmer and teaches you good programming practices from early on, so you could write clean, working and readable code in the future.
Pro One of the most common languages
According to the 2015 Stack Overflow Developer Survey (26,086 people surveyed), PHP was the 5th most popular/used language at 29.7%.
Pro Lots of tutorials online
Pro Used by most common CMS platforms
Many clients are looking for an easy-to-update web site that's flexible and free. Drupal and Wordpress fill those needs very well.
Pro Most prominent language for web applications
Part of the de facto standard web application stack.
Pro Great third-party package manager
PHP standard library is somewhat subpar, but if you need plugins, language features, composer has them all( you can even puzzle together a custom framework from composer).
Since 7.x was released, PHP has become a pretty fast language.
Pro Lots of PHP frameworks available which help with development
PHP people love frameworks, and with frameworks such as Laravel, you can build a web app or API really fast (Facades, ORMs, scaffolding etc.)
Pro Great documentation
Con Does not teach you programming
Learning Scratch might help you if you have high difficulty with logical thinking. However, starting with a proper programming language, especially an easy one, will give you the benefits of starting with something like Scratch and everything else.
Con Won't get you a job
Scratch is not a language used in the workplace. Instead it teaches computational thinking, helping to create a foundation to aid in learning other languages.
Con Poorly designed language
Despite its widespread use, PHP is generally looked upon poorly from a design point of view. The consistency of function names and function argument order, lazily and borderline non-functional implementation of object oriented programming, can only receive requests via POST methods, slow version adoption (the PHP you learn right now may not work on every webserver you'll work on), and a focus on "hacking things together" rather than "doing it right". These are all very common complaints when it comes to working with PHP. While not a bad language to learn, PHP is not at all a good language to learn first, as it will probably teach bad habits.
Con Immense catalog of insecure frameworks
The most serious security problems in websites on the web today are almost universally found in popular PHP frameworks, CMS platforms, libraries and code samples, almost all stemming from poor language design, bad tutorials and awful resources.
Con Most tutorials are out of date
A lot of very bad tutorials are still widely circulated among beginners, and these tutorials teach very poor programming practices.
Con Most resources are poorly-written
Few resources exemplify the "correct" or secure use of features.
Con Interpreter being too permissive
If you forget the dollar sign, the variable name will be converted to a string.