Skip to main content

In any PHP application you can just do:

$e = new \Exception();
echo '<pre>';
print_r($e->getTraceAsString()); 
exit;

Due to name spacing in M2, you need to use new \Exception(); instead of just new Exception();

In any PHP application you can just do:

$e = new \Exception();
print_r($e->getTraceAsString()); 
exit;

Due to name spacing in M2, you need to use new \Exception(); instead of just new Exception();

In any PHP application you can just do:

$e = new \Exception();
echo '<pre>';
print_r($e->getTraceAsString()); 
exit;

Due to name spacing in M2, you need to use new \Exception(); instead of just new Exception();

added 4 characters in body
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80

In any PHP application you can just do:

$e = new \Exception();
print_r($e->getTraceAsString()); 
exit;

Due to name spacing in M2, you need to use new \Exception();new \Exception(); instead of just new Exception();new Exception();

In any PHP application you can just do:

$e = new \Exception();
print_r($e->getTraceAsString()); 
exit;

Due to name spacing in M2, you need to use new \Exception(); instead of just new Exception();

In any PHP application you can just do:

$e = new \Exception();
print_r($e->getTraceAsString()); 
exit;

Due to name spacing in M2, you need to use new \Exception(); instead of just new Exception();

added 65 characters in body
Source Link
Paras Sood
  • 2.6k
  • 1
  • 15
  • 23

In any PHP application you can just do:

$e = new Exception\Exception();
print_r($e->getTraceAsString()); 
exit;

Due to name spacing in M2, you need to use new \Exception(); instead of just new Exception();

In any PHP application you can just do:

$e = new Exception();
print_r($e->getTraceAsString()); 
exit;

In any PHP application you can just do:

$e = new \Exception();
print_r($e->getTraceAsString()); 
exit;

Due to name spacing in M2, you need to use new \Exception(); instead of just new Exception();

Source Link
Paras Sood
  • 2.6k
  • 1
  • 15
  • 23
Loading