First, you don't need to pass your variable through print_r, eZDebug::write* do it automatically.
Then... nothing's wrong with the returned values. You're confusing object & node ID. You're fetching the eZContentObject that matches node 64, and it happens that this object's ID is 62. Since multiple nodes can link to the same object, it is expected that they are different.
if your object only has one node, you can check that the value is correct by using:
$noeud->attribute('main_node_id');
Note that $noeud is wrong here, as the object is an object, not a node ;)
Hi Damien
Actually, this property is not static. It means that it is filled by calling a method (attribute() in that case, which is automatically called in templates). So, to have your class name, you should do this :
You can find all the attributes (or properties) available with this method in the objects reference documentation. Also note that, when you find a PHP class extending eZPersistentObject in eZ Publish, just have a look in the definition() static method. You'll find here all attributes you want ;)
Don't be sorry, we were all beginners once ! Anyway, I'm happy you enjoy developping eZ extensions ! You then may want to share them on the projects website ;).
A possibly useful tip: when you look at objects reference pages on the documentation, there is a "Static" column. This indicates wether the value for this attribute is fetched by default (usually a value stored in the SQL table as is), or has to be fetched / computed when requested.