3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = 'a{ra:calc(*(la)100%);font-s'; $string_regex = '((?<!\\\\)(?:\\\\\\\\)*(\'|")(?:.*?[^\\\\])??(?:\\\\\\\\)*\\2)'; $comment_regex = '(\\/\\*(?:(?!\\*\\/).)*\\*\\/)'; $url_regex = '(?<=:| |,|\\(|\\))(url)\\s*(\\()\\s*((?:[^()]+|(?2))*?)\\s*(\\))'; $calc_regex = '(?<=:| |,|\\(|\\))(calc)\\s*(\\()\\s*((?:[^()]+|(?2))*?)\\s*(\\))'; $string = preg_replace_callback('/'.$string_regex.'|'.$comment_regex.'|'.$url_regex.'|'.$calc_regex.'/si', array(&$this, 'filter_callback'), $string); $string = preg_match('/'.$string_regex.'|'.$comment_regex.'|'.$url_regex.'|'.$calc_regex.'/si', $string, $matches);
Output for 7.1.0
Fatal error: Uncaught Error: Using $this when not in object context in /in/VD4cd:7 Stack trace: #0 {main} thrown in /in/VD4cd on line 7
Process exited with code 255.
Output for 5.2.0 - 7.0.14
Warning: preg_replace_callback(): Requires argument 2, 'Array', to be a valid callback in /in/VD4cd on line 7
Output for 5.0.0 - 5.1.6
Warning: preg_replace_callback(): requires argument 2, 'Array', to be a valid callback in /in/VD4cd on line 7
Output for 4.3.0 - 4.4.9
Warning: preg_replace_callback() requires argument 2, 'Array', to be a valid callback in /in/VD4cd on line 7