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 7bUvj
Output for 4.3.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(5) { [0]=> string(18) "text-align:center;" ["name"]=> string(10) "text-align" [1]=> string(10) "text-align" ["value"]=> string(6) "center" [2]=> string(6) "center" }
Output for 4.3.0 - 4.3.2
array(3) { [0]=> string(18) "text-align:center;" [1]=> string(10) "text-align" [2]=> string(6) "center" }