3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test_code = '8**'; $test_code = str_replace('*', '[0,9]{1}', $code); echo 'test_code = '.$test_code; $course_filters = array('200','809'); if (!empty($course_filters[$subject])) { foreach ($course_filters as $key => $code) { preg_match("/".$"/", $test_code, $matches); if ($matches) { echo "found = ".$code; } } }
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected '"/"' (T_CONSTANT_ENCAPSED_STRING), expecting variable (T_VARIABLE) or '$' in /in/ERkCk on line 11
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_VARIABLE or '$' in /in/ERkCk on line 11
Process exited with code 255.

preferences:
175.18 ms | 1395 KiB | 62 Q