PHP code example of web-fu / proxy

1. Go to this page and download the library: Download web-fu/proxy 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/ */

    

web-fu / proxy example snippets


$element = [
    'foo' => 'bar',
    'zod' => [
        'baz' => 'qux',
    ],
];

$proxy = new Proxy($element);

echo $proxy->get('foo'); //bar
$proxy->set('foo', 'baz');
echo $element['foo']; //baz

echo $proxy->has('foo'); //true
echo $proxy->isInitialised('foo'); //true
echo $proxy->dynamicKeysAllowed(); //true;

$proxy->create('rol', 'foo');
echo $element['rol']; //foo

$proxy->unset('zod');
var_dump($element); //['foo' => 'bar']

$proxy->getProxy('zod')->set('baz', 'qux');
echo $element['zod']['baz']; //qux