<?php
class A { public $b; };
$a = new A;
echo property_exists($a, 'b'); // Returns '1'
$a->b; // Remains silent
unset($a->b);
echo property_exists($a, 'b'); // Still returns '1'
$a->b; // Cause a "Notice: Undefined property A::$b"
- Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
- 11
Warning: Undefined property: A::$b in /in/3sAs5 on line 12
- Output for 5.5.0 - 5.5.35, 5.6.0 - 5.6.21, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
- 11
Notice: Undefined property: A::$b in /in/3sAs5 on line 12
- Output for 7.3.32 - 7.3.33
- 11
preferences:
198.93 ms | 401 KiB | 256 Q