From: shawn at shawnbiddle dot com
Operating system: Linux
PHP version: 5.2.9
PHP Bug Type: Scripting Engine problem
Bug description: Tokenizer reports two T_INLINE_HTML at tags starting with s
Description:
------------
If token_get_all is run on a script that contains both PHP and HTML it
will split T_INLINE_HTML tokens up any time it runs across an html tag
starting with s. My example uses span but as I said, it's any tag starting
with s.
Reproduce code:
---------------
<?php
print_r(token_get_all('<?php echo "Hello World!"; ?><h6>Hello</h6><span
class="test">Hello!</span><?php echo "Goodbye, World!"; ?>'));
?>
Expected result:
----------------
Array
(
[0] => Array
(
[0] => 367
[1] => <?php
[2] => 1
)
[1] => Array
(
[0] => 316
[1] => echo
[2] => 1
)
[2] => Array
(
[0] => 370
[1] =>
[2] => 1
)
[3] => Array
(
[0] => 315
[1] => "Hello World!"
[2] => 1
)
[4] => ;
[5] => Array
(
[0] => 370
[1] =>
[2] => 1
)
[6] => Array
(
[0] => 369
[1] => ?>
[2] => 1
)
[7] => Array
(
[0] => 311
[1] => <h6>Hello</h6><span class="test">Hello!</span>
[2] => 1
)
[8] => Array
(
[0] => 367
[1] => <?php
[2] => 1
)
[9] => Array
(
[0] => 316
[1] => echo
[2] => 1
)
[10] => Array
(
[0] => 370
[1] =>
[2] => 1
)
[11] => Array
(
[0] => 315
[1] => "Goodbye, World!"
[2] => 1
)
[12] => ;
[13] => Array
(
[0] => 370
[1] =>
[2] => 1
)
[14] => Array
(
[0] => 369
[1] => ?>
[2] => 1
)
)
Actual result:
--------------
Array
(
[0] => Array
(
[0] => 367
[1] => <?php
[2] => 1
)
[1] => Array
(
[0] => 316
[1] => echo
[2] => 1
)
[2] => Array
(
[0] => 370
[1] =>
[2] => 1
)
[3] => Array
(
[0] => 315
[1] => "Hello World!"
[2] => 1
)
[4] => ;
[5] => Array
(
[0] => 370
[1] =>
[2] => 1
)
[6] => Array
(
[0] => 369
[1] => ?>
[2] => 1
)
[7] => Array
(
[0] => 311
[1] => <h6>Hello</h6>
[2] => 1
)
[8] => Array
(
[0] => 311
[1] => <s
[2] => 1
)
[9] => Array
(
[0] => 311
[1] => pan class="test">Hello!</span>
[2] => 1
)
[10] => Array
(
[0] => 367
[1] => <?php
[2] => 1
)
[11] => Array
(
[0] => 316
[1] => echo
[2] => 1
)
[12] => Array
(
[0] => 370
[1] =>
[2] => 1
)
[13] => Array
(
[0] => 315
[1] => "Goodbye, World!"
[2] => 1
)
[14] => ;
[15] => Array
(
[0] => 370
[1] =>
[2] => 1
)
[16] => Array
(
[0] => 369
[1] => ?>
[2] => 1
)
)
--
Edit bug report at http://bugs.php.net/?id=48446&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48446&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48446&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48446&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48446&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48446&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48446&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48446&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48446&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48446&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48446&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48446&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48446&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48446&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48446&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48446&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48446&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48446&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48446&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48446&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48446&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48446&r=mysqlcfg