You are here: object id « PHP Language « IT news, forums, messages
object id

Posted by Peter Pei on 01/08/08 03:59

I am reading a PHP5 book for fun. The book gives the attached code, which
supposed to print object id, but throw exception in 5.2.5. I assume that
this can be resolved by defining __toString() method. My question is when
this stopped working (which version)?

<?php

class ShopProduct {
}

$product1 = new ShopProduct();
$product2 = new ShopProduct();
print "$product1\n";
print "$product2\n";

?>

Well I can use ver_dump to see id any way...

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация