3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class SomeClass{ public $name; public $sname; public $tname; public function __construct($name,$sname,$tname){ $this->name = $name; $this->sname = $sname; $this->tname = $tname; } public function getPerson(){ return $this->name.' '.$this->sname.' '.$this->tname; } } $persons = array(); for($i = 0;$i<1000;$i++){ $persons[] = new SomeClass('test '.$i,'sname test '.$i,'tname test '.$i); } foreach($persons as $k=>$v){ echo $k.' '.$v->getPerson().'<br />'; } ?>