3v4l.org

run code in 300+ PHP versions simultaneously
<?php function main() { try { $nonExistingVariable->blah(); } catch(Throwable $e) { var_export($e); } } main();
Output for 8.0.0 - 8.0.20, 8.1.0 - 8.1.7
Warning: Undefined variable $nonExistingVariable in /in/S1Th4 on line 6 Error::__set_state(array( 'message' => 'Call to a member function blah() on null', 'string' => '', 'code' => 0, 'file' => '/in/S1Th4', 'line' => 6, 'trace' => array ( 0 => array ( 'file' => '/in/S1Th4', 'line' => 12, 'function' => 'main', 'args' => array ( ), ), ), 'previous' => NULL, ))
Output for 7.1.25 - 7.1.30, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.30
Notice: Undefined variable: nonExistingVariable in /in/S1Th4 on line 6 Error::__set_state(array( 'message' => 'Call to a member function blah() on null', 'string' => '', 'code' => 0, 'file' => '/in/S1Th4', 'line' => 6, 'trace' => array ( 0 => array ( 'file' => '/in/S1Th4', 'line' => 12, 'function' => 'main', 'args' => array ( ), ), ), 'previous' => NULL, ))
Output for 7.3.32 - 7.3.33
Error::__set_state(array( 'message' => 'Call to a member function blah() on null', 'string' => '', 'code' => 0, 'file' => '/in/S1Th4', 'line' => 6, 'trace' => array ( 0 => array ( 'file' => '/in/S1Th4', 'line' => 12, 'function' => 'main', 'args' => array ( ), ), ), 'previous' => NULL, ))

preferences:
63.82 ms | 413 KiB | 5 Q