diff -Naur rrdtool.ori/php_rrdtool.h rrdtool/php_rrdtool.h
--- rrdtool.ori/php_rrdtool.h	2005-11-26 17:56:52.000000000 +1100
+++ rrdtool/php_rrdtool.h	2010-02-08 06:04:53.000000000 +1100
@@ -49,6 +49,7 @@
 PHP_FUNCTION(rrd_clear_error);
 PHP_FUNCTION(rrd_update);
 PHP_FUNCTION(rrd_last);
+PHP_FUNCTION(rrd_lastupdate);
 PHP_FUNCTION(rrd_create);
 PHP_FUNCTION(rrdtool_info);
 PHP_FUNCTION(rrdtool_logo_guid);
diff -Naur rrdtool.ori/rrdtool.c rrdtool/rrdtool.c
--- rrdtool.ori/rrdtool.c	2005-12-04 00:34:06.000000000 +1100
+++ rrdtool/rrdtool.c	2010-02-09 00:12:39.000000000 +1100
@@ -46,6 +46,7 @@
 	PHP_FE(rrd_clear_error,			NULL)
 	PHP_FE(rrd_update,				NULL)
 	PHP_FE(rrd_last,				NULL)
+	PHP_FE(rrd_lastupdate,			NULL)
 	PHP_FE(rrd_create,				NULL)
 	PHP_FE(rrdtool_info,			NULL)
 	PHP_FE(rrdtool_logo_guid,		NULL)
@@ -440,7 +441,85 @@
 }
 /* }}} */
 
-/* {{{ proto int rrd_create(string file, array args_arr, int argc)
+/* {{{ proto int rrd_lastupdate(string file)
+ Gets last update of an RRD file */
+PHP_FUNCTION(rrd_lastupdate)
+{
+    pval *file;
+    char    **ds_names;
+    char    **data;
+    unsigned long ds_cnt, i;
+    time_t    retval;
+	pval *p_ds_cnt;
+	zval *p_ds_names, *p_data;
+    
+    char **argv = (char **) emalloc(3 * sizeof(char *));
+    
+    if ( rrd_test_error() )
+        rrd_clear_error();
+    
+    if (zend_get_parameters(ht, 1, &file) == SUCCESS)
+    {
+        convert_to_string(file);
+        
+        argv[0] = "dummy";
+        argv[1] = estrdup("lastupdate");
+        argv[2] = estrdup(file->value.str.val);
+        
+        optind = 0; opterr = 0;
+        
+        if ((retval = rrd_lastupdate_s (2, &argv[1], &ds_cnt, &ds_names, &data)) != -1 )
+        {
+            array_init(return_value);
+			add_assoc_long(return_value, "last", (long) retval);
+            add_assoc_long(return_value, "ds_cnt", ds_cnt);
+            
+            MAKE_STD_ZVAL(p_ds_names);
+            MAKE_STD_ZVAL(p_data);
+            array_init(p_ds_names);
+            array_init(p_data);
+            
+            if (ds_names)
+            {
+                for (i = 0; i < ds_cnt; i++)
+                {
+                    add_next_index_string(p_ds_names, ds_names[i], 1);
+                    free(ds_names[i]);
+                }
+                free(ds_names);
+            }
+            
+            if (data)
+            {
+                for (i = 0; i < ds_cnt; i++)
+                {
+                    add_next_index_string(p_data, data[i], 1);
+                    free(data[i]);
+                }
+                free(data);
+            }
+            
+            zend_hash_update(return_value->value.ht, "ds_namv", sizeof("ds_namv"), 
+                             (void *)&p_ds_names, sizeof(zval *), NULL);
+            zend_hash_update(return_value->value.ht, "data", sizeof("data"), 
+                             (void *)&p_data, sizeof(zval *), NULL);
+        }
+        else
+        {
+            RETVAL_FALSE;
+        }
+        efree(argv[1]);  efree(argv[2]);
+        efree(argv);
+    }
+    else
+    {
+        WRONG_PARAM_COUNT;
+    }
+    return;
+}
+/* }}} */
+
+    /* {{{ proto int rrd_create(string file, array args_arr, int argc)
 	Create an RRD file with the options passed (passed via array) */ 
 PHP_FUNCTION(rrd_create)
 {

