Bug #73139 [Com]: php throws error on OK function call
| From: | jim dot michaels at Jesusnjim dot com | Date: | Thu, 22 Sep 2016 07:44:53 +0000 |
| Subject: | Bug #73139 [Com]: php throws error on OK function call | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-204178@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73139&edit=1
ID: 73139
Comment by: jim dot michaels at Jesusnjim dot com
Reported by: jim dot michaels at Jesusnjim dot com
Summary: php throws error on OK function call
Status: Not a bug
Type: Bug
Package: Unknown/Other Function
Operating System: vista 32 amd
PHP Version: 7.1.0RC2
Block user comment: N
Private report: N
New Comment:
ReplaceComment is now functioning. I missed the quote. but the function that calls it to replace
multiple content tagged items in a file does not work.
menu7a.php in http://Jesusnjim.com/z/menu7a.zip
does not handle switch statements correctly.
to use, you must copy config7a-example.php to config7a.php and edit config7a.php with your web site
setup. it is almost done, but I think there is a bug in my code and in php because funny things are
happening and things that should happen don't, like replacing file content.
I have to go to bed right now, pick up in the morning I hope.
Previous Comments:
------------------------------------------------------------------------
[2016-09-21 23:04:11] requinix@php.net
"filler2,
"filler3,
------------------------------------------------------------------------
[2016-09-21 21:19:20] jim dot michaels at Jesusnjim dot com
Description:
------------
parser throwing errors on a function call when it should not.
this should not be happening. code is fine to my knowledge.
Wed 09/21/2016 14:17:02.80|C:\w\Jesusnjim|>php --version
PHP 7.1.0-dev (cli) (built: Sep 5 2016 07:44:38) ( NTS MSVC14 (Visual C++ 2015) x86 )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies
Test script:
---------------
<?php
function ReplaceComment($haystack, $replacemiddlewith, $beginneedle, $endneedle, &$result,
$tag){return true;}
$result="";
$z=ReplaceComment("<!-- menustart --><!-- menuend -->", "filler",
'<!-- menustart -->','<!-- menuend -->',
$result,"visitor");
echo ($z?"false":"true").$result."\r\n";
$z=ReplaceComment("<!-- menustart -->t<!-- menuend -->", "filler2,
'<!-- menustart -->','<!-- menuend -->',
$result,"visitor");
echo ($z?"false":"true").$result."\r\n";
$z=ReplaceComment("<!-- menustart -->123456789012345678<!-- menuend -->",
"filler3, '<!-- menustart -->','<!-- menuend
-->',$result,"visitor");
echo ($z?"false":"true").$result."\r\n";
exit(1);
?>
Expected result:
----------------
Wed 09/21/2016 14:13:10.19|C:\w\Jesusnjim|>php menu7a.php
PHP Parse error: syntax error, unexpected 'visitor' (T_STRING), expecting ','
or ')' in C:\w\Jesusnjim\menu7a.php on line 196
Parse error: syntax error, unexpected 'visitor' (T_STRING), expecting ',' or
')' in C:\w\Jesusnjim\menu7a.php on line 196
Wed 09/21/2016 14:13:59.24|C:\w\Jesusnjim|>
Actual result:
--------------
Wed 09/21/2016 14:13:10.19|C:\w\Jesusnjim|>php menu7a.php
PHP Parse error: syntax error, unexpected 'visitor' (T_STRING), expecting ','
or ')' in C:\w\Jesusnjim\menu7a.php on line 196
Parse error: syntax error, unexpected 'visitor' (T_STRING), expecting ',' or
')' in C:\w\Jesusnjim\menu7a.php on line 196
Wed 09/21/2016 14:13:59.24|C:\w\Jesusnjim|>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73139&edit=1