Skip to content

Commit 98b1647

Browse files
author
Justin Jack
committed
README code
1 parent 2f6fd0d commit 98b1647

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,25 @@ PHPThreads requires the following PHP extensions:
1919

2020
## Quick and dirty example!
2121

22-
`<?php
22+
```
23+
<?php
2324
require_once '../lib/phpthread.php'; /* Use correct path! */
2425
2526
function thread_proc( $thread,
2627
$param)
2728
{
2829
echo "\n\t[PHPTHREAD] - I've started and have a param: \"" . print_r($param, true) . "\"!\n";
30+
2931
for ($i = 0; $i < 15; $i++) {
3032
usleep(1000000);
3133
echo "\t[PHPTHREAD] - Tick!\n";
3234
}
35+
3336
$myobj = (object)array(
3437
'seconds_alive'=>$i,
3538
'lucky_number'=>rand(0, 10000)
3639
);
40+
3741
echo "\n\t[PHPTHREAD] - I'm returning this:\n";
3842
print_r($myobj);
3943
echo "\n";
@@ -52,4 +56,5 @@ for ($i = 0; $i < 5; $i++) {
5256
echo "\n[MAIN] - Okay, I'm tired. Waiting on child to quit.\n";
5357
phpthread_join($id, $retval);
5458
echo "\n[MAIN] - Child is done. It returned:\n";
55-
print_r($retval);`
59+
print_r($retval);
60+
```

0 commit comments

Comments
 (0)