Best PHP Community Marketing Expert Interview Questions
Q – 1 Tell me what Kind of Things have you Done on the Social Side?
Ans- A pretty broad question as there are no right or wrong answers. Its more about what works. This question is purposely open ended as I just want to know what the interviewee has worked on in the past. The answer, for me is not based on how well you know
Facebook and Twitter, but simply given the opportunity, do you have enough knowledge to be able to leverage social platforms to achieve a particular goal.
Q – 2 Explain what are PSRs? Choose 1 and briefly describe it?
Ans- PSRs are PHP Standards Recommendations that aim at standardising common aspects of PHP Development.
An example of a PSR is PSR-2, which is a coding style guide. More info on PSR-2 here.
Q – 3 Tell me can the value of a constant change during the script’s execution?
Ans- No, the value of a constant cannot be changed once it’s declared during the PHP execution.
Q – 4 Explain me what is the w3c?
Ans- Standards compliance in web development is where everything is (hopefully?) going. Don’t ask them to recite the w3c’s mission statement or anything, but they should at least have a general idea of who they are.
Q – 5 Do you know what are Traits?
Ans- Traits are a mechanism that allows you to create reusable code in languages like PHP where multiple inheritance is not supported. A Trait cannot be instantiated on its own.
It’s important that a developer know the powerful features of the language (s)he is working on, and Trait is one of such features.
Q – 6 Explain do you use Composer? If yes, what benefits have you found in it?
Ans- A: Using Composer is a tool for dependency management. You are able to declare the libraries your product relies on and Composer will manage the installation and updating of the libraries. The benefit is a consistent way of managing the libraries you depend on and you will spend less time managing the libraries you depend on in your project.
Q – 7 Explain briefly about a Search-friendly Site Looks Like?
Ans- Pretty basic I know, but I’m looking to find out whether or not the applicant has updated what he or she knows about on-site optimisation. Keyword research, title tags, urls, content, alt tags, site structure, navigation, internal linking, site maps, subdomains are all part of what I’m expecting to hear.
However, what I don’t what to hear is:
☛ Google can’t crawl javaScript
☛ Google can’t follow JavaScript links
☛ Keyword density must be X percent
☛ Google can’t read Ajax
☛ Meta keywords are very important and should spend time including them
☛ Meta descriptions are not so important
If I’m still hearing this kind of things in 2012 it is most likely they may not be right for the top job.
Q – 8 Explain what is Memcache?
Ans- Memcache is a technology that caches objects in memory such that your web application can get to them really fast. It is used by sites such as Digg.com, Facebook.com and NowPublic.com and is widely recognized as an essential ingredient in scaling any LAMP.
Q – 9 Do you know what is Zend Engine?
Ans- ☛ Zend Engine is used internally by PHP as a compiler and runtime engine. PHP Scripts are loaded into memory and compiled into Zend opcodes.
☛ These opcodes are executed and the HTML generated is sent to the client.
☛ The Zend Engine provides memory and resource management, and other standard services for the PHP language. Its performance, reliability and extensibility played a significant role in PHP’s increasing popularity.
Q – 10 Tell me what are SQL Injections, how do you prevent them and what are the best practices?
Ans- SQL injections are a method to alter a query in a SQL statement send to the database server. That modified query then might leak information like username/password combinations and can help the intruder to further compromise the server.
To prevent SQL injections, one should always check & escape all user input. In PHP, this is easily forgotten due to the easy access to $_GET & $_POST, and is often forgotten by inexperienced developers.
But there are also many other ways that users can manipulate variables used in a SQL query through cookies or even uploaded files (filenames). The only real protection is to use prepared statements everywhere consistently.
Do not use any of the mysql_* functions which have been deprecated since PHP 5.5 ,but rather use PDO, as it allows you to use other servers than MySQL out of the box. mysqli_* are still an option, but there is no real reason nowadays not to use PDO, ODBC or DBA to get real abstraction.
Ideally you want to use Doctrine or Propel to get rid of writing SQL queries all together and use object-relational mapping which binds your rows from the database to objects in your application.
Q – 11 Tell us what skills and technologies are you the most interested in improving upon or learning?
Ans- Find out if their future interests match the direction of the position (or the company in general).
Q – 12 Explain me soundex() and metaphone()?
Ans- soundex()
The soundex() function calculates the soundex key of a string. A soundex key is a four character long alphanumeric strings that represents English pronunciation of a word. The soundex() function can be used for spelling applications.
metaphone()
the metaphone() function calculates the metaphone key of a string. A metaphone key represents how a string sounds if pronounced by an English person. This function can also be used for spelling applications.
Q – 13 Tell me what are the __construct() and __destruct() methods in a PHP class?
Ans- All objects in PHP have Constructor and Destructor methods built-in. The Constructor method is called immediately after a new instance of the class is being created, and it’s used to initialize class properties. The Destructor method takes no parameters.
Understanding these two in PHP means that the candidate knows the very basics of OOP in PHP.
Q – 14 Tell me what sized websites have you worked on in the past?
Ans- Find a developer that has experience similar in size to the project you’re putting together. Developers with high traffic, large scale site expertise may offer skills that smaller-sized developers don’t, such as fine tuning apache or optimizing heavily hit SQL queries.
On the other hand, developers who typically build smaller sites may have an eye for things that large scale developers don’t, such as offering a greater level of visual creativity.
Q – 15 Explain me what SEO Tools do you Use?
Ans- Finally, I always ask what tools they have used in the past. Generally speaking, I would expect a combination of OSE, Majestic SEO and Ahrefs for link analysis. Either Screaming Frog or Xenu for architecture diagnostics and AWR would normally come out top for rank analysis. And of course, Google Analytics the most likely tool for traffic monitoring.
Q – 16 Explain what are some new features introduced in PHP7?
Ans-
1. Zend Engine 3 performance improvements and 64-bit integer support on Windows
2. uniform variable syntax AST-based compilation process
3. added Closure::call()
4. bitwise shift consistency across platforms
5. (null coalesce) operator
6. Unicode codepoint escape syntax
7. return type declarations
8. and scalar type (integer, float, string and boolean) declarations.
Q – 17 How to implement a class named Dragonball. This class must have an attribute named ballCount (which starts from 0) and a method iFoundaBall. When iFoundaBall is called, ballCount is increased by one. If the value of ballCount is equal to seven, then the message You can ask your wish is printed, and ballCount is reset to 0. How would you implement this class?
Ans- }
public function iFoundaBall(){
$this->ballCount++;
if($this->ballCount===7){
echo “You can ask for your wish.”;
$this->ballCount=0;
}
}
}
?>
This question will evaluate a candidate’s knowledge about OOP.
Q – 18 Do you know how to enable error reporting in PHP?
Ans- Check if “display_errors” is equal “on” in the php.ini or declare “ini_set(‘display_errors’, 1)” in your script.
Then, include “error_reporting(E_ALL)” in your code to display all types of error messages during the script execution.
Enabling error messages is very important especially during the debugging process as you can instantly get the exact line that is producing the error and you can see also if the script in general is behaving correctly.
Q – 19 Tell us who was your best boss and who was the worst?
Ans- I’ve learned from each boss I’ve had. From the good ones I learnt what to do, from the challenging ones – what not to do.
Early in my career, I had a mentor who helped me a great deal, we still stay in touch. I’ve honestly learned something from each boss I’ve had.
Q – 20 Tell me what industry sites and blogs do you read regularly?
Ans- This question can give you an idea of how in-tune they are with the latest industry trends and technologies, as well as how passionate they are about webdev. It’ll help separate the people who do it as a career AS WELL as a hobby from those who might simply be in it for the big developer paychecks.
Q – 21 Tell me what is htaccess? Why do we use this and where?
Ans-
☛ htaccess files are configuration files of Apache Server that provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.
☛ These .htaccess files are used to change the functionality and features of Apache web server.
For instance, htaccess file is used for url rewrite.
–> It is used to make the site password protected.
–> .htaccess file can restrict some ip addresses so that on restricted ip addresses, the site will not open.
Q – 22 Explain why would we use === instead of ==?
Ans- If you would want to check for a certain type, like an integer or boolean, the === will do that exactly like one would expect from a strongly typed language, while == would convert the data temporarily and try to match both operand’s types. The identity operator (===) also performs better as a result of not having to deal with type conversion. Especially when checking variables for true/false you want to avoid using == as this would also take into account 0/1 or other similar representation.
Q – 23 Suppose we receive a form submitted by a post to subscribe to a newsletter. This form has only one field, an input text field named email. How would we validate whether the field is empty? Print a message “The email cannot be empty” in this case?
Ans-
In this question, you will be evaluated on your knowledge about forms management and validation. There is not unique answer for this question, but it must be similar to this one.
Q – 24 Tell me what is the difference between GET and POST?
Ans-
☛ GET displays the submitted data as part of the URL, during POST this information is not shown as it’s encoded in the request.
☛ GET can handle a maximum of 2048 characters, POST has no such restrictions.
☛ GET allows only ASCII data, POST has no restrictions, binary data are also allowed.
☛ Normally GET is used to retrieve data while POST to insert and update.
Understanding the fundamentals of the HTTP protocol is very important to have a good start as a PHP developer, and the differences between GET and POST are an essential part of it.
Q – 25 Tell me what’s your favorite development language and why? What other features (if any) do you wish you could add to this language?
Ans- Asking about feature additions is a particularly valuable question – it can reveal if they’re skilled in programming in general or if their skillset is pigeonholed into their language of choice.
Q – 26 Do you Code in any other Programming Language?
Ans- Whilst not a deal breaker, I think it is important that you understand how things are built on the web. Especially knowing how to fully code in html. The more web programming you know the better, and working closely with the dev team has constantly reminded me why this is important.
There will be plenty of cases where being able to understand a web development language will be very advantageous.
When for instance, the dev team says there is no space for particular piece of content , recommending a work around using a CSS overlay and calling it using an onClick event maybe accepted. Or telling them that how best to code in Google’s language alternative tag across an already existing international site.
Q – 27 Tell me what are magic methods?
Ans-
☛ Magic methods are member functions that are available to all the instance of class. Magic methods always start with “__”. Eg. __construct.
☛ All magic methods need to be declared as public
☛ To use a method, it should be defined within the class or program scope
☛ Various Magic Methods used in PHP 5 are: __construct() __destruct() __set() __get() __call() __toString() __sleep() __wakeup() __isset() __unset() __autoload() __clone().
Q – 28 Tell me what library is used for pdf in PHP?
Ans- The PDF functions in PHP can create PDF files using the PDFlib library Version 6. PDFlib offers an object-oriented API for PHP 5 in addition to the function-oriented API for PHP 4.
There is also the » Panda module. FPDF is a PHP class, which allows generating PDF files with pure PHP (without using the PDFlib library.)
F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs. FPDF requires no extension (except zlib to activate compression and GD for GIF support) and works with PHP4 and PHP5.
Q – 29 Do you know what does MVC stand for and what does each component do?
Ans- MVC stands for Model View Controller.
The controller handles data passed to it by the view and also passes data to the view. It’s responsible for interpretation of the data sent by the view and dispersing that data to the appropriate models awaiting results to pass back to the view. Very little, if any business logic should be occurring in the controller.
The model’s job is to handle specific tasks related to a specific area of the application or functionality. Models will communicate directly with your database or other storage system and will handle business logic related to the results.
The view is passed data by the controller and is displayed to the user.
Overall, this question is worth knowing as the MVC design pattern has been used a lot in the last few years and is a very good design pattern to know.
Even with more advanced flows that go down to repositories and entities, they still are following the same basic idea for the Controller and View. The Model is typically just split out into multiple components to handle specific tasks related to database data, business logic etc. The MVC design pattern helps draw a better understanding of what is being used, as a whole, in the industry.
Q – 30 Explain the value of the variable input is a string 1,2,3,4,5,6,7. How would you get the sum of the integers contained inside input?
Ans- The explode function is one of the most used functions in PHP, so it’s important to know if the developer knows this function. There is no unique answer to this question, but the answer must be similar to this one.
Q – 31 Tell me what is the output of the following code:
$a = ‘1’;
$b = &$a;
$b = “2$b”;
echo $a.”, “.$b;?
Ans- The answer is 21, 21
Q – 32 Tell me what have you been doing since your last job?
Ans- If you have an employment gap on your resume, the interviewer will probably ask you what you have been doing while you were out of work.
The best way to answer this question is to be honest, but do have an answer prepared. You will want to let the interviewer know that you were busy and active, regardless of whether you were out of work by choice, or otherwise.
As I said, it doesn’t really matter what you did, as long as you have an explanation. Hiring managers understand that people lose their job – it can happen to anyone – and it’s not always easy to find a new job fast. Also, there are legitimate non-employment reasons for being out of the workforce.
Q – 33 Tell me how comfortable are you with writing HTML entirely by hand?
Ans- Although their resume may state that they’re an HTML expert, often times many developers can’t actually write an HTML document from top to bottom. They rely on an external publisher or have to constantly flip back to a reference manual. Any developer worth a damn should at least be able to write a simple HTML document without relying on external resources.
A possible exercise is to draw up a fake website and ask them to write the HTML for it. Keep it simple and just make sure they have the basics down – watch for mistakes like forgetting thetags or serious misuse of certain elements. If they write something like: , it might be a good hint to wrap things up and call the next interviewee.
Q – 34 Explain how can we execute a PHP script using command line?
Ans-
☛ Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, “php myScript.php”, assuming “php” is the command to invoke the CLI program.
☛ Remember that if your PHP script was written for the Web CGI interface, it may not execute properly in command line environment.
Q – 35 Tell us why did you choose this particular career path?
Ans- Sometimes in interviews, you will be asked questions that lend themselves to be answered vaguely or with lengthy explanations. Take this opportunity to direct your answer in a way that connects you with the position and company, be succinct and support your answer with appropriate specific examples.
Sample Answer: “I chose advertising because I have always been a strong communicator with a good eye for design. I have a particular interest in creating dynamic eye-catching pieces that support a new product being introduced to the market. I also like the fast-paced high-energy environment that seems to be commonplace in the advertising industry.”
Advice:
Your answer needs to convince the interviewers that your skills are exactly what they want. They want to know if you have a realistic view of what it is like to work in their industry. Be specific; show them that their industry and your career goals are in sync.
Q – 36 Tell me what’s the difference between unset() and unlink()?
Ans- unset() sets a variable to “undefined” while unlink() deletes a file we pass to it from the file system.
Q – 37 why Do You Want To Work For Us Here?
Ans- It’s rare for an interview not to include this question.
The good news is that it’s an easy one to prepare for.
Most companies want to recruit people who are enthusiastic about the company and its products. They don’t want people on the team who “ended up there by accident”. So this is your chance to show why working for the company is important to you and why you think you will fit in.
They will be looking for evidence that you can make a contribution and will be able to grow into the role they are recruiting.
This question is designed to screen out candidates who aren’t serious about the company or may be using it as a stop-gap, while they look for something better.
It’s also your chance to make the most of the company research you have done. You can use this opportunity to add comments that show you understand the company’s position in the market place; the role of its competitors and any challenges it may be facing.
Sample Answer:
“I’m not looking for just another pay check. I enjoy my work and am proud of my profession. Your company produces a superior product/provides a superior service. I share the values that make this possible, which should enable me to fit in and complement the team.”
Q – 38 Explain what Kind of Reports do you Give to your Clients?
Ans- I like numbers. So maybe I might be biased towards this question but for me, measuring things is very important. In SEO we are always having to justify our ROI and one of the ways you can prove it is through reporting. Generally speaking, once a candidate comes from an agency background I would expect reporting to be almost inbred as clients always want to justify their SEO spend.
However, I’m interested in what metrics the applicant think are important across both search and social. I’m also keen on hearing how they usually present this data and the frequency at which is delivered.
Q – 39 Explain what is meant by PEAR in PHP?
Ans- PEAR is an acronym for “PHP Extension and Application Repository” The purpose of PEAR is to provide:
☛ A structured library of open-sourced code for PHP users
☛ A system for code distribution and package maintenance
☛ A standard style for writing code in PHP
☛ PHP Foundation Classes (PFC)
☛ PHP Extension Community Library (PECL)
☛ A website, mailing lists and download mirrors to support the PHP/PEAR community
Q – 40 Explain how can we increase the execution time of a PHP script?
Ans- ☛ Default time allowed for the PHP scripts to execute is 30 secs mentioned in the php.ini file. The function used is set_time_limit(int sec). If the value passed is ‘0′, it takes unlimited time. It should be noted that if the default timer is set to 30 sec, and 20 sec is specified in set_time_limit(), the script will run for 45 seconds.
☛ This time can be increased by modifying the max_execution_time in secs. The time must be changed keeping the environment of the server. This is because modifying the execution time will affect all the sites hosted by the server.
☛ The script execution time can be increased by
☛ Using sleep() function in PHP script
☛ Using set_time_limit() function
☛ The default limit is 30 seconds. The time limit can be set to zero to impose no time limit to pause.
Q – 41 Explain how does one prevent the following Warning ‘Warning: Cannot modify header information – headers already sent’ and why does it occur in the first place?
Ans- Do not output anything to the browser before using code that modifies the HTTP headers. Once you call echo or any other code that clears the buffer you can no longer set cookies or headers. That is also true for error messages, so if an error happens before you use the header command and the INI directive display_errors is set then that will also cause that error to show.
Q – 42 Tell me can you extend a Final defined class?
Ans- No, you cannot extend a Final defined class. A Final class or method declaration prevents child class or method overriding.
Q – 43 Do you know how to get the IP address of the client?
Ans- This question might show an interview how playful and creative the candidate is because there are many options. $_SERVER[“REMOTE_ADDR”]; is the easiest solution, but you can write x line scripts for this question.
Q – 44 Tell me what are your aspirations beyond this job?
Ans- Again, don’t fall into the trap of specifying job titles. Stick to a natural progression you see as plausible. How should this job grow for the good of the organization? Then turn your attention once again to the job at hand. If you seem too interested in what lies beyond this job, the interviewer will fear that you won’t stick around for long.
Sample Answer: Beyond this job as a marketing assistant, I see myself moving up through marketing analysis into brand management and eventually running a category.
I’m aware that there are several skills I need to develop in the interval, and I believe with your continuing-education program and my own motivation for self-improvement, I’ll have those skills when the opportunities arise for greater responsibility. That’s why I’m determined to learn from the ground up, starting as a marketing assistant.
Q – 45 Tell me what web browser do you use?
Ans- There is a right answer to this question: all of them. A competent developer should be familiar with testing cross-browser compatibility by using all the major web browsers.
Obviously they’ll have a primary browser they use for surfing, but their answer to this question might be a good way for you to segue to asking how extensively they test cross-browser issues. Also, if it’s some kind of css/html position seeing what toolbars they have installed can be a good metric of their skillset (I personally find the web developer toolbar for firefox to be invaluable)
Q – 46 Explain do you prefer to work alone or on a team?
Ans- This is an important question to ask depending on the work environment. If your project is going to require close interaction with other developers it’s very handy to have someone who has had that kind of experience. On the other hand, many developers thrive while going solo. Try to find a developer that fits your needs.
Q – 47 Explain me your Link Building Process?
Ans- I asked this to simply know the candidates understanding of the link building process. This question allowed me to get beyond the typical ‘a link must be from relevant site’. You would expect this kind of answers interviewing an exec.
What I was looking for was more to do with work load split, data recording, site evaluation and overall time management skills. Link building is a tedious task and it’s important that as a senior SEO specialist you are aware that people in charge of this can easily become overwhelmed.
Even though not explicitly asked, a question like this also gives me key insight into how the candidate views link building. If all I’m hearing are directory submissions, blog commenting, page rank and exact matching anchors you’re less likely to be called in for a second interview.
I’m more interested in hearing about outreach campaigns, what you did to attract links in the past and content partnerships. I’m also interested in creative ideas used to build links.
I’m also big on strategy. Each campaign is different and for me, a one size fits all approach cannot give the best result. Therefore it is crucial that candidate put across that link building for an educational site is not the same for say, travel insurance.
Q – 48 Tell me what PSR Standards do you follow? Why would you follow a PSR standard?
Ans- You should folow a PSR because coding standards often vary between developers and companies. This can cause issues when reviewing or fixing another developer’s code and finding a code structure that is different from yours. A PSR standard can help streamline the expectations of how the code should look, thus cutting down confusion and in some cases syntax errors.
Q – 49 Tell me what are getters and setters and why are they important?
Ans- Getters and setters are methods used to declare or obtain the values of variables, usually private ones. They are important because it allows for a central location that is able to handle data prior to declaring it or returning it to the developer.
Within a getter or setter you are able to consistently handle data that will eventually be passed into a variable or additional functions. An example of this would be a user’s name. If you are not using a setter and just declaring the $userName variable by hand you could end up with results as such: “kevin”, “KEVIN”, “KeViN”, “”, etc.
With a setter you can not only adjust the value, for example, ucfirst($userName), but you can also handle situations where the data is not valid such as the example where “” is passed. The same applies to a getter – when the data is being returned, you can modify the results to include strtoupper($userName) for proper formatting further up the chain.
This is important for any developer who is looking to enter a team-based / application development job to know. Getters and setters are often used when dealing with objects, especially ones that will end up in a database or other storage medium.
Because PHP is commonly used to build web applications you will run across getters and setters in more advanced environments, even as a junior developer. They are extremely powerful yet not talked about very much. You can really impress an interviewer by knowing what they are and how to use them early on.
Q – 50 Tell me how would you declare a function that receives one parameter name hello?
Ans- If hello is true, then the function must print hello, but if the function doesn’t receive hello or hello is false the function must print bye.
In this question, the interviewer can evaluate if the developer knows how to declare a function and how they would manage the fact of the parameter can or cannot be on the function call. The interviewer can also evaluate if the developer knows the if syntax and if they knows how to print text(echo function).
Q – 51 Do you know what’s the difference between the include() and require() functions?
Ans- they both include a specific file but on require the process exits with a fatal error if the file can’t be included, while include statement may still pass and jump to the next step in the execution.
Q – 52 Tell me why do you think this industry would sustain your interest in the long haul?
Ans- What expectations or projects do you have for the business that would enable you to grow without necessarily advancing? What excites you about the business? What proof can you offer that your interest has already come from a deep curiosity-perhaps going back at least a few years-rather than a current whim you’ll outgrow?
Sample Answer: The technology in the industry is changing so rapidly that I see lots of room for job enhancement regardless of promotions. I’m particularly interested in the many applications for multimedia as a training tool.
Q – 53 Explain me what are a few personal web projects you’ve got going on?
Ans- Almost all developers have personal web projects they like to plug away at in their spare time. This is another question that can help differentiate the passionate developers from the clock-punchers. It’s also a good question to end an interview with, as it’s usually easy (and fun) for them to answer.
Q – 54 Explain what are a few of your favorite development tools and why?
Ans- If they say notepad you’ve obviously got the wrong person for the job. Not only can this help you gauge their level of competence, but it’ll also see if they match the tools everyone else uses in-house.
Q – 55 Do you know about the Latest Changes at Google?
Ans- In my opinion, a good candidate would have their ears to the ground in terms of what is going on at Google. Not every single update carries the same importance, so I definitely do not need a running commentary of everything that is written on Google webmaster blog.
However, whenever a major algo changes is announced, its effect on the web and your site should be taken notice of. Like I’ve mentioned before, I honestly don’t expect to hear every tweak since Florida, but I want a detail idea of the current state of play. Recently it has been Penguin, Panda and EMDs and any good SEO should know these like they know their alphabet.
Panda – What does it do, what cause you to get hit by it, how do you mitigate against its effect, how do you recover?
Penguin – Why was it rolled out, what do you need to do, how do you recover?
EMDs downgrade – What is the history behind it, how would you future proof your client’s site?
Personally, I expect details answers to such questions as the candidate will be in charge of handing down instructions to their team and also making recommendations to clients.
Q – 56 Explain what is smarty?
Ans- Smarty is a template engine written in PHP. Typically, these templates will include variables -like {$variable} – and a range of logical and loop operators to allow adaptability within of the template.
Q – 57 Tell me what does the following code output?
$i = 016;
echo $i / 2;?
Ans- The Output should be 7. The leading zero indicates an octal number in PHP, so the number evaluates to the decimal number 14 instead to decimal 16.
Q – 58 Explain me what are the 3 scope levels available in PHP and how would you define them?
Ans- Private – Visible only in its own class
Public – Visible to any other code accessing the class
Protected – Visible only to classes parent(s) and classes that extend the current class
This is important for any developer to know because it shows an understanding that building applications is more than just being able to write code.
One must also have an understanding about privileges and accessibility of that code. There are times protected variables or methods are extremely important, and an understanding of scope is needed to protect the integrity of the data in your application along with provide a clear path through the code.
Q – 59 Explain how we can get the number of elements in an array?
Ans- The count() function is used to return the number of elements in an array.
Understanding of arrays and array related helper functions it’s a knowledge that every junior developer should have.
Q – 60 Explain me what are the main error types in PHP and how do they differ?
Ans- In PHP there are three main type of errors:
Notices – Simple, non-critical errors that are occurred during the script execution. An example of a Notice would be accessing an undefined variable.
Warnings – more important errors than Notices, however the scripts continue the execution. An example would be include() a file that does not exist.
Fatal – this type of error causes a termination of the script execution when it occurs. An example of a Fatal error would be accessing a property of a non-existent object or require() a non-existent file.
Understanding the error types is very important if you are new to programming because they help you understand what is going on during the development, and they will help you know what you should look for in the code during debugging.