• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 408
  • Last Modified:

built in php objects

from a lynda.com tutorial
how could I learn more about this subject matter,
I think it is built in php objects

this is the transcript
00:00	In this chapter, I'm going to explore built-in PHP objects.
00:04	I'll start with the standard class, which is pretty generic,
00:07	then demonstrate how to get objects from the database.
00:10	We'll handle errors in an object-oriented way, then customize them to meet our needs.
00:14	Let's start with the standard class.
00:16	A standard class is a generic class that can be created by typecasting a value
00:20	as an object, like casting the string "hello, world" as an object.
00:24	It won't have any methods, but it will have values.
00:27	In case you were wondering, if you typecast an object to an object, that's kind of
00:31	goofy, and nothing will happen.
00:34	If you typecast that array to an object, the result will be an object with
00:37	properties named for the keys to the array, with values corresponding to the array values.
00:43	Let's clean up the demo, and remove the cloning tests.
00:46	Create a test standard class object out of a nested array.
00:51	Echo <h2> Testing typecasting to an object>.
01:01	$test_object = (object). This is the typecasting. array. hello as the key and
01:10	world as the value. Then nested as an array ( 'key => value').
01:24	Then, debug the test object.
01:29	Save, then refresh your browser.
01:33	The result will be a standard class with properties "hello" and "nested," with nested
01:37	containing an array.
01:39	If I was to typecast any other data type like a string, the value would be
01:43	converted to a standard object, with one property named scalar.
01:47	Return to the demo, and replace the array definition with the number 12345. Save, and refresh.
02:00	The test object now has one property, scalar, with the value 12345.
02:07	Standard class objects are practically used in a number of ways.
02:10	For example, returning a defined data structure with fixed branches without nesting.
02:16	Sometimes, it's used as a shorthand to speed code development, as it takes less
02:20	characters to access a property than it does to specify a key.
02:24	Finally, you can use a standard object when interacting with a method that is
02:28	looking for an object with particular properties, but isn't actually
02:31	checking for the class.
02:33	In the next video, I will show you how to load objects directly from the
02:37	database, then intelligently load addresses from the database into the
02:40	correct class.

Open in new window

2 Solutions
Loganathan NatarajanLAMP DeveloperCommented:
You can refer the built in "object" method in php website ,http://www.php.net/manual/en/language.types.object.php

It is similar way what they trying to explain,
Ray PaseurCommented:
This is a reference you might want to have at your elbow at all times.  I do.

This book is pretty good, too (most things from SitePoint are good).
rgb192Author Commented:
thanks for object tutorials
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now