phantom152 Posted December 22, 2009 Share Posted December 22, 2009 Hi All, I have got my codes in PHP 5.0.4 version . Now i am migrating to PHP 5.2.9 Version . In PHP 5.0.4 version In the DAO File i have got "__destruct". In PHP 5.2.9 Version In the DAO Files do i need to change the "__destruct" to "_destruct" Thanking in Advance. Quote Link to comment https://forums.phpfreaks.com/topic/186019-migrating-from-php-504-to-php-529/ Share on other sites More sharing options...
Daniel0 Posted December 22, 2009 Share Posted December 22, 2009 The destructor method name is still __destruct() (with two underscores) in PHP 5.2.9. It's always been like that in all 5.x releases. Things prefixed with double underscores are reserved for what PHP calls "magic" functionality. Quote Link to comment https://forums.phpfreaks.com/topic/186019-migrating-from-php-504-to-php-529/#findComment-982296 Share on other sites More sharing options...
phantom152 Posted December 22, 2009 Author Share Posted December 22, 2009 Hi Thanks for the quick reply. We are facing an error if we keep to __destruct in php 5.2.9. However with _destruct it works in php 5.2.9. Thanking in advance Quote Link to comment https://forums.phpfreaks.com/topic/186019-migrating-from-php-504-to-php-529/#findComment-982301 Share on other sites More sharing options...
Daniel0 Posted December 22, 2009 Share Posted December 22, 2009 What kind of error do you get? Quote Link to comment https://forums.phpfreaks.com/topic/186019-migrating-from-php-504-to-php-529/#findComment-982305 Share on other sites More sharing options...
phantom152 Posted December 22, 2009 Author Share Posted December 22, 2009 The page cannot be displayed . When i change __destruct to _destruct the page is visible. Thanking in Advance Quote Link to comment https://forums.phpfreaks.com/topic/186019-migrating-from-php-504-to-php-529/#findComment-982312 Share on other sites More sharing options...
Daniel0 Posted December 22, 2009 Share Posted December 22, 2009 Try making sure that display_errors is set to "on" and that error_reporting is set to E_ALL. You can do this by placing the following at the top of your script: ini_set('display_errors', true); error_reporting(E_ALL); Then you should be able to get an error message. Quote Link to comment https://forums.phpfreaks.com/topic/186019-migrating-from-php-504-to-php-529/#findComment-982315 Share on other sites More sharing options...
Buddski Posted December 22, 2009 Share Posted December 22, 2009 Im no expert at destructors but my 2 cents (for what its worth): Perhaps there is an error in your destructor causing the site not to work? Giving the function the name _destruct is just the same as naming it 'endmycodenow' it wont be executed unless its called.. Quote Link to comment https://forums.phpfreaks.com/topic/186019-migrating-from-php-504-to-php-529/#findComment-982316 Share on other sites More sharing options...
phantom152 Posted December 28, 2009 Author Share Posted December 28, 2009 Thanks all for your reply... Quote Link to comment https://forums.phpfreaks.com/topic/186019-migrating-from-php-504-to-php-529/#findComment-984863 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.