Skip to content

Instantly share code, notes, and snippets.

@Scriptor
Created September 21, 2013 23:44
Show Gist options
  • Save Scriptor/6655293 to your computer and use it in GitHub Desktop.
Save Scriptor/6655293 to your computer and use it in GitHub Desktop.
<?php
class A {
public $foo = 1;
public $bar = 2;
public $veryverylongattrnamethatisridiculouslylongthankyouautocomplete = 3;
}
$a = new A;
$b = new SplFixedArray(3);
$b[0] = 1;
$b[1] = 2;
$b[2] = 3;
$c = array(
1, 2, 3
);
$var = null;
$start = microtime(TRUE);
for($x=0; $x<20000000; $x++) {
$a->foo;
//$a->veryverylongattrnamethatisridiculouslylongthankyouautocomplete;
//$b[1];
}
$duration = microtime(TRUE) - $start;
echo ($duration*1000)."\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment