What are the advantages and disadvantages of using separate callbacks for success and error handling in PHP threads?

When working with PHP threads, using separate callbacks for success and error handling can provide clearer and more organized code structure. By separating the success and error logic, it is easier to manage and maintain the code. However, this approach may lead to duplication of code if the success and error handling logic share common functionalities.

<?php

$pool = new Pool(2);

$pool->submit(function() {
    // Task logic here
}, function() {
    // Success callback
}, function() {
    // Error callback
});

$pool->submit(function() {
    // Another task logic here
}, function() {
    // Success callback
}, function() {
    // Error callback
});

$pool->shutdown();