Speed up development with full-stack environments for every branch.

Learn More

Basic Reflection example [PHP]

Forked from Hello World.

368 Runs 1498 Views 244 Copies
Saved

Saved

gtsolutions 373

gtsolutions
published 4 years ago

<pre>
<?php

/*
 * PHP Reflection - Basic Reflection example
 */

class myparent {

    public function foo($bar) {
        // do stuff
    }

}

class mychild extends myparent {

    public $val;

    private function bar(myparent &$baz) {
        // do stuff
    }

    public function __construct($val) {
        $this->val = $val;
    }

}

$reflect = new ReflectionClass('mychild');
echo $reflect;
?>
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).