3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $_field = "abcdefghijklmnopqrstuvwxyz"; public function __get($name) {} } class B { public $_field = "abcdefghijklmnopqrstuvwxyz"; } $a = new A; $start = microtime(true); for ($i = 0; $i < 100000; $i++) $field = $a->_field; $time_taken = microtime(true) - $start; echo 'With get: ' . $time_taken . 's' . PHP_EOL; $b = new B; $start = microtime(true); for ($i = 0; $i < 100000; $i++) $field = $b->_field; $time_taken = microtime(true) - $start; echo 'Without get: ' . $time_taken . 's' . PHP_EOL;

preferences:
34.52 ms | 402 KiB | 5 Q