3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function getInbetweenStrings($start, $end, $str){ $matches = array(); $regex = "/$start(.*)$end/"; preg_match_all($regex, $str, $matches); return $matches[1]; } $str = "C://@@ad_cu<>><FSD>FSDFsdfsadjfa#@%@#@#""stom_attr1@@/@@upn@@/@@samaccountname@@"; $str_arr = getInbetweenStrings('@@', '@@', $str); print_r($str_arr); ?>
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected '"stom_attr1@@/@@upn@@/@@samacc' (T_CONSTANT_ENCAPSED_STRING) in /in/uCcfH on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /in/uCcfH on line 10
Process exited with code 255.