Juggling means

throwing and catching several objects simultaneously.

Type Juggling in php  means automatically type conversion.

That is to say, if a string value is assigned to variable $var$var becomes a string. If an integer  value is assigned to $var, it becomes an integer.

Please see Example.

  1. <?php
  2. $var = “0”; // $var is string (ASCII 48)
  3. $var += 10; // $var is now an integer (10)
  4. $var = $foo+ 1.5; // $var is now a float (11.5)
  5. $var = 5 + “10 Little hots”; // $var is integer (15)
  6. $var = 5 + “10 Small hots”; // $var is integer (15)
  7. ?>

$var variable comes many times in different data type.

Often it became interger, float.

This is Type Juggling in php.

Thank you

eXTReMe Tracker