Using ::class in Model's $returnType instead of string - bad? |
Before I go abound and create a PR for a documentation change, I have to ask if I have misunderstood something.
I am refactoring my CI 4.1.9 project in PHPstorm and found out that PHP Code: protected $returnType = App\Entities\SomeEntity::class; PHP Code: protected $returnType = 'App\Entities\SomeEntity'; As I read it from the documentation, "::class" expands at compile time so it can't be for performance reasons - https://www.php.net/manual/en/language.oop5.basic.php What am I missing? /Mattias |
Messages In This Thread |
Using ::class in Model's $returnType instead of string - bad? - by tgix - 06-15-2022, 03:18 AM
RE: Using ::class in Model's $returnType instead of string - bad? - by kenjis - 06-15-2022, 02:41 PM
RE: Using ::class in Model's $returnType instead of string - bad? - by paulbalandan - 06-15-2022, 07:56 PM
RE: Using ::class in Model's $returnType instead of string - bad? - by tgix - 06-15-2022, 11:12 PM
RE: Using ::class in Model's $returnType instead of string - bad? - by kenjis - 06-16-2022, 02:12 AM
RE: Using ::class in Model's $returnType instead of string - bad? - by tgix - 06-16-2022, 02:13 AM
RE: Using ::class in Model's $returnType instead of string - bad? - by MGatner - 06-16-2022, 04:35 AM
RE: Using ::class in Model's $returnType instead of string - bad? - by tgix - 06-16-2022, 04:47 AM
|