PageRenderTime 36ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/slow/array_object/exchangeArray.php

http://github.com/facebook/hiphop-php
PHP | 13 lines | 7 code | 3 blank | 3 comment | 0 complexity | d35e758259ad15f57502a8c537cf037e 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. // Array of available fruits
  3. $fruits = array("lemons" => 1, "oranges" => 4, "bananas" => 5, "apples" => 10);
  4. // Array of locations in Europe
  5. $locations = array('Amsterdam', 'Paris', 'London');
  6. $fruitsArrayObject = new ArrayObject($fruits);
  7. // Now exchange fruits for locations
  8. $old = $fruitsArrayObject->exchangeArray($locations);
  9. print_r($old);
  10. print_r($fruitsArrayObject);