Blade seems to be unable to override sections that were already defined in the extended layout. It seems like Blade is first including / executing the extended layout before overriding the sections.
You need 3 views:
@extends('layout')
@section('remove-me', '')
@section('remove-me')
@include('include')
@show
{{ $iDoNotExist }}
Empty HTML page
Undefined variable: iDoNotExist
Give include.blade.php the variable it needs
Well, the point is - in the example it should not get included at all, because I overwrite the section in the beginning.
Now I got it.
Yes blade compiles all section content in order to be able to replace @parent with the parent section content, so yes the all section code is actually included using PHP's include, section content are collected in a stack, and then on render Blade manages the output based on the different sections you have.
Closing since it's not actually a bug, this behaviour is by design, sections are compiled in order to be able to use the @parent directive.
Most helpful comment
Well, the point is - in the example it should not get included at all, because I overwrite the section in the beginning.