3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ 'true', null, '123', 123, json_encode('1/2'), json_encode('База данни грешка') ]; foreach ($tests as $test) { echo var_export(json_decode($test, true)) . "\n---\n"; }
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
true --- Deprecated: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated in /in/UJVrV on line 13 NULL --- 123 --- 123 --- '1/2' --- 'База данни грешка' ---
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
true --- NULL --- 123 --- 123 --- '1/2' --- 'База данни грешка' ---

preferences:
162.43 ms | 408 KiB | 5 Q