note 124763 added to migration74.new-features

From: Date: Wed, 26 Feb 2020 20:42:43 +0000
Subject: note 124763 added to migration74.new-features
Groups: php.notes 
Request: Send a blank email to php-notes+get-214231@lists.php.net to get a copy of this message
<?php // How to get property type? For example for testing: class Foo { private int $num; private bool $isPositive; private $notes; } $reflection = new \ReflectionClass(Foo::class); $classProperties = $reflection->getProperties(\ReflectionProperty::IS_PRIVATE); foreach ($classProperties as $classProperty) { var_dump((string) $classProperty->getType()); } /** * Result: * "int" * "bool" * "" */ ---- Server IP: 45.112.84.4 Probable Submitter: 185.85.3.195 (proxied: 195.138.65.167) ---- Manual Page -- http://php.net/manual/en/migration74.new-features.php Edit -- https://master.php.net/note/edit/124763 Del: integrated -- https://master.php.net/note/delete/124763/integrated Del: useless -- https://master.php.net/note/delete/124763/useless Del: bad code -- https://master.php.net/note/delete/124763/bad+code Del: spam -- https://master.php.net/note/delete/124763/spam Del: non-english -- https://master.php.net/note/delete/124763/non-english Del: in docs -- https://master.php.net/note/delete/124763/in+docs Del: other reasons-- https://master.php.net/note/delete/124763 Reject -- https://master.php.net/note/reject/124763 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214231) next »