fork download
  1. <?php
  2.  
  3. $title = 0;
  4. $squad = 0;
  5. $level = 0;
  6.  
  7. function has_same_value($array, $value) {
  8. return array_reduce($array, function ($carry, $item) use ($value) {
  9. return $carry && ($item == $value);
  10. }, true);
  11. }
  12.  
  13. $resultado = has_same_value([$title, $squad, $level], 0);
  14.  
  15. var_dump( $resultado );
Success #stdin #stdout 0.02s 23856KB
stdin
Standard input is empty
stdout
bool(true)