PHP code example of alecrabbit / php-sneaky-peek

1. Go to this page and download the library: Download alecrabbit/php-sneaky-peek library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alecrabbit / php-sneaky-peek example snippets


class Awesome
{
    private $secret = '1234';
    
    protected function protectedMethod() {
        return 'protected';
    }    
    
    protected static function protectedStaticMethod() {
        return 'protected static';
    }    
}

// ...

peek(new Awesome())->secret; // '1234'
peek(new Awesome())->protectedMethod(); // 'protected'

peek(Awesome::class)->protectedStaticMethod(); // 'protected static'