- Install dependencies:
composer install
- Start the webserver:
php -S localhost:8989
- Run the client:
php client.php
Expected behavior: request is completed successfully.
Actual behavior:
<?php declare(strict_types = 1); | |
function testPerformance($name, Closure $closure, $runs = 1000000) | |
{ | |
$start = microtime(true); | |
for (; $runs > 0; $runs--) | |
{ | |
$closure(); | |
} | |
$end = microtime(true); |
> db.foo.count() | |
> db.foo.findAndModify({query: { foo: 'bar' }, update: {foo: 'bar'}, upsert: true}) | |
null | |
> db.foo.findAndModify({query: { foo: 'bar' }, update: {foo: 'baz'}, upsert: true}) | |
{ "_id" : ObjectId("5922e0b18c00e100490e9108"), "foo" : "bar" } | |
> db.foo.findAndModify({query: { foo: 'bar' }, update: {foo: 'foobar'}, upsert: true, new: true}) | |
{ "_id" : ObjectId("5922e0b18c00e100490e9108"), "foo" : "foobar" } |
<?php | |
use Doctrine\ODM\MongoDB\Event\LifecycleEventArgs; | |
/** | |
* @ODM\EmbeddedDocument | |
* @ODM\HasLifecycleCallbacks | |
*/ | |
class EmbeddedDocument | |
{ |
<?php | |
declare(strict_types = 1); | |
class FooImplementation implements FooInterface | |
{ | |
// Note: this throws an error in PHP 7.1: | |
// Declaration of FooImplementation::doSomething(): FooImplementation must be compatible with FooInterface::doSomething(): FooInterface | |
public function doSomething(): FooImplementation | |
{ |
<?php | |
namespace Doctrine\MongoDB\Builders\Query; | |
class Builder implements BuilderInterface, MongoDB32BuilderInterface { | |
// ... | |
} |
Install mongo-orchestration and start a sharded cluster:
mongo-orchestration -b 127.0.0.1 -p 8889 --no-fork start
curl -XPUT http://localhost:8889/v1/sharded_clusters/myCluster --data @configurations/sharded_clusters/clean.json
Then, run the included PHP script:
$ php invalid-cursor-listCollections.php
FROM php:7.0-cli | |
COPY . /usr/src | |
WORKDIR /usr/src | |
RUN mkdir -p existing-dir | |
RUN touch existing-dir/test | |
RUN cp -r existing-dir existing-dir-2 | |
CMD [ "php", "./rename.php" ] |
class ProxiedProperty | |
{ | |
/** @var string */ | |
private $name; | |
/** @var \ReflectionProperty */ | |
private $reflectionProperty; | |
/** @var object */ | |
private $owner; |
<?php | |
class Foo | |
{ | |
/** | |
* @return self | |
*/ | |
public function foo() | |
{ | |
return $this; |