<?php
class foo
{
function bar()
{
static $a = 0;
return $a++;
}
}
$a = new foo();
$b = new foo();
PD9waHAKCmNsYXNzIGZvbwp7CmZ1bmN0aW9uIGJhcigpCnsKc3RhdGljICRhID0gMDsKCnJldHVybiAkYSsrOwp9Cn0KCiRhID0gbmV3IGZvbygpOwp2YXJfZHVtcCgkYS0+YmFyKCkpOwp2YXJfZHVtcCgkYS0+YmFyKCkpOwp2YXJfZHVtcCgkYS0+YmFyKCkpOwoKJGIgPSBuZXcgZm9vKCk7CnZhcl9kdW1wKCRiLT5iYXIoKSk7