Answer ⏱ 272ms
Part 1 :
2236672
Part 2 :
⭐
/**
* Found by playing manually: mapping everything on paper and then tying different objects at the end.
* Could probably be automated by :
* - mapping everything with DFS (with a lot of parsing...)
* - gathering all objects (but not the ones that trigger problems... espacially the infinite loop...)
* - droping various combinations of objects at the end until the right combination is found.
*/
$robot = new Intcode($input, array_map("ord", str_split(implode("\n", [
"north", "west",
"take sand",
"east", "south",
"east", "east", "north", "east", "east",
"take astronaut ice cream",
"west", "west", "south", "west", "west",
"south", "south",
"take mutex",
"south",
"take boulder",
"east", "south", "east",
""
]))));
$robot->run();
preg_match("/get in by typing ([0-9]+)/", $robot->output->map("chr")->join(""), $match);
$solution_1 = $match[1];
$solution_2 = "⭐";