Home > Backend Development > PHP Tutorial > swoole_process a very strange problem

swoole_process a very strange problem

WBOY
Release: 2016-07-06 13:51:20
Original
1152 people have browsed it

$str and $str1 are both arrays, one will report an error when called, and the other will not

<code><?php

$str[] = 'calback_func';
$str1 = ['calback_func'];

//$str[0] 改成 $str1[0] 就会报错
$process = new swoole_process($str[0]);

$pid = $process->start();

function calback_func(swoole_process $worker){// 第一个处理
   echo $worker->callback .PHP_EOL;
}</code>
Copy after login
Copy after login

#Error code

swoole_process a very strange problem

They are all characters, why is this happening....

Reply content:

$str and $str1 are both arrays, one will report an error when called, and the other will not

<code><?php

$str[] = 'calback_func';
$str1 = ['calback_func'];

//$str[0] 改成 $str1[0] 就会报错
$process = new swoole_process($str[0]);

$pid = $process->start();

function calback_func(swoole_process $worker){// 第一个处理
   echo $worker->callback .PHP_EOL;
}</code>
Copy after login
Copy after login

#Error code

swoole_process a very strange problem

They are all characters, why is this happening....

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template