Exécuter
❯
Exécuter le code
Ctrl+Alt+R
Changer d'orientation
Ctrl+Alt+O
Changer de thème
Ctrl+Alt+D
<!DOCTYPE html> <html> <body> <?php function get_cars($obj) { if (!is_object($obj)) { retourner faux; } return $obj->voitures; } $obj = new stdClass(); $obj->cars = array("Volvo", "BMW", "Audi"); var_dump(get_cars(null)); echo "<br>"; var_dump(get_cars($obj)); ?> </body> </html>
bool(false)
array(3) { [0]=> string(5) "Volvo" [1]=> string(3) "BMW" [2]=> string(4) "Audi" }