ReflectionClass::__toString

(PHP 5, PHP 7)

ReflectionClass::__toString锟斤拷锟斤拷 ReflectionClass 锟斤拷锟斤拷锟街凤拷锟斤拷锟侥憋拷示锟斤拷式锟斤拷

说锟斤拷

public ReflectionClass::__toString ( void ) : string

锟斤拷锟斤拷 ReflectionClass 锟斤拷锟斤拷锟街凤拷锟斤拷锟侥憋拷示锟斤拷式锟斤拷

锟斤拷锟斤拷

锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷

锟斤拷锟斤拷值

ReflectionClass 实锟斤拷锟斤拷一锟斤拷锟街凤拷锟斤拷锟斤拷示锟斤拷式锟斤拷

锟斤拷锟斤拷

Example #1 ReflectionClass::__toString() 锟斤拷锟斤拷

<?php
$reflectionClass 
= new ReflectionClass('Exception');
echo 
$reflectionClass->__toString();
?>

锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�

Class [ <internal:Core> class Exception ] {

  - Constants [0] {
  }

  - Static properties [0] {
  }

  - Static methods [0] {
  }

  - Properties [7] {
    Property [ <default> protected $message ]
    Property [ <default> private $string ]
    Property [ <default> protected $code ]
    Property [ <default> protected $file ]
    Property [ <default> protected $line ]
    Property [ <default> private $trace ]
    Property [ <default> private $previous ]
  }

  - Methods [10] {
    Method [ <internal:Core> final private method __clone ] {
    }

    Method [ <internal:Core, ctor> public method __construct ] {

      - Parameters [3] {
        Parameter #0 [ <optional> $message ]
        Parameter #1 [ <optional> $code ]
        Parameter #2 [ <optional> $previous ]
      }
    }

    Method [ <internal:Core> final public method getMessage ] {
    }

    Method [ <internal:Core> final public method getCode ] {
    }

    Method [ <internal:Core> final public method getFile ] {
    }

    Method [ <internal:Core> final public method getLine ] {
    }

    Method [ <internal:Core> final public method getTrace ] {
    }

    Method [ <internal:Core> final public method getPrevious ] {
    }

    Method [ <internal:Core> final public method getTraceAsString ] {
    }

    Method [ <internal:Core> public method __toString ] {
    }
  }
}

锟轿硷拷