Index: wp-includes/load.php
===================================================================
--- wp-includes/load.php	(revision 19787)
+++ wp-includes/load.php	(working copy)
@@ -738,3 +738,95 @@
 
 	$wp_locale = new WP_Locale();
 }
+
+/**
+ * Set up the PHP error handler
+ *
+ * @since 3.4.0
+ * @access private
+ */
+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', 20 );
+	else
+		add_action( 'wp_footer', 'wp_show_errors', 20 );
+}
+
+/**
+ * Resolve an error constant to its human readable name
+ *
+ * @since 3.4.0
+ * @access private
+ *
+ * @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
+ *
+ * @since 3.4.0
+ * @access private
+ *
+ */
+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">	
+			<p><?php echo sprintf( __( '<b>%1$s</b>: %2$s in <b>%3$s</b> on line <b>%4$d</b>' ), wp_error_constant( $err['errno'] ), $err['errstr'], $err['errfile'], $err['errline'] ); ?></p>
+		</div>
+		<?php
+	endforeach;
+}
+
+/**
+ * PHP error handler callback
+ *
+ * @since 3.4.0
+ * @access private
+ *
+ * @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[] = compact( 'errno', 'errstr', 'errfile', 'errline' );
+}
Index: wp-settings.php
===================================================================
--- wp-settings.php	(revision 19787)
+++ wp-settings.php	(working copy)
@@ -72,6 +72,9 @@
 require( ABSPATH . WPINC . '/plugin.php' );
 require( ABSPATH . WPINC . '/pomo/mo.php' );
 
+// Trap PHP errors
+wp_set_error_handler();
+
 // Include the wpdb class and, if present, a db.php database drop-in.
 require_wp_db();
 
