<?php
class A{
function do_stuff(&$b) {
$defined = 0;
trigger_error("If I fixed the undefined variable but enabled this line instead, it will also turn b from an object into a string! So user-triggered notices bork it as well.");
var_dump('In function:', $b);
}
}
class B{}
$a = new A();
$b = new B();
$a->do_stuff($b);
var_dump('After function:', $b);
Notice: If I fixed the undefined variable but enabled this line instead, it will also turn b from an object into a string! So user-triggered notices bork it as well. in /in/E94HH on line 6
string(12) "In function:"
object(B)#2 (0) {
}
string(15) "After function:"
object(B)#2 (0) {
}
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9
Notice: If I fixed the undefined variable but enabled this line instead, it will also turn b from an object into a string! So user-triggered notices bork it as well. in /in/E94HH on line 6
string(12) "In function:"
object(b)(0) {
}
string(15) "After function:"
object(b)(0) {
}