<?php

class Connection
{
    public function __construct(array $data)
    {
        if (isset($data['a'], $data['b'], $data['c'])) {
            echo "OK".PHP_EOL;
        } else {
            throw new Exception("Some big error");
        }
    }

    public function printVar($var)
    {
        echo $var.PHP_EOL;
    }
}

class BlogPost {
    
    public function __construct(array $data)
    {
        try {
            $this->db = new Connection($data);
            $this->db->printVar('Hello world');
        } catch (Exception $e) {
            exit($e->getMessage().PHP_EOL);
        }
    }
}

$post1 = new BlogPost(array('a' => 'a', 'b' => 'b', 'c' => 'c')); // will work
$post2 = new BlogPost(array('a' => 'a', 'b' => 'b')); // will fail
