Skip to content

Commit 629d375

Browse files
committed
Remove default parameter value of is_php()
It was simply pointless.
1 parent 8e814ee commit 629d375

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

system/core/Common.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@
5151
* @param string
5252
* @return bool TRUE if the current version is $version or higher
5353
*/
54-
function is_php($version = '5.3.0')
54+
function is_php($version)
5555
{
5656
static $_is_php;
5757
$version = (string) $version;
5858

5959
if ( ! isset($_is_php[$version]))
6060
{
61-
$_is_php[$version] = (version_compare(PHP_VERSION, $version) >= 0);
61+
$_is_php[$version] = version_compare(PHP_VERSION, $version, '>=');
6262
}
6363

6464
return $_is_php[$version];

user_guide_src/source/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ Release Date: Not Released
480480
- Added function :func:`function_usable()` to work around a bug in `Suhosin <http://www.hardened-php.net/suhosin/>`.
481481
- Removed the third (`$php_error`) argument from function :func:`log_message()`.
482482
- Changed internal function ``load_class()`` to accept a constructor parameter instead of (previously unused) class name prefix.
483+
- Removed default parameter value of :func:`is_php()`.
483484

484485
- :doc:`Output Library <libraries/output>` changes include:
485486

user_guide_src/source/general/common_functions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ loading any libraries or helpers.
1313

1414
<div class="custom-index container"></div>
1515

16-
.. function:: is_php([$version = '5.3.0'])
16+
.. function:: is_php($version)
1717

1818
:param string $version: Version number
1919
:returns: TRUE if the running PHP version is at least the one specified or FALSE if not
2020
:rtype: bool
2121

22-
Determines of the PHP version being used is greater than the
22+
Determines if the PHP version being used is greater than the
2323
supplied version number.
2424

2525
Example::

0 commit comments

Comments
 (0)