JavaScript error_get_last
!No description available for error_get_last. @php.js developers: Please update the function summary text file.
1 2 3 4 56 7 8 9 1011 12 | function error_get_last () { // !No description available for error_get_last. @php.js developers: Please update the function summary text file. // // version: 1109.2015 // discuss at: http://phpjs.org/functions/error_get_last // + original by: Brett Zamir (http://brett-zamir.me) // * example 1: error_get_last(); // * returns 1: null // * example 2: error_get_last(); // * returns 2: {type: 256, message: 'My user error', file: 'C:\WWW\index.php', line: 2} return this.php_js && this.php_js.last_error ? this.php_js.last_error : null; // Only set if error triggered within at() or trigger_error() } |
Examples
» Example 1
Running
1 | error_get_last(); |
Should return
1 | null |
» Example 2
Running
1 | error_get_last(); |
Should return
1 | {type: 256, message: 'My user error', file: 'C:\WWW\index.php', line: 2} |
Dependencies
No dependencies, you can use this function standalone.
Open syntax issues
php.js uses JsLint to help us keep our code consistent and prevent some common bugs.
Eventually we want all code to pass or at least take into consideration most fixes suggested by JsLint, following this JsLint configuration we’ve decided on.
Authors
Thanks to the following developers, you get to have error_get_last goodness in JavaScript.
No comments yet. Be the first!
spread the word:
Use any PHP function in JavaScript
These kind folks have already donated: AYHAN BARI*, Nikita Ekshiyan, Nikita Ekshiyan, Petr Pavel, @HalfWinter, Paulo Freitas, Andros Peña Romo, @andorosu, Raimund Szabo, Nitin Gupta, @nikosdion, Anonymous, Anonymous and Shawn Houser.
<your name here>