3v4l.org

run code in 500+ PHP versions simultaneously
<?php $re = '/(?:\bif\((?=[^()]*\))|\G(?!^))(.*?==.*?)(?:-(?:AND|OR)-|\)$)/'; $str = 'if(conditionA==valueA-AND-conditionB==valueB-OR-conditionC==valueC)'; preg_match_all($re, $str, $matches); print_r($matches[1]);

preferences:
99.12 ms | 1268 KiB | 5 Q