<?php
$a = 3;
echo 'typeof $a is : ' . gettype($a) . "\n";
$b = &$a;
echo 'typeof $b es : ' . gettype($b) . "\n";
$c = new stdClass;
$c->name = "charles";
$b = $c;
$b->name = "bill";
echo '$c->name : ' . $c->name . "\n";
echo 'typeof $b es : ' . gettype($b) . "\n";
echo 'typeof $a is : ' . gettype($a) . "\n";
echo 'The value of $a is : ' . $a->name;
?>
Conclusion:
typeof $a is : integer
typeof $b is : integer
$c->name : bill
typeof $b is : object
typeof $a is : object
The value of $a is : bill
source
share