PHP code example of gabrielelana / violent-death

1. Go to this page and download the library: Download gabrielelana/violent-death library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gabrielelana / violent-death example snippets




e output will be something like:
//
// What is this? Should I drink it?
// There, I drank it, I will die eventually...
// Still there :-)
// Still there :-)
// …
// Still there :-)
// [1]    26584 segmentation fault (core dumped)  php examples/drink_poison.php

echo "What is this? Should I drink it?\n";
drink_poison($msToTakeEffect=500, $msToAgonizeAtMost=1000);
// Here we have created a background thread that will wait
// at least for 500ms and at most 1500ms before to cause
// an horrible death with a segmentation fault

echo "There, I drank it, I will die eventually...\n";
while(true) {
    echo "Still there :-)\n";
    usleep(50000);
}