function writeMsg() {
console.log("hello world")
}
WRITEMSG();
// outputs reference error
function writeMsg() {
echo "Hello world";
}
WRITEMSG();
// outputs Hello world
let x = 5;
let y = 3;
function sum() {
console.log(x + y);
}
sum();
//outputs 8 in JavaScript,
$x = 3;
$y = 5;
function sum() {
echo $x + $y;
}
sum();
//outputs error unless declaring variables
$result = "First" && false;
var_dump($result);
result will be 'First', because first executes $result = "First" and next execute AND operator.
Like this: ($result = "First") && false;
$result = "First" AND false;
var_dump($result);
<?php
$my_name = "oto";
$my_weight = 70; //kg
$my_height = 177; //m
$his_name = "guduna";
$his_weight = 77;
$his_height = 200;
if ($my_weight < $his_weight) {
echo "hi is fatter! ";
}
if ($my_height < $his_height) {
echo "hi is taller!";
}