3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /* Programa para generar diccionarios de fuerza bruta con diferentes hilos usando Thread en PHP 5.4 */ class FuerzaBruta extends Thread { private $n; private $out; private $smap; public function FuerzaBruta($numero) { $this->n = $numero; // Numero de caracteres $this->smap = ['a','b','c','d']; $this->start(); } public function run(){ for($i = 0; $i < pow(count($this->smap), $this->n) - 1; $i++){ $this->visualizar(); $this->siguiente(); } $this->visualizar(); } public function siguiente(){ $this->out[0]++; $m = 0; while($this->out[$m] == count($this->smap)){ $this->out[$m++] = 0; $this->out[$m]++; } } public function visualizar(){ $output = ""; for($i = 0;$i < $this->n; $i++){ $output += $this->smap[$this->out[$i]]; } echo $output; } } //Genera todas las combinaciones de 5 caracteres. for($i = 1; $i < 5; $i++) new FuerzaBruta($i); // AlgĂșn error tendrĂ©...
Output for 7.0.0 - 7.2.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; FuerzaBruta has a deprecated constructor in /in/BiTAV on line 8 Fatal error: Class 'Thread' not found in /in/BiTAV on line 8
Process exited with code 255.
Output for 5.4.2 - 5.6.28
Fatal error: Class 'Thread' not found in /in/BiTAV on line 9
Process exited with code 255.
Output for 5.3.17 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/BiTAV on line 18
Process exited with code 255.