String in php is a class?

Asked

Viewed 72 times

8

String in java is a special class, where vc can instantiate the object only by assigning a value without using the reserved word new. But in php when we initialize a variable with a text, we can say that we are instantiating an object of the String class?

1 answer

9


Not. In PHP, string is one of the eight primitive types available. When you assign a string to a variable, it is not possible to invoke methods in it. It does not occur autoboxing in a corresponding object type.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.