3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $text = '{{"a":1},{"b":2},{"c":3},}'; preg_match_all( "/(\{[^{]+\})?[,}]/i", $text, $match); var_dump($match);
based on fIM7g
Output for 5.3.17 - 7.2.6
array(2) { [0]=> array(4) { [0]=> string(8) "{"a":1}," [1]=> string(8) "{"b":2}," [2]=> string(8) "{"c":3}," [3]=> string(1) "}" } [1]=> array(4) { [0]=> string(7) "{"a":1}" [1]=> string(7) "{"b":2}" [2]=> string(7) "{"c":3}" [3]=> string(0) "" } }