Skip to content

Commit d7d4995

Browse files
committed
Removed inline variable assignments when passing by reference to prevent notice messages
1 parent ba1a61c commit d7d4995

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

GPhpThread.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* The MIT License (MIT)
44
*
5-
* Copyright (c) 2016 zhgzhg
5+
* Copyright (c) 2017 zhgzhg
66
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
88
* of this software and associated documentation files (the "Software"), to deal
@@ -207,7 +207,8 @@ public function isReceivingDataAvailable() { // {{{
207207
if (!isset($this->commChanFdArr[0]) || !is_resource($this->commChanFdArr[0])) return false;
208208

209209
$commChanFdArr = $this->commChanFdArr;
210-
return (stream_select($commChanFdArr, $write = null, $except = null, 0, 15000) != 0);
210+
$write = null; $except = null;
211+
return (stream_select($commChanFdArr, $write, $except, 0, 15000) != 0);
211212
} // }}}
212213
} // }}}
213214

examples/SimpleThreads.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* The MIT License (MIT)
44
*
5-
* Copyright (c) 2016 zhgzhg
5+
* Copyright (c) 2017 zhgzhg
66
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy
88
* of this software and associated documentation files (the "Software"), to deal
@@ -36,8 +36,9 @@ public function run() {
3636

3737
echo "Master process pid is " . getmypid() . "\n";
3838
echo "Creating threads...\n";
39-
$thr1 = new MyThread($nothing = null, true);
40-
$thr2 = new MyThread($nothing = null, true);
39+
$nothing = null;
40+
$thr1 = new MyThread($nothing, true);
41+
$thr2 = new MyThread($nothing, true);
4142

4243
echo "\nLaunching Thread1...\n\n";
4344

0 commit comments

Comments
 (0)