Index: wp-admin/includes/file.php
===================================================================
--- wp-admin/includes/file.php	(revision 47576)
+++ wp-admin/includes/file.php	(working copy)
@@ -1727,6 +1727,8 @@
 	$from = trailingslashit( $from );
 	$to   = trailingslashit( $to );
 
+	$opcacheEnabled = function_exists( 'opcache_invalidate' );
+
 	foreach ( (array) $dirlist as $filename => $fileinfo ) {
 		if ( in_array( $filename, $skip_list, true ) ) {
 			continue;
@@ -1740,6 +1742,9 @@
 					return new WP_Error( 'copy_failed_copy_dir', __( 'Could not copy file.' ), $to . $filename );
 				}
 			}
+			if ($opcacheEnabled && in_array( pathinfo( $filename, PATHINFO_EXTENSION ), array( 'php', 'phtml' ) ) ) {
+				opcache_invalidate( $to . $filename );
+			}
 		} elseif ( 'd' == $fileinfo['type'] ) {
 			if ( ! $wp_filesystem->is_dir( $to . $filename ) ) {
 				if ( ! $wp_filesystem->mkdir( $to . $filename, FS_CHMOD_DIR ) ) {
Index: wp-admin/includes/update-core.php
===================================================================
--- wp-admin/includes/update-core.php	(revision 47576)
+++ wp-admin/includes/update-core.php	(working copy)
@@ -1338,6 +1338,8 @@
 	$from = trailingslashit( $from );
 	$to   = trailingslashit( $to );
 
+    $opcacheEnabled = function_exists( 'opcache_invalidate' );
+
 	foreach ( (array) $dirlist as $filename => $fileinfo ) {
 		if ( in_array( $filename, $skip_list, true ) ) {
 			continue;
@@ -1351,6 +1353,9 @@
 					return new WP_Error( 'copy_failed__copy_dir', __( 'Could not copy file.' ), $to . $filename );
 				}
 			}
+			if ($opcacheEnabled && in_array( pathinfo( $filename, PATHINFO_EXTENSION ), array( 'php', 'phtml' ) ) ) {
+				opcache_invalidate( $to . $filename );
+			}
 		} elseif ( 'd' == $fileinfo['type'] ) {
 			if ( ! $wp_filesystem->is_dir( $to . $filename ) ) {
 				if ( ! $wp_filesystem->mkdir( $to . $filename, FS_CHMOD_DIR ) ) {
