|
Posted by Jerry Stuckle on 10/01/99 12:00
KDawg44 wrote:
> Hi,
>
> I would like to have a function that takes a generic object and takes
> some action on this. Something like,
>
> function AMethod(Object obj) {
> DoSomeStufftotheObject;
> }
>
> then be able to pass various object types in. Is there a way to do
> this in PHP? Do classes automatically inherit from a generic Object
> like in Java?
>
> Thanks.
>
No, there is no generic object in PHP. However, you don't need to
specify what kind of object is being passed, i.e.
function AMethod($obj) {
will take anything (not just objects). And from there you can figure
out what was passed.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|