3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $stylestr = 'text-align:center;display:block;'; $_style = array(); preg_match('#((?P<name>.*?):(?P<value>.*?);)*#', $stylestr, $matches); var_dump($matches);
based on kR7g2
Output for 4.3.3 - 7.1.0
array(6) { [0]=> string(32) "text-align:center;display:block;" [1]=> string(14) "display:block;" ["name"]=> string(7) "display" [2]=> string(7) "display" ["value"]=> string(5) "block" [3]=> string(5) "block" }
Output for 4.3.0 - 4.3.2
array(4) { [0]=> string(32) "text-align:center;display:block;" [1]=> string(14) "display:block;" [2]=> string(7) "display" [3]=> string(5) "block" }