private static function getConsoleMode()
    {
        $info = static::runCommand('mode CON');

        if ($info && preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) {
            // extract [w, h] from "wxh"
            return [(int) $matches[2], (int) $matches[1]];
        }

        return [];
    }
private static function getConsoleMode()
    {
        $info = static::runCommand('mode CON');

        if ($info && preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) {
            // extract [w, h] from "wxh"
            return [(int) $matches[2], (int) $matches[1]];
        }

        return [];
    }
private static function getConsoleMode ( ) { $ info = static :: runCommand ( 'mode CON' ) ; if ( $ info && preg_match ( '/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/' , $ info , $ matches ) ) { // extract [w, h] from "wxh" return [ ( int ) $ matches [ 2 ] , ( int ) $ matches [ 1 ] ] ; } return [ ] ; }
Run console mode command and parse output to width & height.

@return int[]
Run console mode command and parse output to width & height .