CSE :: PHP - CS
-
What will be the output of the following PHP code ?
<?php
$one = "one";
$two = "two";
print("$one$two");
?>
-
What will be the output of the following PHP code ?
<?php
$one = "one";
$two = "two";
print($one==$two);
?>
-
What will be the output of the following PHP code ?
<?php
$one = "one";
$two = "one";
print($one == $two);
?>
-
What will be the output of the following PHP code ?
<?php
print("this"."was"."a"."bad"."idea");
?>
-
What will be the output of the following PHP code ?
<?php
define("GREETING", "PHP is a scripting language");
echo $GREETING;
?>
-
What will be the output of the following PHP code ?
<?php
class Constants
{
define('MIN_VALUE', '0.0');
define('MAX_VALUE', '1.0');
public static function getMinValue()
{
return self::MIN_VALUE;
}
public static function getMaxValue()
{
return self::MAX_VALUE;
}
}
echo Constants::getMinValue();
echo Constants::getMaxValue();
?>
-
What will be the output of the following PHP code ?
<?php
define("__LINE__", "PHP is a scripting language");
echo __LINE__;
?>
-
What will be the output of the following PHP code ?
<?php
define('IF', 42);
echo "IF: ", IF;
?>
-
What will be the output of the following PHP code ?
<?php
define("NEW_GOOD_NAME_CONSTANT", "I have a value");
define("OLD_BAD_NAME_CONSTANT", NEW_GOOD_NAME_CONSTANT);
echo NEW_GOOD_NAME_CONSTANT;
echo OLD_BAD_NAME_CONSTANT;
?>
-
What will be the output of the following PHP code ?
<?php
define("VAR_NAME","test");
${VAR_NAME} = "value";
echo VAR_NAME;
echo ${VAR_NAME};
?>