3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_export(preg_match('~foo~', 'foo', $string)); var_export(preg_match('~foo~', 'bar', $string)); var_export(preg_match('~foo', 'foo', $string)); if (PREG_NO_ERROR === preg_last_error()) { echo "no error!\n"; }
Output for 5.2.0 - 5.6.28, 7.0.0 - 7.1.0
10 Warning: preg_match(): No ending delimiter '~' found in /in/J2PDU on line 5 falseno error!
Output for hhvm-3.12.0
10 Warning: No ending delimiter '~' found: [~foo] in /in/J2PDU on line 5 falseno error!
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.1.6
10 Warning: preg_match(): No ending delimiter '~' found in /in/J2PDU on line 5 false Notice: Use of undefined constant PREG_NO_ERROR - assumed 'PREG_NO_ERROR' in /in/J2PDU on line 7 Fatal error: Call to undefined function preg_last_error() in /in/J2PDU on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
10 Warning: preg_match(): No ending delimiter '~' found in /in/J2PDU on line 5 false Notice: Use of undefined constant PREG_NO_ERROR - assumed 'PREG_NO_ERROR' in /in/J2PDU on line 7 Fatal error: Call to undefined function: preg_last_error() in /in/J2PDU on line 7
Process exited with code 255.
Output for 4.3.11 - 4.4.4
10 Warning: preg_match(): No ending delimiter '~' found in /in/J2PDU on line 5 false Notice: Use of undefined constant PREG_NO_ERROR - assumed 'PREG_NO_ERROR' in /in/J2PDU on line 7 Fatal error: Call to undefined function: preg_last_error() in /in/J2PDU on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.10
10 Warning: No ending delimiter '~' found in /in/J2PDU on line 5 false Notice: Use of undefined constant PREG_NO_ERROR - assumed 'PREG_NO_ERROR' in /in/J2PDU on line 7 Fatal error: Call to undefined function: preg_last_error() in /in/J2PDU on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1
10 Warning: No ending delimiter '~' found in /in/J2PDU on line 5 false Notice: Use of undefined constant PREG_NO_ERROR - assumed 'PREG_NO_ERROR' in /in/J2PDU on line 7 Fatal error: Call to undefined function: preg_last_error() in /in/J2PDU on line 7