standard class $stdObject = new stdClass(); var_dump($stdObject); // output: object(stdClass)[1] # defining an object typed Foo class Foo {} $foo = new Foo(); var_dump($foo); // output: object(Foo)[2] # defining an empty array $array = array(); var_dump($array); // output: array {empty} /* * an array with non-integer key is also considered as an associative array(i.e. hash table) * can contain mixed variable types, can contain integer based keys and non-integer keys */ $assoc = array( 0 => $int, 'integer' => $int, 1 => $float, 'float' => $float, 2 => $string, 'string' => $string, 3 => NULL, // <=== key 3 is NULL 3, // <=== this is a value, not a key (key is 4) 5 => $stdObject, 'Foo' => $foo, ); var_dump($assoc); // output: // ======= // array // 0 => int 0 // 'integer' => int 0 // 1 => float 0.01 // 'float' => float 0.01 // 2 => string 'string' (length=6) // 'string' => string 'string' (length=6) // 3 => null // 4 => int 3 // 5 => // object(stdClass)[1] // 'Foo' => // object(Foo)[2] /* * all variables are "global" but not reachable inside functions(unless specifically "globalized" inside) */ function a_function() { # not reachable var_dump(isset($foo)); // output: boolean false global $foo; # "global" (reachable) inside a_function()'s scope var_dump(isset($foo)); // output: boolean true } a_function(); /** * there is another special type of variable called (Resource). * for more info regarding Resources: * @url http://php.net/manual/en/language.types.resource.php * @url http://php.net/manual/en/resource.php */