Page MenuHomePhorge

test-logs-multilistener.php
ActivePublic

Authored by avivey on Nov 24 2023, 17:09.
#!/usr/bin/env php
<?php
require_once 'scripts/__init_script__.php';
function handler1($event, $value, array $metadata) {
echo pht('Handler 1 - event is `%s`'."\n", $event);
}
function handler2($event, $value, array $metadata) {
echo pht('Handler 2 - event is `%s`'."\n", $event);
}
echo "First error - no handler registered:\n";
strlen(null);
echo "\n";
PhutilErrorHandler::setErrorListener("handler1");
echo "Registered one handler, error again:\n";
strlen(null);
echo "\n";
PhutilErrorHandler::setErrorListener("handler2");
echo "Registered 2 handlers, error again:\n";
strlen(null);
echo "\n";

Event Timeline

avivey changed the title of this paste from Command-Line Input to test-logs-multilistener.php.Nov 24 2023, 17:09
avivey updated the paste's language from autodetect to php.