PHP - What is Type juggle in php?

What is Type juggle in php?

Type Juggling means dealing with a variable type. In PHP a variables type is determined by the context in which it is used. If an integer value is assigned to a variable, it becomes an integer.

Example:
$var3= $var1 + $var2

Here, if $var1 is an integer. $var2 and $var3 will also be treated as integers.

What is Type juggle in php?

In order to declare a variable in PHP, the type of the variable is not required. The data type is determined by the value / context of the variable. If integer value is assigned to the variable $num, then the variable $num is of the type integer. If string value is assigned to the variable $str, the variable $str is of the type string.
PHP - What is the difference between mysql_fetch_object and mysql_fetch_array?
PHP - Mysql_fetch_object returns the result from the database as objects while....
PHP - What is Joomla in PHP?
Joomla is an open source content management system.....
PHP - What is the difference between the functions unlink and unset?
PHP - Unlink is a function for file system handling which deletes a file..
Post your comment