Skip to content

Change HTML output according to HTML -- Living Standard spec #1301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PHP NEWS
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23 Jul 2015, PHP 7.0.0 Beta 2

Expand Down Expand Up @@ -186,6 +186,7 @@
? with ===). (Dmitry, Laruence)
. Fixed bug #69758 (Item added to array not being removed by array_pop/shift
). (Laruence)
. Fixed bug #68091 (Some Zend headers lack appropriate extern "C" blocks).
. Fixed bug #68475 (Add support for $callable() sytnax with 'Class::method').
(Julien, Aaron Piotrowski)
. Fixed bug #69485 (Double free on zend_list_dtor). (Laruence)
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug35655.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ highlight_string($code);
?>
--EXPECT--
<code><span style="color: #000000">
<br /><span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;$x&nbsp;</span><span style="color: #007700">=&nbsp;&lt;&lt;&lt;EOT<br /></span><span style="color: #DD0000">some&nbsp;string&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #007700">EOT<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$y&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
<br><span style="color: #0000BB">&lt;?php<br>&nbsp;&nbsp;$x&nbsp;</span><span style="color: #007700">=&nbsp;&lt;&lt;&lt;EOT<br></span><span style="color: #DD0000">some&nbsp;string&nbsp;&nbsp;&nbsp;&nbsp;<br></span><span style="color: #007700">EOT<br>&nbsp;&nbsp;</span><span style="color: #0000BB">$y&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">;<br></span><span style="color: #0000BB">?&gt;</span>
</span>
</code>
2 changes: 1 addition & 1 deletion Zend/tests/nowdoc_013.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ highlight_string($code);
?>
--EXPECT--
<code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;$x&nbsp;</span><span style="color: #007700">=&nbsp;&lt;&lt;&lt;'EOT'<br /></span><span style="color: #DD0000">some&nbsp;string&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #007700">EOT<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$y&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
<span style="color: #0000BB">&lt;?php<br>&nbsp;&nbsp;$x&nbsp;</span><span style="color: #007700">=&nbsp;&lt;&lt;&lt;'EOT'<br></span><span style="color: #DD0000">some&nbsp;string&nbsp;&nbsp;&nbsp;&nbsp;<br></span><span style="color: #007700">EOT<br>&nbsp;&nbsp;</span><span style="color: #0000BB">$y&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">;<br></span><span style="color: #0000BB">?&gt;</span>
</span>
</code>
2 changes: 1 addition & 1 deletion Zend/tests/nowdoc_014.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ highlight_string($code);
?>
--EXPECT--
<code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;$x&nbsp;</span><span style="color: #007700">=&nbsp;&lt;&lt;&lt;'EOT'<br />EOT<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$y&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
<span style="color: #0000BB">&lt;?php<br>&nbsp;&nbsp;$x&nbsp;</span><span style="color: #007700">=&nbsp;&lt;&lt;&lt;'EOT'<br>EOT<br>&nbsp;&nbsp;</span><span style="color: #0000BB">$y&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">;<br></span><span style="color: #0000BB">?&gt;</span>
</span>
</code>
2 changes: 1 addition & 1 deletion Zend/zend_highlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ZEND_API void zend_html_putc(char c)
{
switch (c) {
case '\n':
ZEND_PUTS("<br />");
ZEND_PUTS("<br>");
break;
case '<':
ZEND_PUTS("&lt;");
Expand Down
2 changes: 1 addition & 1 deletion ext/com_dotnet/com_com.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
SysFreeString(e.bstrDescription);
}
if (PG(html_errors)) {
spprintf(&msg, 0, "<b>Source:</b> %s<br/><b>Description:</b> %s",
spprintf(&msg, 0, "<b>Source:</b> %s<br><b>Description:</b> %s",
source ? source : "Unknown",
desc ? desc : "Unknown");
} else {
Expand Down
4 changes: 2 additions & 2 deletions ext/phar/phar.c
Original file line number Diff line number Diff line change
Expand Up @@ -3560,9 +3560,9 @@ PHP_MINFO_FUNCTION(phar) /* {{{ */

php_info_print_box_start(0);
PUTS("Phar based on pear/PHP_Archive, original concept by Davey Shafik.");
PUTS(!sapi_module.phpinfo_as_text?"<br />":"\n");
PUTS( !sapi_module.phpinfo_as_text ? "<br>" : "\n" );
PUTS("Phar fully realized by Gregory Beaver and Marcus Boerger.");
PUTS(!sapi_module.phpinfo_as_text?"<br />":"\n");
PUTS( !sapi_module.phpinfo_as_text ? "<br>" : "\n" );
PUTS("Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.");
php_info_print_box_end();

Expand Down
4 changes: 2 additions & 2 deletions ext/phar/tests/phpinfo_004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ phpinfo(INFO_MODULES);
</table>
<table>
<tr class="v"><td>
Phar based on pear/PHP_Archive, original concept by Davey Shafik.<br />Phar fully realized by Gregory Beaver and Marcus Boerger.<br />Portions of tar implementation Copyright (c) %d-%d Tim Kientzle.</td></tr>
Phar based on pear/PHP_Archive, original concept by Davey Shafik.<br>Phar fully realized by Gregory Beaver and Marcus Boerger.<br>Portions of tar implementation Copyright (c) %d-%d Tim Kientzle.</td></tr>
</table>
<table>
<tr class="h"><th>Directive</th><th>Local Value</th><th>Master Value</th></tr>
Expand All @@ -63,7 +63,7 @@ Phar based on pear/PHP_Archive, original concept by Davey Shafik.<br />Phar full
</table>
<table>
<tr class="v"><td>
Phar based on pear/PHP_Archive, original concept by Davey Shafik.<br />Phar fully realized by Gregory Beaver and Marcus Boerger.<br />Portions of tar implementation Copyright (c) %d-%d Tim Kientzle.</td></tr>
Phar based on pear/PHP_Archive, original concept by Davey Shafik.<br>Phar fully realized by Gregory Beaver and Marcus Boerger.<br>Portions of tar implementation Copyright (c) %d-%d Tim Kientzle.</td></tr>
</table>
<table>
<tr class="h"><th>Directive</th><th>Local Value</th><th>Master Value</th></tr>
Expand Down
2 changes: 1 addition & 1 deletion ext/spl/spl.php
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ function next() {/**/}
*
* For a detailed explanation see Observer pattern in
* <em>
* Gamma, Helm, Johnson, Vlissides<br />
* Gamma, Helm, Johnson, Vlissides<br>
* Design Patterns
* </em>
*/
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/dl.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now)

PHP_MINFO_FUNCTION(dl)
{
PUTS("Dynamic Library support not available<br />.\n");
PUTS("Dynamic Library support not available<br>.\n");
}

#endif
Expand Down
35 changes: 20 additions & 15 deletions ext/standard/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module) /* {{{ */
zend_string *url_name = php_url_encode(zend_module->name, strlen(zend_module->name));

php_strtolower(ZSTR_VAL(url_name), ZSTR_LEN(url_name));
php_info_printf("<h2><a name=\"module_%s\">%s</a></h2>\n", ZSTR_VAL(url_name), zend_module->name);
php_info_printf("<h2 id=\"module_%s\">%s</h2>\n", ZSTR_VAL(url_name), zend_module->name);

efree(url_name);
} else {
Expand Down Expand Up @@ -795,12 +795,15 @@ PHPAPI zend_string *php_get_uname(char mode)
*/
PHPAPI void php_print_info_htmlhead(void)
{
php_info_print("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n");
php_info_print("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
php_info_print("<!doctype html>\n");
php_info_print("<html>");
php_info_print("<head>\n");

php_info_print("<meta name=\"robots\" content=\"noindex,nofollow,noarchive\">\n");
php_info_print("<meta charset=\"utf-8\">\n"); /* utf-8 intentionally hardcoded */
php_info_print("<title>phpinfo()</title>\n");

php_info_print_style();
php_info_print("<title>phpinfo()</title>");
php_info_print("<meta name=\"ROBOTS\" content=\"NOINDEX,NOFOLLOW,NOARCHIVE\" />");
php_info_print("</head>\n");
php_info_print("<body><div class=\"center\">\n");
}
Expand Down Expand Up @@ -847,12 +850,14 @@ PHPAPI void php_print_info(int flag)
the_time = time(NULL);
ta = php_localtime_r(&the_time, &tmbuf);

php_info_print("<a href=\"http://www.php.net/\"><img border=\"0\" src=\"");
if (ta && (ta->tm_mon==3) && (ta->tm_mday==1)) {
php_info_print(PHP_EGG_LOGO_DATA_URI "\" alt=\"PHP logo\" /></a>");
} else {
php_info_print(PHP_LOGO_DATA_URI "\" alt=\"PHP logo\" /></a>");
}
php_info_print("<a href=\"http://www.php.net/\"><img border=\"0\" src=\"");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You didn't change border to a style property here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing, my mistake. I think I will better rewrite phpinfo()'s output more heavily, to use more stylesheets instead of obsolete attrs etc. and target this to 7.1.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking of using stylesheets. highlight_*() from what I can see in the commit it is now using the style attr. If you are targetting 7.1 then you could use classes instead and use http://caniuse.com/#feat=style-scoped (provided there is enough browser support by then).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(provided there is enough browser support by then).

Sadly there isn't and seems there won't be support for that in the near
future (additionaly, Chrome already removed it). But it doesn't matter at
all, there's no problem for stylesheets to have scoped attr with (possible)
forward compatibility and additionaly all classNames prefixed e.g. with php-
.

What's your opinion on this?

Thanks,
Kubo2

2015-05-27 0:06 GMT+02:00 Orion notifications@github.com:

In ext/standard/info.c
#1301 (comment):

@@ -637,12 +640,14 @@ PHPAPI void php_print_info(int flag)
the_time = time(NULL);
ta = php_localtime_r(&the_time, &tmbuf);

  •        php_info_print("<a href=\"http://www.php.net/\"><img border=\"0\" src=\"");
    
  •       if (ta && (ta->tm_mon==3) && (ta->tm_mday==1)) {
    
  •           php_info_print(PHP_EGG_LOGO_DATA_URI "\" alt=\"PHP logo\" /></a>");
    
  •       } else {
    
  •           php_info_print(PHP_LOGO_DATA_URI "\" alt=\"PHP logo\" /></a>");
    
  •       }
    
  •       php_info_print("<a href=\"http://www.php.net/\"><img border=\"0\" src=\"");
    

Speaking of using stylesheets. highlight__() from what I can see in the
commit it is now using the style attr. If you are targetting 7.1 then you
could use classes instead and use http://caniuse.com/#feat=style-scoped *(provided
there is enough browser support by then)_.


Reply to this email directly or view it on GitHub
https://github.com/php/php-src/pull/1301/files#r31084860.

if (ta && (ta->tm_mon==3) && (ta->tm_mday==1)) {
php_info_print(PHP_EGG_LOGO_DATA_URI "\" alt=\"PHP easter-egg logo\">");
} else {
php_info_print(PHP_LOGO_DATA_URI "\" alt=\"PHP logo\">");
}
php_info_print("</a>");

}

if (!sapi_module.phpinfo_as_text) {
Expand Down Expand Up @@ -954,11 +959,11 @@ PHPAPI void php_print_info(int flag)
/* Zend Engine */
php_info_print_box_start(0);
if (!sapi_module.phpinfo_as_text) {
php_info_print("<a href=\"http://www.zend.com/\"><img border=\"0\" src=\"");
php_info_print(ZEND_LOGO_DATA_URI "\" alt=\"Zend logo\" /></a>\n");
php_info_print("<a href=\"http://www.zend.com/\"><img style=\"border: 0\" src=\"");
php_info_print(ZEND_LOGO_DATA_URI "\" alt=\"Zend logo\"></a>\n");
}
php_info_print("This program makes use of the Zend Scripting Language Engine:");
php_info_print(!sapi_module.phpinfo_as_text?"<br />":"\n");
php_info_print( !sapi_module.phpinfo_as_text ? "<br>" : "\n" );
if (sapi_module.phpinfo_as_text) {
php_info_print(zend_version);
} else {
Expand Down Expand Up @@ -1142,7 +1147,7 @@ PHPAPI void php_info_print_box_end(void) /* {{{ */
PHPAPI void php_info_print_hr(void) /* {{{ */
{
if (!sapi_module.phpinfo_as_text) {
php_info_print("<hr />\n");
php_info_print("<hr>\n");
} else {
php_info_print("\n\n _______________________________________________________________________\n\n");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ highlight_string($str);
?>
--EXPECT--
<code><span style="color: #000000">
<br />$x=&lt;&lt;&lt;DD<br />jhdsjkfhjdsh<br />DD<br />."";<br />$a=&lt;&lt;&lt;DDDD<br />jhdsjkfhjdsh<br />DDDD;<br /></span>
<br>$x=&lt;&lt;&lt;DD<br>jhdsjkfhjdsh<br>DD<br>."";<br>$a=&lt;&lt;&lt;DDDD<br>jhdsjkfhjdsh<br>DDDD;<br></span>
</code>
3 changes: 2 additions & 1 deletion ext/standard/tests/general_functions/phpcredits2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ var_dump(phpcredits(CREDITS_GROUP));

?>
--EXPECTF--
<!DOCTYPE %a>%s</html>
<!doctype html>
%a</html>
bool(true)

Warning: phpcredits() expects parameter 1 to be integer, array given in %sphpcredits2.php on line 4
Expand Down
6 changes: 3 additions & 3 deletions ext/standard/tests/general_functions/phpinfo2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ var_dump(phpinfo(INFO_LICENSE));

?>
--EXPECTF--
<!DOCTYPE %s>
<!doctype html>
%a</html>bool(true)
--

Warning: phpinfo() expects parameter 1 to be integer, array given in %sphpinfo2.php on line 5
NULL
--
<!DOCTYPE %s>
<!doctype html>
%a</html>bool(true)
--
<!DOCTYPE %s>
<!doctype html>
%a</html>bool(true)
2 changes: 1 addition & 1 deletion ext/standard/tests/strings/highlight_file.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ bool(false)
</span>
</code>bool(true)
<code><span style="color: #000000">
<br /><span style="color: #0000BB">&lt;?php&nbsp;<br />&nbsp;</span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">test&nbsp;</span><span style="color: #007700">{&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;</span><span style="color: #0000BB">$var&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;function&nbsp;</span><span style="color: #0000BB">foo</span><span style="color: #007700">()&nbsp;{&nbsp;echo&nbsp;</span><span style="color: #DD0000">"foo"</span><span style="color: #007700">;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">bar</span><span style="color: #007700">()&nbsp;{&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">test</span><span style="color: #007700">::</span><span style="color: #0000BB">foo</span><span style="color: #007700">());&nbsp;}<br />&nbsp;}&nbsp;&nbsp;<br /></span><span style="color: #0000BB">?&gt;</span>
<br><span style="color: #0000BB">&lt;?php&nbsp;<br>&nbsp;</span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">test&nbsp;</span><span style="color: #007700">{&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;</span><span style="color: #0000BB">$var&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;function&nbsp;</span><span style="color: #0000BB">foo</span><span style="color: #007700">()&nbsp;{&nbsp;echo&nbsp;</span><span style="color: #DD0000">"foo"</span><span style="color: #007700">;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">bar</span><span style="color: #007700">()&nbsp;{&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">test</span><span style="color: #007700">::</span><span style="color: #0000BB">foo</span><span style="color: #007700">());&nbsp;}<br>&nbsp;}&nbsp;&nbsp;<br></span><span style="color: #0000BB">?&gt;</span>
</span>
</code>bool(true)
Done
50 changes: 39 additions & 11 deletions ext/standard/tests/strings/nl2br.phpt
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
--TEST--
nl2br() function
--DESCRIPTION--
This tests \nl2br() PHP core/string function and its
behavior with different arguments passed.
--FILE--
<?php
var_dump(nl2br("test"));
var_dump(nl2br(""));
var_dump(nl2br(NULL));
var_dump(nl2br("\r\n"));
var_dump(nl2br("\n"));
var_dump(nl2br("\r"));
var_dump(nl2br("\n\r"));

var_dump(nl2br("\n\r\r\n\r\r\r\r"));
var_dump(nl2br("\n\r\n\n\r\n\r\r\n\r\n"));
var_dump(nl2br("\n\r\n\n\n\n\r\r\r\r\n\r"));
// without any newlines
var_dump( nl2br("test"));
var_dump( nl2br(''));
var_dump( nl2br(NULL));

// CRLF
var_dump( nl2br("\r\n"));

// LF
var_dump( nl2br("\n"));

// CR
var_dump( nl2br("\r"));

// LFCR
var_dump( nl2br("\n\r"));

// mixins
var_dump( nl2br("\n\r\r\n\r\r\r\r"));
var_dump( nl2br("\n\r\n\n\r\n\r\r\n\r\n"));
var_dump( nl2br("\n\r\n\n\n\n\r\r\r\r\n\r"));

// second arfgument: $is_xhtml [ = true ]
var_dump( nl2br("Some text\nwith newlines\nin it", false));
var_dump( nl2br("Some text\nwith newlines\nin it", true));
var_dump( nl2br("\r\n", false)); // CRLF convert to HTML
?>
--EXPECT--
string(4) "test"
Expand Down Expand Up @@ -43,3 +60,14 @@ string(66) "<br />
<br />
<br /><br /><br />
<br />"
string(37) "Some text<br>
with newlines<br>
in it"
string(41) "Some text<br />
with newlines<br />
in it"
string(6) "<br>
"
--CREDITS--
In 2015 rewritten by Kubo2 <kelerest123@gmail.com>

Expand Down
2 changes: 1 addition & 1 deletion ext/standard/tests/strings/show_source_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ show_source(__FILE__);
--EXPECTF--
*** Test by calling method or function with its expected arguments ***
<code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"***&nbsp;Test&nbsp;by&nbsp;calling&nbsp;method&nbsp;or&nbsp;function&nbsp;with&nbsp;its&nbsp;expected&nbsp;arguments&nbsp;***\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$foo&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'bar'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$baz&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"something&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$foo</span><span style="color: #007700">.</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br />if&nbsp;(&nbsp;</span><span style="color: #0000BB">$foo&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #DD0000">'bar'&nbsp;</span><span style="color: #007700">)&nbsp;<br />{<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$baz&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'baz'</span><span style="color: #007700">;<br />}<br /><br />&nbsp;</span><span style="color: #FF8000">/*&nbsp;some&nbsp;code&nbsp;here&nbsp;*/<br />&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">show_source</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;<br /></span>
<span style="color: #0000BB">&lt;?php<br></span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"***&nbsp;Test&nbsp;by&nbsp;calling&nbsp;method&nbsp;or&nbsp;function&nbsp;with&nbsp;its&nbsp;expected&nbsp;arguments&nbsp;***\n"</span><span style="color: #007700">;<br></span><span style="color: #0000BB">$foo&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'bar'</span><span style="color: #007700">;<br></span><span style="color: #0000BB">$baz&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"something&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">$foo</span><span style="color: #007700">.</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br><br>if&nbsp;(&nbsp;</span><span style="color: #0000BB">$foo&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #DD0000">'bar'&nbsp;</span><span style="color: #007700">)&nbsp;<br>{<br>&nbsp;&nbsp;</span><span style="color: #0000BB">$baz&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'baz'</span><span style="color: #007700">;<br>}<br><br>&nbsp;</span><span style="color: #FF8000">/*&nbsp;some&nbsp;code&nbsp;here&nbsp;*/<br>&nbsp;&nbsp;&nbsp;<br></span><span style="color: #0000BB">show_source</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">);<br><br></span><span style="color: #0000BB">?&gt;<br></span>
</span>
</code>
Loading