3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = array( 'one' => array( 'title' => 'Title One', 'uri' => 'http://example.com/one', ), 'two' => array( 'title' => 'Title Two', 'uri' => 'http://example.com/two', ), ); $a = function($values) { $return = array(); foreach($values as $value) $return[] = '<a href="' . $value['uri'] . '">' . $value['title'] . '</a>'; return $return; }; echo ($a instanceof Closure); $final_string = implode(' | ', function($values) { $return = array(); foreach($values as $value) $return[] = '<a href="' . $value['uri'] . '">' . $value['title'] . '</a>'; return $return; }()); echo $final_string;
Output for 5.3.0 - 5.3.26, 5.4.0 - 5.4.16
Parse error: syntax error, unexpected '(' in /in/JAs52 on line 32
Process exited with code 255.

preferences:
180.17 ms | 1395 KiB | 51 Q