Jump to content

[SOLVED] Source code for the built in Exception Class


PC Nerd

Recommended Posts

Hi,

 

I've had a look around and im looking for the source code for the Exception class.  I've seen form a number of sources the class design ( ie, a list of member variables and methods) - but I wanted to look at the actual source for the class.

 

Can anyone suggest where this might be?

 

Thanks

Link to comment
Share on other sites

Ok,

Ive run it through Reflection - and it seems that all I get is an output of the classes properties and methods - not the actual source code that was used to create the class.  Is the Exception class written in PHP or is it "built" in the C/C++ in compilation?

 

Thanks

 

 

 

 

 

Ive placed what I get below:

<?php
echo "<pre>";
Reflection::export(new ReflectionClass('Exception'));
echo "</pre>";
?>

DISPLAYS:


Class [  class Exception ] {

  - Constants [0] {
  }

  - Static properties [0] {
  }

  - Static methods [0] {
  }

  - Properties [6] {
    Property [  protected $message ]
    Property [  private $string ]
    Property [  protected $code ]
    Property [  protected $file ]
    Property [  protected $line ]
    Property [  private $trace ]
  }

  - Methods [9] {
    Method [  final private method __clone ] {
    }

    Method [   method __construct ] {

      - Parameters [2] {
        Parameter #0 [  $message ]
        Parameter #1 [  $code ]
      }
    }

    Method [  final public method getMessage ] {
    }

    Method [  final public method getCode ] {
    }

    Method [  final public method getFile ] {
    }

    Method [  final public method getLine ] {
    }

    Method [  final public method getTrace ] {
    }

    Method [  final public method getTraceAsString ] {
    }

    Method [  public method __toString ] {
    }
  }
}

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.