Skip to content

Instantly share code, notes, and snippets.

@jmikola
Last active September 3, 2015 18:10
Show Gist options
  • Save jmikola/37b2fb5954d790b3b416 to your computer and use it in GitHub Desktop.
Save jmikola/37b2fb5954d790b3b416 to your computer and use it in GitHub Desktop.
<?php
// Running in a separate terminal: mongobridge --port 27018 --dest localhost:27017 --delay 10
// Executed as: php -n -d extension=mongodb.so segfault.php
print_r(get_loaded_extensions());
$options = ['w' => 1, 'journal' => 0, 'connectTimeoutMS' => 1, 'socketTimeoutMS' => 1, 'wTimeoutMS' => 1];
$manager = new MongoDB\Driver\Manager('mongodb://localhost:27018', $options);
try {
$cursor = $manager->executeQuery('test.foo', new MongoDB\Driver\Query(array()));
var_dump(iterator_to_array($cursor));
} catch (\Exception $e) {
echo '<pre>';
var_dump($e->getTraceAsString(), $e->getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment