Skip to content

Instantly share code, notes, and snippets.

@JesusTheHun
Last active February 22, 2016 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JesusTheHun/997edc8a47ac1155c79a to your computer and use it in GitHub Desktop.
Save JesusTheHun/997edc8a47ac1155c79a to your computer and use it in GitHub Desktop.
#!/bin/bash
# PHP 7.0.2
# Pthreads 3.1.5
curl -LsS https://symfony.com/installer -o ./symfony
chmod a+x ./symfony
./symfony new segfault_proof 2.8.2
cd segfault_proof/
mkdir src/AppBundle/Command
echo "<?php
namespace AppBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class PthreadsCommand extends ContainerAwareCommand {
protected function configure()
{
\$this
->setName('mt:test')
->setDescription('MT test')
; // End of definition
}
public function execute(InputInterface \$input, OutputInterface \$output)
{
\$output->write('It works !');
\$w = new \Thread();
\$w->start();
\$w->join();
\$output->write('It still works !');
}
}" > src/AppBundle/Command/PthreadsCommand.php
echo "Ready to reproduce."
echo "Run : php app/console mt:test"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment