<?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"
}
int(1)
Warning: 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.
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.40
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.
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.