3v4l.org

run code in 300+ PHP versions simultaneously
<?php $original = "original" $generatedPath = array( "/^(?!".$original."$).+$/", '/^(?![0-9]_[0-9]*x[0-9]*$).+$/' ); $test = array('products', 'categories', 'original', '1_22x44','1_22x44a'); foreach ($test as $t) { foreach($generatedPath as $pattern) { if(preg_match($pattern, $t)) { echo $t ."\r\n"; } } }
Output for 5.4.0 - 5.4.15
Parse error: syntax error, unexpected '$generatedPath' (T_VARIABLE) in MLUPG on line 3
Process exited with code 255.
Output for 5.3.25
Parse error: syntax error, unexpected T_VARIABLE in /in/f0pao on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected T_VARIABLE in MLUPG on line 3
Process exited with code 255.

preferences:
186.29 ms | 1395 KiB | 49 Q