A Brief Introduction to Multi-Threading in PHP
- Foreword
- Execution
- Sharing
- Synchronization
- Pitfalls
| <!DOCTYPE> | |
| <html> | |
| <head> | |
| <title>Dissecting Gmail's Email Attachments - Dropping Files</title> | |
| <style> | |
| .msg { | |
| display: none | |
| } | |
| .dragging .msg { |
| SELECT CONCAT(table_schema, '.', table_name), | |
| ROUND(table_rows / 1000000, 2) rowsInMega, | |
| ROUND(data_length / ( 1024 * 1024 * 1024 ), 2) dataInGiga, | |
| ROUND(index_length / ( 1024 * 1024 * 1024 ), 2) idxInGiga, | |
| ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2) totalSizeInGiga, | |
| ROUND(index_length / data_length, 2) idxfrac | |
| FROM information_schema.TABLES | |
| ORDER BY data_length + index_length DESC | |
| LIMIT 30; |
| <?php error_reporting(E_ALL); | |
| function test() {} | |
| $nIter = 1000000; | |
| $argNums = [0, 1, 2, 3, 4, 5, 100]; | |
| $func = 'test'; | |
| foreach ($argNums as $argNum) { |
People
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
| <?php | |
| use PhpParser\Node; | |
| use PhpParser\Node\Expr; | |
| error_reporting(E_ALL); | |
| ini_set('memory_limit', -1); | |
| //$dir = __DIR__ . '/../../Symfony_2.3'; |
| <?php | |
| register_tick_function(function() { | |
| $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); | |
| $last = reset($bt); | |
| $info = sprintf("%s +%d\n", $last['file'], $last['line']); | |
| file_put_contents('/tmp/segfault.txt', $info, FILE_APPEND); | |
| // or | |
| // file_put_contents('php://output', $info, FILE_APPEND); | |
| }); |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.