Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 810632a

Browse files
committed
Address some comments
1 parent 935a283 commit 810632a

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

‎sapi/cgi/tests/012.phpt‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function run_and_output($cmd) {
1414
}
1515
exec($cmd, $output, $exit_code);
1616
print_r($output);
17-
var_dump($exit_code == 0);
17+
var_dump($exit_code);
1818
}
1919

2020
$php = get_cgi_path();
@@ -33,9 +33,6 @@ echo "hi";
3333

3434
file_put_contents($filename_good, $code);
3535

36-
run_and_output("$php -n -l $filename_good_escaped$filename_good_escaped");
37-
run_and_output("$php -n -l $filename_good_escaped some.unknown $filename_good_escaped");
38-
3936
$code = '
4037
<?php
4138
@@ -48,6 +45,8 @@ class test
4845

4946
file_put_contents($filename_bad, $code);
5047

48+
run_and_output("$php -n -l $filename_good_escaped$filename_good_escaped");
49+
run_and_output("$php -n -l $filename_good_escaped some.unknown $filename_good_escaped");
5150
run_and_output("$php -n -l $filename_good_escaped$filename_bad_escaped$filename_good_escaped");
5251
run_and_output("$php -n -l $filename_bad_escaped$filename_bad_escaped");
5352
run_and_output("$php -n -l $filename_bad_escaped some.unknown $filename_bad_escaped");
@@ -66,13 +65,13 @@ Array
6665
[0] => No syntax errors detected in %s012_good.test.php
6766
[1] => No syntax errors detected in %s012_good.test.php
6867
)
69-
bool(true)
68+
int(0)
7069
Array
7170
(
7271
[0] => No syntax errors detected in %s012_good.test.php
7372
[1] => No input file specified.
7473
)
75-
bool(false)
74+
int(255)
7675
Array
7776
(
7877
[0] => No syntax errors detected in %s012_good.test.php
@@ -81,7 +80,7 @@ Array
8180
[3] => Errors parsing %s012_bad.test.php
8281
[4] => No syntax errors detected in %s012_good.test.php
8382
)
84-
bool(false)
83+
int(255)
8584
Array
8685
(
8786
[0] => <br />
@@ -91,15 +90,15 @@ Array
9190
[4] => <b>Parse error</b>: syntax error, unexpected token &quot;private&quot;, expecting &quot;{&quot; in <b>%s012_bad.test.php</b> on line <b>5</b><br />
9291
[5] => Errors parsing %s012_bad.test.php
9392
)
94-
bool(false)
93+
int(255)
9594
Array
9695
(
9796
[0] => <br />
9897
[1] => <b>Parse error</b>: syntax error, unexpected token &quot;private&quot;, expecting &quot;{&quot; in <b>%s012_bad.test.php</b> on line <b>5</b><br />
9998
[2] => Errors parsing %s012_bad.test.php
10099
[3] => No input file specified.
101100
)
102-
bool(false)
101+
int(255)
103102
Array
104103
(
105104
[0] => <br />
@@ -110,5 +109,5 @@ Array
110109
[5] => Errors parsing %s012_bad.test.php
111110
[6] => No input file specified.
112111
)
113-
bool(false)
112+
int(255)
114113
Done

‎sapi/cli/php_cli.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,14 +1131,14 @@ static int do_cli(int argc, char **argv) /* {{{ */
11311131
}
11321132
if (request_started) {
11331133
php_request_shutdown((void *) 0);
1134+
request_started = 0;
11341135
}
11351136
if (translated_path) {
11361137
free(translated_path);
1138+
translated_path = NULL;
11371139
}
11381140
if (behavior == PHP_MODE_LINT && argc > php_optind && strcmp(argv[php_optind],"--")) {
11391141
script_file = NULL;
1140-
request_started = 0;
1141-
translated_path = NULL;
11421142
goto do_repeat;
11431143
}
11441144
/* Don't repeat fork()ed processes. */

‎sapi/cli/tests/024.phpt‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ echo "hi";
2626

2727
file_put_contents($filename_good, $code);
2828

29-
run_and_output("$php -n -l $filename_good_escaped$filename_good_escaped");
30-
run_and_output("$php -n -l $filename_good_escaped some.unknown $filename_good_escaped");
31-
3229
$code = '
3330
<?php
3431
@@ -41,6 +38,8 @@ class test
4138

4239
file_put_contents($filename_bad, $code);
4340

41+
run_and_output("$php -n -l $filename_good_escaped$filename_good_escaped");
42+
run_and_output("$php -n -l $filename_good_escaped some.unknown $filename_good_escaped");
4443
run_and_output("$php -n -l $filename_good_escaped$filename_bad_escaped$filename_good_escaped");
4544
run_and_output("$php -n -l $filename_bad_escaped$filename_bad_escaped");
4645
run_and_output("$php -n -l $filename_bad_escaped some.unknown $filename_bad_escaped");

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /