<?php
declare (strict_types = 1);
namespace ProxyPay\Core;

use ProxyPay\Traits\Log;

class Statement extends \mysqli_stmt{

	use Log;

	#[\ReturnTypeWillChange]
	public function execute($params = null) {

		$result = parent::execute();

		if($this->error) {
			$backtrace = debug_backtrace();
			$this->log("{$this->error}
{$backtrace[0]['file']}:{$backtrace[0]['line']}
{$backtrace[1]['file']}:{$backtrace[1]['line']}
".date('Y-m-d H:i:s')."
".$_SERVER['REMOTE_ADDR']."
" . var_export($_REQUEST, true) . "
----------------
");

		}
		return $result;
	}

}