3v4l.org

run code in 300+ PHP versions simultaneously
<?php class bar { public function setup_pins($port_no, $units) { for ($i = 0; $i < $this->pin_qty[$port_no]; $i++) { echo "Setting up pin " . $i . "\n"; $this->pin[$i] = new Pin; if ($port_no > 3) { $this->pins = 8; } else { $this->pins = 1; } $this->pin[$i]->setup_unit($i, $units); } } } class Pin { public function setup_unit($pin_no, $units) { $this->do_counter(); echo "Setting up unit " . $units[$this->c] . "\n"; $this->set_bitmask($pin_no); $this->set_unit_no($units[$this->c]); $this->create_call_file($units[$this->c]); } public function do_counter() { if (! isset($this->c)) { $this->c = 0; echo "Not set\n"; } else { $this->c++; echo "C is " . $this->c . "\n"; } } }
Output for 5.6.38, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.4, 8.3.6 - 8.3.7
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

preferences:
176.08 ms | 402 KiB | 208 Q