Annotation of embedaddon/php/ext/spl/tests/array_003.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: ArrayObject from object
! 3: --FILE--
! 4: <?php
! 5:
! 6: // This test also needs to exclude the protected and private variables
! 7: // since they cannot be accessed from the external object which iterates
! 8: // them.
! 9:
! 10: class test
! 11: {
! 12: public $pub = "public";
! 13: protected $pro = "protected";
! 14: private $pri = "private";
! 15:
! 16: function __construct()
! 17: {
! 18: $this->imp = "implicit";
! 19: }
! 20: };
! 21:
! 22: $test = new test;
! 23: $test->dyn = "dynamic";
! 24:
! 25: print_r($test);
! 26:
! 27: $object = new ArrayObject($test);
! 28:
! 29: print_r($object);
! 30:
! 31: foreach($test as $key => $val)
! 32: {
! 33: echo "$key => $val\n";
! 34: }
! 35:
! 36: ?>
! 37: ===DONE===
! 38: <?php exit(0); ?>
! 39: --EXPECTF--
! 40: test Object
! 41: (
! 42: [pub] => public
! 43: [pro:protected] => protected
! 44: [pri:test:private] => private
! 45: [imp] => implicit
! 46: [dyn] => dynamic
! 47: )
! 48: ArrayObject Object
! 49: (
! 50: [storage:ArrayObject:private] => test Object
! 51: (
! 52: [pub] => public
! 53: [pro:protected] => protected
! 54: [pri:test:private] => private
! 55: [imp] => implicit
! 56: [dyn] => dynamic
! 57: )
! 58:
! 59: )
! 60: pub => public
! 61: imp => implicit
! 62: dyn => dynamic
! 63: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>