3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $json = '{"Hydrogen":"Diamagnetic","Niobium":"N/A","Thallium":"Diamagnetic","Helium":"Diamagnetic","Molybdenum":"Paramagnetic","Lead":"Diamagnetic","Lithium":"Paramagnetic","Technetium":"N/A","Bismuth":"Diamagnetic","Beryllium":"Diamagnetic","Ruthenium":"Paramagnetic","Polonium":"N/A","Boron":"Diamagnetic","Rhodium":"Paramagnetic","Astatine":"N/A","Carbon":"Diamagnetic","Palladium":"Paramagnetic","Radon":"N/A","Nitrogen":"Diamagnetic","Silver":"Diamagnetic","Francium":"N/A","Oxygen":"Paramagnetic","Cadmium":"Diamagnetic","Radium":"N/A","Fluorine":"N/A","Indium":"Diamagnetic","Actinium":"N/A","Neon":"Diamagnetic","Tin":"Paramagnetic","Thorium":"N/A","Sodium":"Paramagnetic","Antimony":"Diamagnetic","Protactinium":"N/A","Magnesium":"Paramagnetic","Tellurium":"Diamagnetic","Uranium":"N/A","Aluminum":"Paramagnetic","Iodine":"N/A","Neptunium":"N/A","Silicon":"Diamagnetic","Xenon":"Diamagnetic","Plutonium":"N/A","Phosphorus":"Diamagnetic","Cesium":"N/A","Americium":"N/A","Sulfur":"Diamagnetic","Barium":"Paramagnetic","Curium":"N/A","Chlorine":"Diamagnetic","Lanthanum":"N/A","Berkelium":"N/A","Argon":"Diamagnetic","Cerium":"Paramagnetic","Californium":"N/A","Potassium":"N/A","Praseodymium":"N/A","Einsteinium":"N/A","Calcium":"Paramagnetic","Neodymium":"Paramagnetic","Fermium":"N/A","Scandium":"N/A","Promethium":"N/A","Mendelevium":"N/A","Titanium":"Paramagnetic","Samarium":"Paramagnetic","Nobelium":"N/A","Vanadium":"N/A","Europium":"Paramagnetic","Lawrencium":"N/A","Chromium":"Antiferromagnetic","Gadolinium":"Ferromagnetic","Rutherfordium":"N/A","Manganese":"Paramagnetic","Terbium":"Paramagnetic","Dubnium":"N/A","Iron":"Ferromagnetic","Dysprosium":"Paramagnetic","Seaborgium":"N/A","Cobalt":"Ferromagnetic","Holmium":"Paramagnetic","Bohrium":"N/A","Nickel":"Ferromagnetic","Erbium":"Paramagnetic","Hassium":"N/A","Copper":"Diamagnetic","Thulium":"Paramagnetic","Meitnerium":"N/A","Zinc":"Diamagnetic","Ytterbium":"N/A","Darmstadtium":"N/A","Gallium":"Diamagnetic","Lutetium":"N/A","Roentgenium":"N/A","Germanium":"Diamagnetic","Hafnium":"N/A","Ununbium":"N/A","Arsenic":"Diamagnetic","Tantalum":"N/A","Ununtrium":"N/A","Selenium":"Diamagnetic","Tungsten":"Paramagnetic","Ununquadium":"N/A","Bromine":"Diamagnetic","Rhenium":"N/A","Ununpentium":"N/A","Krypton":"Diamagnetic","Osmium":"Paramagnetic","Ununhexium":"N/A","Rubidium":"N/A","Iridium":"Paramagnetic","Ununseptium":"N/A","Strontium":"Paramagnetic","Platinum":"Paramagnetic","Ununoctium":"N/A","Yttrium":"N/A","Gold":"Diamagnetic","Zirconium":"Paramagnetic","Mercury":"Diamagnetic"}'; $arr = json_decode($json, true); sort($arr); foreach ($arr as $element => $magnetism) { echo $magnetism . PHP_EOL; }
Output for 5.2.0 - 7.3.1
Antiferromagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Diamagnetic Ferromagnetic Ferromagnetic Ferromagnetic Ferromagnetic N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic Paramagnetic
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/shnts on line 5
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/shnts on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/shnts on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/shnts on line 5