--- ccs7up.php 2023-07-12 10:29:07.991173759 +0200 +++ ccs7up_cds.php 2023-07-12 11:33:10.122392061 +0200 @@ -150,6 +150,13 @@ while (preg_match( $pattern, $str, $matches, PREG_OFFSET_CAPTURE, $offset) && $offset < $str_len ) { + preg_match( '/(#\[AllowDynamicProperties\])/', $str, $m, PREG_OFFSET_CAPTURE, (int)$matches[0][1]-strlen('#[AllowDynamicProperties]')-2) ; + if( isset($m[0]) ) { + $AllowDynamicProperties=''; + } else { + $AllowDynamicProperties="#[AllowDynamicProperties]\r\n"; + $changesCounter++; + } //Classes found in the file! Set the flag. $classFound = true; @@ -225,7 +232,7 @@ //Move our pointer to the next occurence (or end of file). $offset = $next_offset; - $str_result .= $string_to_process; + $str_result .= "$AllowDynamicProperties$string_to_process"; } //end of while 'class' found