Child Theme not overwriting Parent theme php file

If the php file is gets included or required from functions.php file in parent theme all codes are added to runtime they are not replaced if you create files in similar directory structure.

So, What can be replaced?

  1. Only files called via get_template_part() can be replaced this way. This is also true for any file in template hierarchy

  2. If the parent theme uses add_action() or add_filter() with function name you can remove them using remove_action() or remove_filter() and use your own replacements.

  3. If parent theme uses function_exists() or class_exists() with an if encapsulating a function/class they can be replaced from your child themes functions.php file.