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(property_exists($obj, "email")){ echo "\$arrayResult[$key]->email exists\n"; } }
based on 8QClX
Output for 5.1.0 - 5.6.30, hhvm-3.10.1 - 3.17.3, 7.0.0 - 7.2.0
array(2) { [0]=> object(stdClass)#1 (2) { ["permission"]=> string(14) "public_profile" ["status"]=> string(7) "granted" } [1]=> object(stdClass)#2 (2) { ["permission"]=> string(5) "email" ["status"]=> string(7) "granted" } }
Output for 5.0.0 - 5.0.5
array(2) { [0]=> object(stdClass)#1 (2) { ["permission"]=> string(14) "public_profile" ["status"]=> string(7) "granted" } [1]=> object(stdClass)#2 (2) { ["permission"]=> string(5) "email" ["status"]=> string(7) "granted" } } Fatal error: Call to undefined function property_exists() in /in/NFLVq on line 16
Process exited with code 255.
Output for 4.4.5 - 4.4.9
array(2) { [0]=> object(stdClass)(2) { ["permission"]=> string(14) "public_profile" ["status"]=> string(7) "granted" } [1]=> object(stdClass)(2) { ["permission"]=> string(5) "email" ["status"]=> string(7) "granted" } } Fatal error: Call to undefined function: property_exists() in /in/NFLVq on line 16
Process exited with code 255.
Output for 4.3.2 - 4.4.4
array(2) { [0]=> object(stdClass)(2) { ["permission"]=> string(14) "public_profile" ["status"]=> string(7) "granted" } [1]=> object(stdClass)(2) { ["permission"]=> string(5) "email" ["status"]=> string(7) "granted" } } Fatal error: Call to undefined function: property_exists() in /in/NFLVq on line 16
Process exited with code 255.
Output for 4.3.0 - 4.3.1
array(2) { [0]=> object(stdClass)(2) { ["permission"]=> string(14) "public_profile" ["status"]=> string(7) "granted" } [1]=> object(stdClass)(2) { ["permission"]=> string(5) "email" ["status"]=> string(7) "granted" } } Fatal error: Call to undefined function: property_exists() in /in/NFLVq on line 16