I tried the code on vb4.2.1, again, not that I would actually do it this way, but it worked the way I expected.
Change the hook to "parse_templates" for the most accurate count -- the count will still be off as I guessed.
To test: set "PageCount = 'Test of Page Count'; (Some long string, not a number)
Here is my test code:
Code:
// Hook: parse_templates
session_start();
$PageCount = $_SESSION['PageCount']++;
vB_Template::PreRegister('header',array('PageCount' => $PageCount));
Out of suggestions for right now.