Page MenuHomePhabricator

memcached-excimer.php

Authored By
tstarling
Mar 3 2021, 2:56 AM
Size
1 KB
Referenced Files
None
Subscribers
None

memcached-excimer.php

<?php
header( 'Content-Type: text/plain; charset=utf-8' );
set_error_handler( 'handle_error' );
$t = microtime( true );
while ( microtime( true ) - $t < 10 ) {
$timer = new ExcimerTimer;
$timer->setPeriod( 0.01 );
$timer->setCallback( function () {
throw new RuntimeException;
} );
$timer->start();
while ( microtime( true ) - $t < 10 ) {
try {
while ( microtime( true ) - $t < 10 ) {
try {
$memcached = new Memcached;
} catch ( RuntimeException $e ) {
echo "Caught exception from constructor\n";
}
if ( !$memcached ) {
continue;
}
try {
$memcached->addServer( 'localhost', 11211 );
} catch ( RuntimeException $e ) {
echo "Caught exception from addServer\n";
}
try {
$memcached->get( 'test' );
} catch ( RuntimeException $e ) {
echo "Caught exception from get\n";
}
try {
$memcached = null;
} catch ( RuntimeException $e ) {
echo "Caught exception from destructor\n";
var_dump( $memcached );
$memcached->get( 'test' );
}
}
} catch ( RuntimeException $e ) {
echo "Caught exception from somewhere else\n";
}
}
}
echo "Done\n";
function handle_error( $errno, $errstr, $errfile, $errline, $errcontext ) {
echo "Got error: $errstr\n";
print ( new Exception )->getTraceAsString();
exit;
}

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8907284
Default Alt Text
memcached-excimer.php (1 KB)

Event Timeline