3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $obj1 = new stdClass(); $obj1->permission = "public_profile"; $obj1->status = "granted"; $obj2 = new stdClass(); $obj2->permission = "email"; $obj2->status = "granted"; $arrayResult = array($obj1, $obj2); // var_dump($arrayResult); foreach($arrayResult as $key => $obj){ if($obj->permission == 'email'){ echo "\$arrayResult[$key]->permission = email\n"; } else { echo "\$arrayResult[$key]->permission is not email\n"; } }
based on NFLVq
Output for 4.3.0 - 7.2.0
$arrayResult[0]->permission is not email $arrayResult[1]->permission = email