Advertisement
Guest User

Untitled

a guest
Aug 28th, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. class A {
  4.  
  5. private $x;
  6. private $y;
  7.  
  8. public function set_x($x) {
  9. $this->x = $x;
  10. }
  11.  
  12. public function set_y($y) {
  13. $this->y = $y;
  14. }
  15.  
  16. }
  17.  
  18.  
  19. $start_time = microtime(TRUE);
  20.  
  21. for ($i = 0; $i < 5000000; ++$i) {
  22.  
  23. $a = new A();
  24. $a->set_x('x');
  25. $a->set_y('y');
  26.  
  27. unset($a);
  28.  
  29. }
  30.  
  31. $end_time = microtime(TRUE);
  32.  
  33. echo $end_time - $start_time . PHP_EOL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement