<?php
 
$input = '{a{b{c{d}}}}';
preg_match_all('/(?:^(?=({\w+(?1)?})$)|\G(?!\A)){(\w+)/', $input, $matches);
print_r($matches[2]);