3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // example code $content = 'dasdasdas d asdas dasdas dasd [gallery ids="2727,2726,2721"] dasd as ads'; /*$ids = substr(strstr($content, '[gallery ids='), 14); $ids = substr($ids, 0, strpos( $ids, '"]')); $ids = explode(',', $ids);*/ $ids = preg_match($ids, '/?<=\[gallery ids")(.*\n?)(?="]/'); echo print_r($ids);
Output for 5.0.4 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: ids in /in/BqKGY on line 10 Warning: preg_match(): Empty regular expression in /in/BqKGY on line 10 1
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: ids in /in/BqKGY on line 10 Warning: Empty regular expression in /in/BqKGY on line 10 1
Output for 4.3.11 - 5.0.3
Notice: Undefined variable: ids in /in/BqKGY on line 10 Warning: preg_match(): Empty regular expression in /in/BqKGY on line 10 1
Output for 4.3.0 - 4.3.10
Notice: Undefined variable: ids in /in/BqKGY on line 10 Warning: Empty regular expression in /in/BqKGY on line 10 1