[ create a new paste ] login | about

Link: http://codepad.org/Ji41VoBF    [ raw code | output | fork ]

PHP, pasted on Mar 17:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
 
class A {
  public $v;
 
  public function __construct($v) {
    $this->v = $v;
  }
}

$b = range(0, 9);
for ($i=0; $i<10; $i++) {
  $b[$i] = new A($i);
  echo 'memory:', memory_get_usage(), "\n";
}


Output:
1
2
3
4
5
6
7
8
9
10
memory:45992
memory:46240
memory:46420
memory:46600
memory:46780
memory:46960
memory:47140
memory:47320
memory:47500
memory:47688


Create a new paste based on this one


Comments: