php  IHDRwQ)Ba pHYs  sRGBgAMA aIDATxMk\Us&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨG;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j-$_q?qSXzG'ay

PAL.C.T MINI SHELL
files >> /php-7.1.11/Zend/tests/anon/
upload
files >> //php-7.1.11/Zend/tests/anon/005.phpt

--TEST--
testing reusing anons that implement an interface
--FILE--
<?php
class Outer {
    protected $data;

    public function __construct(&$data) {
        /* array access will be implemented by the time we get to here */
        $this->data = &$data;
    }

    public function getArrayAccess() {
        /* create a child object implementing array access */
        /* this grants you access to protected methods and members */
        return new class($this->data) implements ArrayAccess {
            public function offsetGet($offset) { return $this->data[$offset]; }
            public function offsetSet($offset, $data) { return ($this->data[$offset] = $data); }
            public function offsetUnset($offset) { unset($this->data[$offset]); }
            public function offsetExists($offset) { return isset($this->data[$offset]); }
        };
    }
}

$data = array(
    rand(1, 100),
    rand(2, 200)
);

$outer = new Outer($data);
$proxy = $outer->getArrayAccess();

/* null because no inheritance, so no access to protected member */
var_dump(@$outer->getArrayAccess()[0]);
--EXPECT--
NULL
y~or5J={Eeu磝QkᯘG{?+]ן?wM3X^歌>{7پK>on\jyR g/=fOroNVv~Y+NGuÝHWyw[eQʨSb>>}Gmx[o[<{Ϯ_qF vMIENDB`