Jump to content

newbie question: new AnyClass() kills php


tomca55

Recommended Posts

Newbie (to PHP) with a question about object construction.

 

Whenever I call any constructor, php stops rendering the page. Simple example:

 

<?php

echo "getting started";

$xmlDoc = new DOMDocument(); //but it could be any class, such as ErrorException, or DateTime

echo "but I don't get very far";

?>

 

I tried using ErrorException to find out what was wrong, but this error doesn't get caught - it appears that PHP parsing ceases with the constructor call!

 

Probably a very simple explanation but bless me if I know what it is!

 

thanks

Tom

Link to comment
Share on other sites

Yes, 'getting started' appears - and that's it. there is no closing html or body tag (php is enclosed in html/body tags). As I said it seems to be generic with any constructor call.

 

I think the code itself is simple enough to be benign. probably something to do with the server settings where my site is hosted - I have an email in to our admin, will see.

thanks

Tom

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...