Try this code instead:
<?php
error_reporting(E_ALL);
$Variable = "2";
settype($Change, "integer");
echo gettype($Change);
echo $Change;
?>
Don't you want $Variable to be $Change on the line: $Variable = "2";
Meaning, $Change = "2";
Hope that helps,
Joshua Hoover
> Hi
>
> This is from code I downloaded that goes with Professional PHP4 book
> When I run it I get error listed below. Is there something wrong here or my
> configuration, etc?
>
> I have got another error with other code and it has to with closing tag ?>,
> each time I check it the closing tag is correct but get parsing error.
>
> In case its relevant I'm running XP PRO, Apache 1.3.23
>
> <?php
>
> error_reporting(E_ALL);
>
> $Variable = "2";
> settype($Change, integer);
> echo gettype($Change);
> echo $Change;
>
> ?>
>
> Warning: Use of undefined constant integer - assumed 'integer' in c:\program
> files\apache group\apache\htdocs\prophp4\ch03\variable.php on line 6
> integer0
>
> Thanks
>