Last active
February 7, 2018 15:33
-
-
Save rbayliss/a915949ad35d0bdf1bcd70e2e28e1244 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$map = array( | |
'best_sandwiches' => 'field_sandwiches', | |
); | |
// Fatal error in PHP 7 | |
$sandwiches = $node->$map['best_sandwiches'] | |
// OK: | |
$sandwiches = $node->{$map['best_sandwiches']} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment