$count = 0;
$value =
preg_replace( '/,([ \t]*[}\]][^"\r\n]*([\r\n]|$)|[ \t]*[\r\n][ \t\r\n]*[}\]])/', '$1',
- $value, - 1, $count );
+ $value, -1, $count );
if ( $count > 0 ) {
$result = json_decode( $value, $assoc );
if ( JSON_ERROR_NONE === json_last_error() ) {
$lookAhead = ( $idx + 1 < $maxLen ) ? $str[$idx + 1] : '';
$lookBehind = ( $idx - 1 >= 0 ) ? $str[$idx - 1] : '';
if ( $inString ) {
- continue;
+ break;
} elseif ( !$inComment &&
( $lookAhead === '/' || $lookAhead === '*' )