]> git.mjollnir.org Git - moodle.git/commitdiff
Better way to detect whether a function exists in this version of PHP before redefini...
authortjhunt <tjhunt>
Tue, 3 Apr 2007 08:34:39 +0000 (08:34 +0000)
committertjhunt <tjhunt>
Tue, 3 Apr 2007 08:34:39 +0000 (08:34 +0000)
lib/weblib.php

index 45d7d2ecb198c6f16e241aecbb136e9a7b5f1a81..36b2c71d0b5c422b32eee28bb2cb10cbf87a75a8 100644 (file)
@@ -4981,7 +4981,7 @@ function notice_yesno ($message, $linkyes, $linkno, $optionsyes=NULL, $optionsno
  * Provide an definition of error_get_last for PHP before 5.2.0. This simply 
  * returns NULL, since there is not way to get the right answer.
  */
-if (!version_compare(phpversion(), '5.2.0') >= 0) {
+if (!function_exists('error_get_last')) {
     // the eval is needed to prevent PHP 5.2+ from getting a parse error!
     eval('
         function error_get_last() {