Exit and Die as Class Methods

Recently I discovered, that you cannot use exit and die as class methodes. For example

<?php
class test{
    public function exit(){
   }
}
?>

You well get a parser error. Well exit and die are php functions, but waht about time()?

<?php
class test2{
    public function 
time(){
   }
}
?>

Has no parser error.

2 comments

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

Datenschutz | Impressum