ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Why PHP 5 Rocks!
Subject:   some questions
Date:   2004-08-16 13:15:05
From:   GassertH
Response to: some questions

I'm no expert of Ruby or Smalltalk, but I'll try to answer. I think the PHP5 developers thought much more of Java (Sun is becoming an important PHP player..) than of these other languages. Let's not judge that for the moment ,)
PHP, and let's state that clearly, is not an object-oriented language _only_. The majority of its user base most probably does not use OOP. The new OO-features are a step forwards, but certainly a pragmatic user-focused one. Do not look for "highbrow" OO-theoretic stuff in PHP. Consequence: I could directly write a big NO as an overall answer here :)


# - are classes objects ?
There is no class "class", if you mean that. But with the new Reflection API and by the means of "$o = new $someClassName();" you should be able to do most of the things you could do with the class "class" in Java.
I think you could say there are no metaclasses.


# are classes locked or open (like ruby,smalltalk)?
I guess they're locked, I do no know of a way to alter a loaded class. Not sure if I understand the question, though.


# can you define your own metaclasses or
No metaclasses, I still think


# can you control the allocation+initialization of an object?
no. no object-oriented/-aware way to deal with things like memory usage and time consumption.


# can you do mixin programming in php5 ?
there's only "ordinary" inheritance.


# how good is the performance of runtime class checking of arguments to methods?
define "good" while I do a little benchmarking :)


# there are nifty tricks to make it faster than an attribute lookup at any call?
I did not understand this question? What do you refer to by "it"?



1 to 1 of 1
  1. some questions
    2004-08-22 08:24:46  GassertH [View]

1 to 1 of 1