HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux dev1 5.15.83-1-pve #1 SMP PVE 5.15.83-1 (2022-12-15T00:00Z) x86_64
User: safarimaris (1000)
PHP: 7.2.34-54+ubuntu22.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //opt/php-5.6.40/Zend/tests/bug50383.phpt
--TEST--
Bug #50383 (Exceptions thrown in __call / __callStatic do not include file and line in trace)
--FILE--
<?php

class myClass {
	public static function __callStatic($method, $args) {
		throw new Exception("Missing static method '$method'\n");
	}
	public function __call($method, $args) {
		throw new Exception("Missing method '$method'\n");
	}
}

function thrower() {
	myClass::ThrowException();
}
function thrower2() {
	$x = new myClass;
	$x->foo();
}

try {
	thrower();
} catch(Exception $e) {
	print $e->getMessage();
	print_r($e->getTrace());
}

try {
	thrower2();
} catch (Exception $e) {
	print $e->getMessage();
	print_r($e->getTrace());
}

?>
--EXPECTF--
Missing static method 'ThrowException'
Array
(
    [0] => Array
        (
            [file] => %s
            [line] => 13
            [function] => __callStatic
            [class] => myClass
            [type] => ::
            [args] => Array
                (
                    [0] => ThrowException
                    [1] => Array
                        (
                        )

                )

        )

    [1] => Array
        (
            [file] => %s
            [line] => 13
            [function] => ThrowException
            [class] => myClass
            [type] => ::
            [args] => Array
                (
                )

        )

    [2] => Array
        (
            [file] => %s
            [line] => 21
            [function] => thrower
            [args] => Array
                (
                )

        )

)
Missing method 'foo'
Array
(
    [0] => Array
        (
            [file] => %s
            [line] => 17
            [function] => __call
            [class] => myClass
            [type] => ->
            [args] => Array
                (
                    [0] => foo
                    [1] => Array
                        (
                        )

                )

        )

    [1] => Array
        (
            [file] => %s
            [line] => 17
            [function] => foo
            [class] => myClass
            [type] => ->
            [args] => Array
                (
                )

        )

    [2] => Array
        (
            [file] => %s
            [line] => 28
            [function] => thrower2
            [args] => Array
                (
                )

        )

)