fork(1) download
  1. <?php
  2. class Foo {
  3. public $name;
  4. public $type;
  5.  
  6. public function __construct($name, $type) {
  7. $this->name = $name;
  8. $this->type = $type;
  9. }
  10. }
  11.  
  12. $array[] = new Foo('first', 0);
  13. $array[] = new Foo('second', 0);
  14. $array[] = new Foo('third', 1);
  15. $array[] = new Foo('fourth', 1);
  16.  
  17. $filter = array_search(1, $array, true);
  18.  
  19. print_r($filter);
Success #stdin #stdout 0.02s 24400KB
stdin
Standard input is empty
stdout
Standard output is empty