3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $active = 1; var_dump($active); $ps->bindParam(":active", $active, PDO::PARAM_INT); var_dump($active); $ps->execute(); var_dump($active); if ($active === 1) { // do something here // note: this will fail since $active is now "1" }
Output for 7.0.5 - 7.2.6
int(1) Notice: Undefined variable: ps in /in/BNhcJ on line 4 Fatal error: Uncaught Error: Call to a member function bindParam() on null in /in/BNhcJ:4 Stack trace: #0 {main} thrown in /in/BNhcJ on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.4
int(1) Notice: Undefined variable: ps in /in/BNhcJ on line 4 Fatal error: Uncaught Error: Call to a member function bindParam() on unknown in /in/BNhcJ:4 Stack trace: #0 {main} thrown in /in/BNhcJ on line 4
Process exited with code 255.
Output for 5.6.0 - 5.6.28
int(1) Notice: Undefined variable: ps in /in/BNhcJ on line 4 Fatal error: Call to a member function bindParam() on null in /in/BNhcJ on line 4
Process exited with code 255.
Output for 5.0.4 - 5.5.38
int(1) Notice: Undefined variable: ps in /in/BNhcJ on line 4 Fatal error: Call to a member function bindParam() on a non-object in /in/BNhcJ on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.3
int(1) Notice: Undefined variable: ps in /in/BNhcJ on line 4 Fatal error: Call to a member function bindParam() on a non-object in /in/BNhcJ on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')', expecting '(' in /in/BNhcJ on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected ')', expecting '(' in /in/BNhcJ on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'('' in /in/BNhcJ on line 4
Process exited with code 255.