PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, January 17, 2022

[FIXED] Do unused use statements decrease performance?

 January 17, 2022     performance, php, php-internals     No comments   

Issue

I want to know if unused use statements in my class affect performance of my php website?

Does php include all classes in beginning or when need it? If second choice then I think it doesn't affect performance of my system.

For Example: Use statement 'DbConnector' is not used

use model\adapter\DbConnector;

Solution

No, the use statement does not provoke the the class be loaded (it does not even trigger an autoloader).

It just declares a short name for a class. I assume the cost in terms of CPU and RAM is in the order of a few CPU cycles and a few bytes.



Answered By - RandomSeed
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing