Last active
August 29, 2015 14:22
-
-
Save ogabrielsantos/ea422ee240629c7292a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// PHP 5.4+ | |
class GenericController | |
{ | |
public $limit = 99999; | |
public final function paginate( | |
$object = null, | |
array $scope = [], | |
array $whitelist = [] | |
) { | |
// Lot of codes | |
echo $this->limit . "\n"; | |
} | |
} | |
class Foo extends GenericController | |
{ | |
public $limit = 500; | |
} | |
class Bar extends GenericController | |
{ | |
} | |
class Baz extends GenericController | |
{ | |
} | |
(new Foo())->paginate(); // Outputs 500 | |
(new Bar())->paginate(); // Outputs 99999 | |
(new Baz())->paginate(); // Outputs 99999 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment