Can any one explain what this php Code dose?

class MyDB extends SQLite3
{
    function __construct()
    {
        $this->open('test.db');
    }
}
$db = new MyDB();
if (!$db) {
    echo $db->lastErrorMsg();
   
} else {
    echo "Opened database successfully\n";
}
vishnu kalakotaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
It calls the $this->open() method on the existing class when the class is instantiated, passing the name 'test.db' to the method as an argument for the open() method.  It does not return anything, so the test for the !$db return value is probably useless.  This code should exist in some kind of larger context where we might be able to understand the "bigger picture."

If you're new to PHP and want to learn the language, this article can help you find good learning resources.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html

If you know some PHP and want to learn what to avoid, this article can help you with the things you should not do.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_12293-AntiPHPatterns-and-AntiPHPractices.html

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vishnu kalakotaAuthor Commented:
Thank YOu SIR
Ray PaseurCommented:
Thanks for the points, and thanks for using E-E! ~Ray
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.