3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = 'a{ra:calc(*(la)100%);font-s'; $calc_regex = '(?<=:| |,|\\(|\\))(calc)\\s*(\\()\\s*((?:[^()]+|\\((?3)\\))*?)\\s*(\\))'; $string = preg_match('/'.$calc_regex.'/si', $string, $matches); var_dump($matches);
Output for 4.4.3 - 4.4.9, 5.1.3 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(0) { }
Output for 4.3.0 - 4.4.2, 5.0.0 - 5.1.2
array(5) { [0]=> string(10) "calc(*(la)" [1]=> string(4) "calc" [2]=> string(1) "(" [3]=> string(4) "*(la" [4]=> string(1) ")" }