3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Class "Thread" not found in /in/BiTAV:8 Stack trace: #0 {main} thrown in /in/BiTAV on line 8
Process exited with code 255.
Output for 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
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: Uncaught Error: Class 'Thread' not found in /in/BiTAV:8 Stack trace: #0 {main} thrown in /in/BiTAV on line 8
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught Error: Class 'Thread' not found in /in/BiTAV:8 Stack trace: #0 {main} thrown in /in/BiTAV on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33
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.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28
Fatal error: Class 'Thread' not found in /in/BiTAV on line 9
Process exited with code 255.

preferences:
174.97 ms | 402 KiB | 224 Q