I would highly suggest changing the string format being generated. It's better to use an existing format like JSON than to create/parse your own format.
Speaking of JSON, one way to "parse" this format is to convert it to JSON and then parse that.
So, convert the = to :, wrap all keys (and values) in "", convert [] to {}, and then wrap the whole thing in {}.
<?php
$data = "field=3,icon=[class='test',svg=null],test=[pass='345',username='salar']";
// Fix quotes
$jsonData = str_replace("'", '"', $data);
// Convert arrays to objects
$jsonData = str_replace(['[', ']'], ['{', '}'], $jsonData);
// Fix keys
$jsonData = preg_replace("/(^|,|{)(.+?)=/", '$1"$2":', $jsonData);
// Parse as JSON
$result = json_decode('{' . $jsonData . '}', true);