Sobes.tech
Junior — Middle

Can you list the main types of data used in PHP?

sobes.tech AI

Answer from AI

Main types of data in PHP:

  • Integer — whole numbers, for example: 1, -10, 100
  • Float (double) — floating-point numbers, for example: 3.14, -0.01
  • String — sequences of characters, for example: "Hello"
  • Boolean — logical values: true or false
  • Array — ordered or associative collections
  • Object — class instances
  • NULL — a special value indicating the absence of a value
  • Resource — special variables referencing external resources (e.g., database connections)

PHP is dynamically typed, so a variable can change its type during execution.