3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $page=array(); $matches = array(); $matches[0]='../ololo'; preg_match('#([A-Za-z0-9\-\_]*)#', $page, $matches); $file = '../views/' . $matches[1] . '.html'; var_dump($file);
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: preg_match() expects parameter 2 to be string, array given in /in/TXR2g on line 5 Notice: Undefined offset: 1 in /in/TXR2g on line 6 string(14) "../views/.html"
Output for hhvm-3.10.0 - 3.12.0
Warning: preg_match() expects parameter 2 to be string, array given in /in/TXR2g on line 5 Notice: Undefined index: 1 in /in/TXR2g on line 6 string(14) "../views/.html"
Output for 4.3.3 - 5.2.17
Warning: preg_match() expects parameter 2 to be string, array given in /in/TXR2g on line 5 Notice: Undefined offset: 1 in /in/TXR2g on line 6 string(14) "../views/.html"
Output for 4.3.0 - 4.3.2
Notice: Array to string conversion in /in/TXR2g on line 5 string(19) "../views/Array.html"