Index: wp-includes/load.php
===================================================================
--- wp-includes/load.php	(revision 19532)
+++ wp-includes/load.php	(working copy)
@@ -653,4 +653,86 @@
 	return false;
 }
 
+/**
+ * Set up the php error handler
+ */
+function wp_set_error_handler() {
+	global $wp_php_errors;
+	$wp_php_errors = array();
+	set_error_handler( 'wp_error_handler' );
+	if ( is_admin() )
+		add_action( 'admin_footer', 'wp_show_errors' );
+	else
+		add_action( 'wp_footer', 'wp_show_errors' );
+}
+
+/**
+ * Resolve an error constant to its human readable name
+ * @param int
+ * @return string
+ */
+function wp_error_constant($errno) {
+	$codes = array(
+		E_ERROR             => 'E_ERROR',
+		E_WARNING           => 'E_WARNING',
+		E_PARSE             => 'E_PARSE',
+		E_NOTICE            => 'E_NOTICE',
+		E_CORE_ERROR        => 'E_CORE_ERROR',
+		E_CORE_WARNING      => 'E_CORE_WARNING',
+		E_COMPILE_ERROR     => 'E_COMPILE_ERROR',
+		E_COMPILE_WARNING   => 'E_COMPILE_WARNING',
+		E_USER_ERROR        => 'E_USER_ERROR',
+		E_USER_WARNING      => 'E_USER_WARNING',
+		E_USER_NOTICE       => 'E_USER_NOTICE',
+		E_STRICT            => 'E_STRICT',
+		E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR',
+		E_DEPRECATED        => 'E_DEPRECATED',
+		E_USER_DEPRECATED   => 'E_USER_DEPRECATED',
+	);
+	return isset( $codes[$errno] ) ? $codes[$errno] : $errno;
+}
+
+/**
+ * Show PHP errors
+ */
+function wp_show_errors() {
+	global $wp_php_errors;
+	if ( !is_array( $wp_php_errors ) )
+		$wp_php_errors = array();
+	foreach ( (array) $wp_php_errors as $err) : ?>
+		<div class="error">	
+			<div>
+				<span class="php-errno"><?php echo wp_error_constant($err['errno']); ?></span>
+				<?php echo __('in'); ?>
+				<span class="php-errfile"><?php echo $err['errfile']; ?></span>
+				<?php echo __('on line'); ?>: 
+				<span class="php-errstr"><?php echo $err['errstr']; ?></span>
+			</div>
+		</div>
+		<?php
+	endforeach;
+}
+
+/**
+ * PHP error handler callback
+ * @param int Error code
+ * @param string Error message
+ * @param string File where error occurred
+ * @param int $errline Line number where error occurred
+ * @return void
+ */
+function wp_error_handler($errno, $errstr, $errfile, $errline) {
+	global $wp_php_errors;
+	if ( !is_array( $wp_php_errors ) )
+		$wp_php_errors = array();
+    if ( error_reporting() & $errno ) {
+		$wp_php_errors[] = array(
+			'errno'   => $errno,
+			'errstr'  => $errstr,
+			'errfile' => $errfile,
+			'errline' => $errline
+		);
+	}
+}
+
 ?>
Index: wp-settings.php
===================================================================
--- wp-settings.php	(revision 19532)
+++ wp-settings.php	(working copy)
@@ -71,6 +71,9 @@
 require( ABSPATH . WPINC . '/class-wp-error.php' );
 require( ABSPATH . WPINC . '/plugin.php' );
 
+// Trap php errors
+wp_set_error_handler();
+
 // Include the wpdb class and, if present, a db.php database drop-in.
 require_wp_db();
 
