note 129801 added to function.empty

From: Date: Thu, 10 Oct 2024 22:16:48 +0000
Subject: note 129801 added to function.empty
Groups: php.notes 
Request: Send a blank email to php-notes+get-221588@lists.php.net to get a copy of this message
<?php class test { protected $data = [ 'qwe' => 123, ]; protected $dataOld = [ 'asd' => 456, ]; function __get($name) { return $this->dataOld[$name] ?? $this->data[$name] ?? null; } } $test = new test(); var_dump($test->asd); var_dump(isset($test->asd)); var_dump(empty($test->asd)); ?> empty() can't work with magic methods??? ---- Server IP: 45.112.84.4 Probable Submitter: 45.112.84.18 (proxied: 204.191.155.218) ---- Manual Page -- https://php.net/manual/en/function.empty.php Edit -- https://main.php.net/note/edit/129801 Del: integrated -- https://main.php.net/note/delete/129801/integrated Del: useless -- https://main.php.net/note/delete/129801/useless Del: bad code -- https://main.php.net/note/delete/129801/bad+code Del: spam -- https://main.php.net/note/delete/129801/spam Del: non-english -- https://main.php.net/note/delete/129801/non-english Del: in docs -- https://main.php.net/note/delete/129801/in+docs Del: other reasons-- https://main.php.net/note/delete/129801 Reject -- https://main.php.net/note/reject/129801 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221588) next »