Skip to content

Instantly share code, notes, and snippets.

@bkw
Created September 5, 2012 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkw/3637907 to your computer and use it in GitHub Desktop.
Save bkw/3637907 to your computer and use it in GitHub Desktop.
Demo of more strangeness with pecl-amqp and print_r
<?php
class Demo {
function __construct($conn) {
$this->someProperty = 'foobar';
$this->channel = new AMQPChannel($conn);
}
}
$conn = new AMQPConnection();
$conn->connect();
print_r(new AMQPChannel($conn));
print_r(new Demo($conn));
AMQPChannel takes over the Demo Object (notice the missing property $someProperty). Also take a look at these values...
AMQPChannel Object
(
[channel_id] => 1
[prefetch_count] => 3
[prefetch_size] => 0
)
Demo Object
(
[channel_id] => -810281877
[prefetch_count] => 57
[prefetch_size] => 0
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment