P r/PHPu/rojaro25 Jun 2012 PRADO 3.2.0 has just been released! pradoframework.com 2 points1 commentsSaveSavedHideCopy linkHideCopy linkOpen on Reddit
on PHP Moronic Monday (09-03-2015) in r/PHProjaro9 Mar 2015 Just create a simple PHP file like this example: <?php return [ 'foo' => 'bar' ]; Use it like this: $config = include 'path/to/file.phjp'; The file will be cached by the opcode cache you're using and you can combine the approach with a database backend by automatically regenerating the file whenever you're inserting/updating/deleting a value from your configuration table i.e.: file_put_contents('path/to/config.php', '<?php return ' . var_export($config, true) . ';'); 9 pointsCopy link
on Is it possible to use a function as a default value for a function argument? in r/PHProjaro3 Dec 2010 Nope. The PHP manual states "The default value must be a constant expression, not (for example) a variable, a class member or a function call.". http://www.php.net/manual/en/functions.arguments.php#functions.arguments.default 9 pointsCopy link
on Best way to select multiple separate IDs in r/PHProjaro14 Jul 2011 This is much worse: $size_of_array = $size_of_array + $size_of_array; 8 pointsCopy link
on Guess who sponsored our desert today at Montreal's ConFoo in r/PHProjaro10 Mar 2011 Pacman? 8 pointsCopy link
on could this be written better in r/PHProjaro23 Mar 2012 function minutes_to_hhmm($minutes) { return sprintf('%02u:%02u', floor($minutes / 60), floor($minutes % 60)); } 7 pointsCopy link
Just create a simple PHP file like this example:
Use it like this:
The file will be cached by the opcode cache you're using and you can combine the approach with a database backend by automatically regenerating the file whenever you're inserting/updating/deleting a value from your configuration table i.e.:
Nope. The PHP manual states "The default value must be a constant expression, not (for example) a variable, a class member or a function call.".
http://www.php.net/manual/en/functions.arguments.php#functions.arguments.default
This is much worse:
Pacman?