DEV Community

Discussion on: Will PHP save your startup?

Collapse
 
vasilvestre profile image
Valentin Silvestre

Could you please explain why you think that PHP is a script language and not an object language in 7.2+ ?

Considering strict_types, typehint etc ?

Collapse
 
peteraba profile image
Peter Aba

Please open php.net/ and read the very first sentence:
"PHP is a popular general-purpose scripting language that is especially suited to web development."

Whether it has OO features or not is simply irrelevant.

Collapse
 
vasilvestre profile image
Valentin Silvestre

"What it does affect is first that not all of your code will be loaded into memory when a request is served (good), that all of your errors will be runtime errors (bad) and of course that your code will be interpreted on an as-needed basis instead of having it all compiled to byte code or some intermediate language"

Symfony cache isn't a solution to this one problem ?

Thread Thread
 
peteraba profile image
Peter Aba

To clarify, I don't necessarily think that working with a scripting language is "a problem" in itself. It's just a fact. The only problem in the cited part is the runtime errors, and for that your only compensating tool is testing, testing, more testing, a good CI flow and maintaining a healthy log. Plus some more testing.

Don't believe me, just try a simple Go project and see what happens when you break something. It should be obvious within hours... Btw, Go is not free of runtime errors at all, but they occur much less frequently. (Rust is free of them unless you use stuff marked as unsafe...)

Collapse
 
matteojoliveau profile image
Matteo Joliveau

Ruby is a scripting language and yet it is a purely object-oriented one.

Python is a scripting language that like PHP has gain OOP and FP features lately.

Being a scripting language is not tied to the paradigm it follows.