3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dtype; echo "The data type of variable is " . gettype($dtype) . "<br>"; $dtype = 15; //assigning int data type echo "The data type of variable is " . gettype($dtype) . "<br>"; $dtype = 15.55; //assigning double data type echo "The data type of variable is " . gettype($dtype) . "<br>"; $dtype = "Pakistan"; //assigning string data type echo "The data type of variable is now " . gettype($dtype) . "<br>"; $dtype = true; //assigning bolean data type echo "The data type of variable is now " . gettype($dtype) . "<br>"; echo "<br>"; $myvar = 100; echo "The data type of variable is " . gettype($myvar) . "<br>"; //getting variable type settype($myvar,"string"); echo "Now the variable type is " . gettype($myvar); ?>
Output for 5.4.0 - 5.4.14
Parse error: syntax error, unexpected 'settype' (T_STRING) in /in/TdWTY on line 27
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected T_STRING in /in/TdWTY on line 27
Process exited with code 255.

preferences:
186.6 ms | 1395 KiB | 47 Q