PageRenderTime 34ms CodeModel.GetById 10ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/zend/bad/ext/spl/tests/array_003.php

http://github.com/facebook/hiphop-php
PHP | 35 lines | 23 code | 9 blank | 3 comment | 0 complexity | 376ff90372a2b5652abc38b0f9381229 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?php
  2. // This test also needs to exclude the protected and private variables
  3. // since they cannot be accessed from the external object which iterates
  4. // them.
  5. class test
  6. {
  7. public $pub = "public";
  8. protected $pro = "protected";
  9. private $pri = "private";
  10. function __construct()
  11. {
  12. $this->imp = "implicit";
  13. }
  14. };
  15. $test = new test;
  16. $test->dyn = "dynamic";
  17. print_r($test);
  18. $object = new ArrayObject($test);
  19. print_r($object);
  20. foreach($test as $key => $val)
  21. {
  22. echo "$key => $val\n";
  23. }
  24. ?>
  25. ===DONE===
  26. <?php exit(0); ?>