3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'binary_function([x,y]) and binary_function([x1,y1,z1])'; echo preg_replace_callback('~binary_function\(\[(.*?)]\)~', function ($m) { return implode("", array_map(function ($x) { return strtoupper($x); }, explode(",", $m[1]))); }, $text);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
172.77 ms | 2111 KiB | 13 Q