is_numeric関数の挙動がドキュメントに従っていない


is_numeric関数は、数値形式の文字列かどうかを判定する関数です。
その基準について、ドキュメントには以下のように記載されています。

[PHP: is_numeric - Manual](http://php.net/manual/ja/function.is-numeric.php)

<blockquote cite="http://php.net/manual/ja/function.is-numeric.php#refsect1-function.is-numeric-description">
<p>
   指定した変数が数値であるかどうかを調べます。数値形式の文字列は以下の要素から
   なります。（オプションの）符号、任意の数の数字、（オプションの）小数部、
   そして（オプションの）指数部。つまり、<em>+0123.45e6</em>
   は数値として有効な値です。十六進表記（<em>0xf4c3b00c</em> など)
   や二進表記 (<em>0b10100111001</em> など)、そして八進表記
   (<em>0777</em> など) は認められません。
  </p>
</blockquote>

<blockquote cite="http://php.net/manual/ja/function.is-numeric.php#refsect1-function.is-numeric-changelog">
<table>
    
     <thead>
      <tr>
       <th>バージョン</th>
       <th>説明</th>
      </tr>

     </thead>

     <tbody>
      <tr>
       <td>7.0.0</td>
       <td>
        十六進表記（<em>0xf4c3b00c</em> など) の文字列は数値形式の文字列とみなされなくなりました。
        つまり、<strong>is_numeric()</strong> は <strong><code>FALSE</code></strong> を返すようになりました。
       </td>
      </tr>

     </tbody>
    
   </table>
</blockquote>

これに従うならば、以下のコードは

```php
<?php

/**
 * 出力をテキストとして表示するため、テキストファイルのContent-Typeを送信
 */
header('Content-Type: text/plain');

$tests = [
	'42', // 普通の数値
	'0xf4c3b00c', // 十六進表記
	'0777', // 八進表記
	'0b10100111001', // 二進表記
	'1337e0', // 指数部を含む数値
	'+42', // 符号付きの数値
	'3.141592', // 小数部を含む数値
	'not numeric', // 数値ではない文字列
];

foreach ($tests as $element) {
	echo '"', $element, '" is' . (is_numeric($element) ? '' : ' NOT') . ' numeric', PHP_EOL;
}
```

このような出力となるはずです。

```text:PHP&#32;7以上
"42" is numeric
"0xf4c3b00c" is NOT numeric
"0777" is NOT numeric
"0b10100111001" is NOT numeric
"1337e0" is numeric
"+42" is numeric
"3.141592" is numeric
"not numeric" is NOT numeric

```

```text:PHP&#32;7未満
"42" is numeric
"0xf4c3b00c" is numeric
"0777" is NOT numeric
"0b10100111001" is NOT numeric
"1337e0" is numeric
"+42" is numeric
"3.141592" is numeric
"not numeric" is NOT numeric

```

しかし、実際に実行してみると…

[PHP 7.0.0beta2の場合](http://codepad.viper-7.com/inncMN)

```text:PHP&#32;7.0.0beta2
"42" is numeric
"0xf4c3b00c" is NOT numeric
"0777" is numeric
"0b10100111001" is NOT numeric
"1337e0" is numeric
"+42" is numeric
"3.141592" is numeric
"not numeric" is NOT numeric

```

```diff:ドキュメントに従った動作との差分
 "42" is numeric
 "0xf4c3b00c" is NOT numeric
-"0777" is NOT numeric
+"0777" is numeric
 "0b10100111001" is NOT numeric
 "1337e0" is numeric
 "+42" is numeric
 "3.141592" is numeric
 "not numeric" is NOT numeric
 
```

[PHP 7.0.0alpha2の場合](http://codepad.viper-7.com/mjfsNZ)

```text:PHP&#32;7.0.0alpha2
"42" is numeric
"0xf4c3b00c" is NOT numeric
"0777" is numeric
"0b10100111001" is NOT numeric
"1337e0" is numeric
"+42" is numeric
"3.141592" is numeric
"not numeric" is NOT numeric

```

```diff:ドキュメントに従った動作との差分
 "42" is numeric
 "0xf4c3b00c" is NOT numeric
-"0777" is NOT numeric
+"0777" is numeric
 "0b10100111001" is NOT numeric
 "1337e0" is numeric
 "+42" is numeric
 "3.141592" is numeric
 "not numeric" is NOT numeric
 
```

[PHP 5.6.8の場合](http://codepad.viper-7.com/ngpchz)

```text:PHP&#32;5.6.8
"42" is numeric
"0xf4c3b00c" is numeric
"0777" is numeric
"0b10100111001" is NOT numeric
"1337e0" is numeric
"+42" is numeric
"3.141592" is numeric
"not numeric" is NOT numeric

```

```diff:ドキュメントに従った動作との差分
 "42" is numeric
 "0xf4c3b00c" is numeric
-"0777" is NOT numeric
+"0777" is numeric
 "0b10100111001" is NOT numeric
 "1337e0" is numeric
 "+42" is numeric
 "3.141592" is numeric
 "not numeric" is NOT numeric
 
```

[PHP 5.6.10の場合](http://codepad.viper-7.com/Dxu2Di)

```text:PHP&#32;5.6.10
"42" is numeric
"0xf4c3b00c" is numeric
"0777" is numeric
"0b10100111001" is NOT numeric
"1337e0" is numeric
"+42" is numeric
"3.141592" is numeric
"not numeric" is NOT numeric

```

```diff:ドキュメントに従った動作との差分
 "42" is numeric
 "0xf4c3b00c" is numeric
-"0777" is NOT numeric
+"0777" is numeric
 "0b10100111001" is NOT numeric
 "1337e0" is numeric
 "+42" is numeric
 "3.141592" is numeric
 "not numeric" is NOT numeric
 
```

[PHP 5.5.24の場合](http://codepad.viper-7.com/YxAwDw)

```text:PHP&#32;5.5.24
"42" is numeric
"0xf4c3b00c" is numeric
"0777" is numeric
"0b10100111001" is NOT numeric
"1337e0" is numeric
"+42" is numeric
"3.141592" is numeric
"not numeric" is NOT numeric

```

```diff:ドキュメントに従った動作との差分
 "42" is numeric
 "0xf4c3b00c" is numeric
-"0777" is NOT numeric
+"0777" is numeric
 "0b10100111001" is NOT numeric
 "1337e0" is numeric
 "+42" is numeric
 "3.141592" is numeric
 "not numeric" is NOT numeric
 
```

[PHP 5.4.42の場合](http://codepad.viper-7.com/tq3Auz)

```text:PHP&#32;5.4.42
"42" is numeric
"0xf4c3b00c" is numeric
"0777" is numeric
"0b10100111001" is NOT numeric
"1337e0" is numeric
"+42" is numeric
"3.141592" is numeric
"not numeric" is NOT numeric

```

```diff:ドキュメントに従った動作との差分
 "42" is numeric
 "0xf4c3b00c" is numeric
-"0777" is NOT numeric
+"0777" is numeric
 "0b10100111001" is NOT numeric
 "1337e0" is numeric
 "+42" is numeric
 "3.141592" is numeric
 "not numeric" is NOT numeric
 
```

[PHP 5.4.40の場合](http://codepad.viper-7.com/7xDiW3)

```text:PHP&#32;5.4.40
"42" is numeric
"0xf4c3b00c" is numeric
"0777" is numeric
"0b10100111001" is NOT numeric
"1337e0" is numeric
"+42" is numeric
"3.141592" is numeric
"not numeric" is NOT numeric

```

```diff:ドキュメントに従った動作との差分
 "42" is numeric
 "0xf4c3b00c" is numeric
-"0777" is NOT numeric
+"0777" is numeric
 "0b10100111001" is NOT numeric
 "1337e0" is numeric
 "+42" is numeric
 "3.141592" is numeric
 "not numeric" is NOT numeric
 
```

ドキュメントでは、八進表記(`0777`など)は認められないと明記されています。
にも関わらず、すべてのバージョンのPHPにおいて、明らかに八進表記でtrueが返されています。