Exemple #1
0
function main()
{
    // Generate a prologue for thrower:
    try {
        thrower();
    } catch (Exception $x) {
    }
    // Push down bytecode offsets
    for ($i = 0; $i < 10; ++$i) {
        mt_rand();
    }
    for ($i = 0; $i < 10; ++$i) {
        mt_rand();
    }
    for ($i = 0; $i < 10; ++$i) {
        mt_rand();
    }
    for ($i = 0; $i < 10; ++$i) {
        mt_rand();
    }
    for ($i = 0; $i < 10; ++$i) {
        mt_rand();
    }
    for ($i = 0; $i < 10; ++$i) {
        mt_rand();
    }
    for ($i = 0; $i < 10; ++$i) {
        mt_rand();
    }
    for ($i = 0; $i < 10; ++$i) {
        mt_rand();
    }
    $z = better_handle_exceptions_if_you_inline();
    var_dump($z);
}
Exemple #2
0
function baz($a)
{
    try {
        $a = thrower($a);
    } catch (Exception $e) {
        $a = 0;
    }
    return $a;
}
Exemple #3
0
function foo()
{
    foreach (array(1, 2, 3) as $x) {
        try {
            thrower();
        } catch (MyJunk $z) {
            echo "Not Here\n";
        }
    }
}
Exemple #4
0
<?php

class MyException extends Exception
{
    public function __construct()
    {
    }
}
function thrower()
{
    throw new MyException();
}
try {
    thrower();
} catch (Exception $exn) {
    $a = $exn->getTrace();
    foreach ($a as &$b) {
        $b['file'] = 'string';
    }
    var_dump($a);
    var_dump($exn->getLine());
}