3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $json = '{"featureId":"87","checkReq":"true"}'; $uiOptions = json_decode($json,true); print_r($uiOptions); $checkReq = (isset($uiOptions['checkReq'])) ? $uiOptions['checkReq']: false; $req1 = $checkReq ? $checkReq : 1; $req = ($req == 1) ? ' class="req"' : '';var_dump($req1);
based on id4PV
Output for 5.6.0 - 5.6.30, 7.1.0 - 7.3.0rc3
Array ( [featureId] => 87 [checkReq] => true ) Notice: Undefined variable: req in /in/IbmDa on line 9 string(4) "true"
Output for hhvm-3.22.0
Array ( [featureId] => 87 [checkReq] => true ) Notice: Undefined variable: req in /in/IbmDa on line -1 string(4) "true"