3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // $string = 'Automóvel'; $string = utf8_encode('Automóvel'); $products = array('horloges', 'media', $string); echo'<pre>';print_r($products); // convert to a string $string = json_encode($products); echo $string; // ["horloges","media","gereedschap"]
Output for 5.2.0 - 7.1.0
<pre>Array ( [0] => horloges [1] => media [2] => Automóvel ) ["horloges","media","Autom\u00c3\u00b3vel"]
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.1.6
<pre>Array ( [0] => horloges [1] => media [2] => Automóvel ) Fatal error: Call to undefined function json_encode() in /in/b5sN8 on line 11
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/b5sN8 on line 12
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<pre>Array ( [0] => horloges [1] => media [2] => Automóvel ) Fatal error: Call to undefined function: json_encode() in /in/b5sN8 on line 11
Process exited with code 255.
Output for 4.3.2 - 4.4.4
<pre>Array ( [0] => horloges [1] => media [2] => Automóvel ) Fatal error: Call to undefined function: json_encode() in /in/b5sN8 on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<pre>Array ( [0] => horloges [1] => media [2] => Automóvel ) Fatal error: Call to undefined function: json_encode() in /in/b5sN8 on line 11