3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // JSON PHP 5.2 $products = array('horloges', 'media', 'gereedschap'); echo'<pre>';print_r($products); // convert to a string $string = json_encode($products); echo $string; // ["horloges","media","gereedschap"] // you can reproduce the original variable $products = json_decode($string); echo'<pre>';print_r($products);
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<pre>Array ( [0] => horloges [1] => media [2] => gereedschap ) ["horloges","media","gereedschap"]<pre>Array ( [0] => horloges [1] => media [2] => gereedschap )
Output for 5.0.0 - 5.1.6
<pre>Array ( [0] => horloges [1] => media [2] => gereedschap ) Fatal error: Call to undefined function json_encode() in /in/aGrmg on line 6
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<pre>Array ( [0] => horloges [1] => media [2] => gereedschap ) Fatal error: Call to undefined function: json_encode() in /in/aGrmg on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
<pre>Array ( [0] => horloges [1] => media [2] => gereedschap ) Fatal error: Call to undefined function: json_encode() in /in/aGrmg on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<pre>Array ( [0] => horloges [1] => media [2] => gereedschap ) Fatal error: Call to undefined function: json_encode() in /in/aGrmg on line 6