Create  The problem with Sum array with PHP Pthread class

Hi everyone
I have written a piece of code like the following
I used the front of the class: http://www.php.net/manual/en/book.pthreads.php
The goal is the end result is the sum = 2003
But I get an error message.
Is it possible to modify this piece of code for me.

I'm sorry if my question in the wrong place, I published
Thank you And sorry for my illiteracy.