1.object are the instance of user-defined classes that can store both values and function
2.They must be explicitly declared
<?php
class fruit {
function sample() {
$fruit_name = "apple";
echo "Bike Model: " .$ fruit_name;
}
}
$obj = new fruit ();
$obj -> sample();
?>
PHP Resource
1.Resources are not the exact data type in PHP
2.these are used to store some function calls or references to external PHP resources
For example - a database call. It is an external resource.
3. PHP Null
Null is a special data type which can have only one value: NULL.
4.A variable of data type NULL is a variable that has no value assigned to it
Example:
<!DOCTYPE html>
<html>
<body>
<?php
$x = "Hello world!";
$x = null;
var_dump($x);
?>
</body>
</html>
output
NULL
0 Comments