3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $value = "[Code][WST-2587] hello world"; print($value); print("\n"); $trimPattern = '/^[”’"\'(<]*@?(.+?)[.”’"\'\,!?:;)>]*$/'; print($trimPattern); print("\n"); $projects = array('IC', 'WST'); $calloutPattern = "/^(?:" . implode('|', $projects) . ")-[0-9]+$/"; print($calloutPattern); print("\n"); $words = preg_split('/(\s+)/', $value); foreach ($words as $word) { print($word); print("\n"); } preg_match_all('/[(<\[]((' . implode('|', $projects) . ')-[0-9]+)[\]>)]', $value, $matches); $words = array_merge($words, $matches[1]); foreach ($words as $word) { print($word); print("\n"); }
based on FOkAP
Output for 5.2.0 - 7.2.0
[Code][WST-2587] hello world /^[”’"'(<]*@?(.+?)[.”’"'\,!?:;)>]*$/ /^(?:IC|WST)-[0-9]+$/ [Code][WST-2587] hello world Warning: preg_match_all(): No ending delimiter '/' found in /in/IKGXs on line 19 Warning: array_merge(): Argument #2 is not an array in /in/IKGXs on line 20 Warning: Invalid argument supplied for foreach() in /in/IKGXs on line 22
Output for 5.0.0 - 5.1.6
[Code][WST-2587] hello world /^[”’"'(<]*@?(.+?)[.”’"'\,!?:;)>]*$/ /^(?:IC|WST)-[0-9]+$/ [Code][WST-2587] hello world Warning: preg_match_all(): No ending delimiter '/' found in /in/IKGXs on line 19 Notice: Undefined offset: 1 in /in/IKGXs on line 20 Warning: array_merge(): Argument #2 is not an array in /in/IKGXs on line 20 Warning: Invalid argument supplied for foreach() in /in/IKGXs on line 22
Output for 4.3.11 - 4.4.9
[Code][WST-2587] hello world /^[”’"'(<]*@?(.+?)[.”’"'\,!?:;)>]*$/ /^(?:IC|WST)-[0-9]+$/ [Code][WST-2587] hello world Warning: preg_match_all(): No ending delimiter '/' found in /in/IKGXs on line 19 Notice: Undefined offset: 1 in /in/IKGXs on line 20 [Code][WST-2587] hello world
Output for 4.3.0 - 4.3.10
[Code][WST-2587] hello world /^[”’"'(<]*@?(.+?)[.”’"'\,!?:;)>]*$/ /^(?:IC|WST)-[0-9]+$/ [Code][WST-2587] hello world Warning: No ending delimiter '/' found in /in/IKGXs on line 19 Notice: Undefined offset: 1 in /in/IKGXs on line 20 [Code][WST-2587] hello world