Skip to content

Instantly share code, notes, and snippets.

@bulton-fr
Last active November 21, 2015 15:54
Show Gist options
  • Save bulton-fr/182e0949594547256951 to your computer and use it in GitHub Desktop.
Save bulton-fr/182e0949594547256951 to your computer and use it in GitHub Desktop.
Time to call parent class
<?php
class Foo
{
//somes attributes and methods
public function display()
{
//somes actions...
}
}
class Bar extends Foo
{
//somes attributes and methods
public function display()
{
parent::display();
}
}
$bar = new Bar;
$bar->display(); //Time 0.3sec
<?php
class Foo
{
//somes attributes and methods
public function display()
{
//somes actions...
}
}
class Bar extends Foo
{
//somes attributes and methods
}
$bar = new Bar;
$bar->display(); //Time 1.2sec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment