Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

var_dump(3) [php man page]

VAR_DUMP(3)								 1							       VAR_DUMP(3)

var_dump - Dumps information about a variable

SYNOPSIS
void var_dump (mixed $expression, [mixed $...]) DESCRIPTION
This function displays structured information about one or more expressions that includes its type and value. Arrays and objects are explored recursively with values indented to show structure. All public, private and protected properties of objects will be returned in the output unless the object implements a __debugInfo() method (implemented in PHP 5.6.0). Tip As with anything that outputs its result directly to the browser, the output-control functions can be used to capture the output of this function, and save it in a string (for example). PARAMETERS
o $expression - The variable you want to dump. RETURN VALUES
No value is returned. EXAMPLES
Example #1 var_dump(3) example <?php $a = array(1, 2, array("a", "b", "c")); var_dump($a); ?> The above example will output: array(3) { [0]=> int(1) [1]=> int(2) [2]=> array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" } } <?php $b = 3.1; $c = true; var_dump($b, $c); ?> The above example will output: float(3.1) bool(true) SEE ALSO
print_r(3), debug_zval_dump(3), var_export(3), __debugInfo(). PHP Documentation Group VAR_DUMP(3)

Check Out this Related Man Page

SPLOBJECTSTORAGE(3)							 1						       SPLOBJECTSTORAGE(3)

The SplObjectStorage class

INTRODUCTION
The SplObjectStorage class provides a map from objects to data or, by ignoring data, an object set. This dual purpose can be useful in many cases involving the need to uniquely identify objects. CLASS SYNOPSIS
SplObjectStorage SplObjectStorageCountableIteratorSerializableArrayAccess Methods o public void SplObjectStorage::addAll (SplObjectStorage $storage) o public void SplObjectStorage::attach NULL (object $object, [mixed $data]) o public bool SplObjectStorage::contains (object $object) o public int SplObjectStorage::count (void ) o public object SplObjectStorage::current (void ) o public void SplObjectStorage::detach (object $object) o public string SplObjectStorage::getHash (object $object) o public mixed SplObjectStorage::getInfo (void ) o public int SplObjectStorage::key (void ) o public void SplObjectStorage::next (void ) o public bool SplObjectStorage::offsetExists (object $object) o public mixed SplObjectStorage::offsetGet (object $object) o public void SplObjectStorage::offsetSet NULL (object $object, [mixed $data]) o public void SplObjectStorage::offsetUnset (object $object) o public void SplObjectStorage::removeAll (SplObjectStorage $storage) o public void SplObjectStorage::removeAllExcept (SplObjectStorage $storage) o public void SplObjectStorage::rewind (void ) o public string SplObjectStorage::serialize (void ) o public void SplObjectStorage::setInfo (mixed $data) o public void SplObjectStorage::unserialize (string $serialized) o public bool SplObjectStorage::valid (void ) EXAMPLES
Example #1 SplObjectStorage as a set <?php // As an object set $s = new SplObjectStorage(); $o1 = new StdClass; $o2 = new StdClass; $o3 = new StdClass; $s->attach($o1); $s->attach($o2); var_dump($s->contains($o1)); var_dump($s->contains($o2)); var_dump($s->contains($o3)); $s->detach($o2); var_dump($s->contains($o1)); var_dump($s->contains($o2)); var_dump($s->contains($o3)); ?> The above example will output: bool(true) bool(true) bool(false) bool(true) bool(false) bool(false) Example #2 SplObjectStorage as a map <?php // As a map from objects to data $s = new SplObjectStorage(); $o1 = new StdClass; $o2 = new StdClass; $o3 = new StdClass; $s[$o1] = "data for object 1"; $s[$o2] = array(1,2,3); if (isset($s[$o2])) { var_dump($s[$o2]); } ?> The above example will output: array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } PHP Documentation Group SPLOBJECTSTORAGE(3)
Man Page