|
| 1 | +# php-exam |
| 2 | +>A PHP exam with questions from beginner to expert level curated by [@codehakase](https://twitter.com/iamfrankcute) |
| 3 | +
|
| 4 | +* What is PHP? |
| 5 | +* What does the initials of PHP stand for? |
| 6 | +* Which programming language does PHP resemble to? |
| 7 | +* What does PEAR stands for? |
| 8 | +* What is the current PHP version? |
| 9 | +* What is a variable? |
| 10 | +* How do you define a variable in PHP? |
| 11 | +* How do you execute a PHP script from the command line? |
| 12 | +* How to run the interactive PHP shell from the command line interface? |
| 13 | +* What are the correct and the most two common way to start and finish a PHP block of code? |
| 14 | +* How can i display the output directly to the browser? |
| 15 | +* What is the main difference between PHP 5 and PHP 7? |
| 16 | +* Is multiple inheritance supported in PHP? |
| 17 | +* What is the meaning of a final class and a final method? |
| 18 | +* How is comparison of objects done in PHP7? |
| 19 | +* How can PHP and HTML interact? |
| 20 | +* What type of operation is needed when passing values through a form or an URL? |
| 21 | +* How can PHP and Javascript interact? |
| 22 | +* What is needed to be able to use image function? |
| 23 | +* What is the use of the function ‘imagetypes()’? |
| 24 | +* What are the functions to be used to get the image’s properties (size, width and height)? |
| 25 | +* How failures in execution are handled with include() and require() functions? |
| 26 | +* What is the main difference between require() and require_once()? |
| 27 | +* How can I display text with a PHP script? |
| 28 | +* How can i display information of a variable and readable by human with PHP? |
| 29 | +* How is it possible to set an infinite execution time for PHP script? |
| 30 | +* What does the PHP error ‘Parse error in PHP – unexpected T_variable at line x’ means? |
| 31 | +* What should i do to be able to export data into an Excel file? |
| 32 | +* What is the function file_get_contents() usefull for? |
| 33 | +* How can i connect to a MySQL database from a PHP script? |
| 34 | +* How the result set of MySQL be handled in PHP (PDO or mysqli)? |
| 35 | +* How is it possible to know the number of rows returned in result set? |
| 36 | +* Which function gives us the number of affected entries by a query? |
| 37 | +* In PDO, What is the difference between $pdo->fetch(PDO::FETCH_ASSOC) and $pdo->fetchAll()? |
| 38 | +* How can i access the data sent through the URL with the GET method? |
| 39 | +* How can i access the data sent through the URL with the POST method? |
| 40 | +* How can i check the value of a given variable is a number? |
| 41 | +* How can i check the value of a given variable is alphanumeric? |
| 42 | +* How do I check if a given variable is empty? |
| 43 | +* What does the unlink() function means? |
| 44 | +* What does the unset() function means? |
| 45 | +* How do I escape data before storing it into the database? |
| 46 | +* How is it possible to remove escape characters from a string? |
| 47 | +* How can i automatically escape incoming data? |
| 48 | +* What does the function get_magic_quotes_gpc() means? |
| 49 | +* Is it possible to remove the HTML tags from data? |
| 50 | +* What is the static variable in function useful for? |
| 51 | +* How can i define a variable accessible in functions of a PHP script? |
| 52 | +* How is it possible to return a value from a function? |
| 53 | +* What is the most convenient hashing method to be used to hash passwords? |
| 54 | +* Which cryptographic extension provide generation and verification of digital signatures? |
| 55 | +* How can i define a Constant in a PHP script? |
| 56 | +* How can you pass a variable by reference? |
| 57 | +* Will a comparison of an integer 12 and a string “13” work in PHP? |
| 58 | +* How is it possible to cast types in PHP? |
| 59 | +* When is a conditional statement ended with an endif? |
| 60 | +* How is the ternary conditional operator used in PHP? |
| 61 | +* What is the function func_num_args() used for? |
| 62 | +* If the variable $var1 is set to 10 and the $var2 is set to the character var1, what’s the value of $$var2? |
| 63 | +* What does accessing a class via :: means? |
| 64 | +* In PHP, objects are they passed by value or by reference? |
| 65 | +* Are Parent constructors called implicitly inside a class constructor? |
| 66 | +* What’s the difference between __sleep and __wakeup? |
| 67 | +* What is a session? |
| 68 | +* How do i initiate a session in PHP? |
| 69 | +* How is it possible to propagate a session id? |
| 70 | +* What is the meaning of a Persistent Cookie? |
| 71 | +* What is the difference between session_unregister() and session_unset()? |
| 72 | +* What does $GLOBALS means? |
| 73 | +* What does $_SERVER means? |
| 74 | +* What does $_FILES means? |
| 75 | +* What is the difference between $_FILES[‘userfile’][‘name’] and $_FILES[‘userfile’][‘tmp_name’]? |
| 76 | +* How can i get the error when there is a problem to upload a file? |
| 77 | +* What does $_ENV means? |
| 78 | +* What does $_COOKIE means? |
| 79 | +* What does the scope of variables means? |
| 80 | +* What the difference between the ‘BITWISE AND’ operator and the ‘LOGICAL AND’ operator? |
| 81 | +* What are the two main string operators? |
| 82 | +* What does the array operator ‘===’ means? |
| 83 | +* What is the differences between $a != $b and $a !== $b? |
| 84 | +* How can i determine whether a PHP variable is an instantiated object of a certain class? |
| 85 | +* What is the goto statement useful for? |
| 86 | +* What is the difference between Exception::getMessage and Exception::getLine ? |
| 87 | +* What does the expression Exception::__toString means? |
| 88 | +* How is it possible to parse a configuration file? |
| 89 | +* How can i determine whether a variable is set? |
| 90 | +* What is the difference between the functions strstr() and stristr()? |
| 91 | +* What is the difference between for and foreach? |
| 92 | + |
| 93 | + |
| 94 | +## Credits |
| 95 | + |
| 96 | +- [CareerGuru99](http://career.guru99.com/top-100-php-interview-questions-answers/) |
| 97 | +- [Francis Sunday](https://twitter.com/iamfrankcute) |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +## Contributing |
| 102 | +Please feel free to fork this package and contribute by submitting a pull request to add to the list of questions or to make some corrections to them. |
| 103 | + |
| 104 | + |
| 105 | +## Feel like thanking me? |
| 106 | + |
| 107 | +Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or Facebook? Spread the word! |
| 108 | + |
| 109 | +and also, [follow me on twitter](https://twitter.com/iamfrankcute)! |
| 110 | + |
| 111 | +Thanks! |
| 112 | +Francis Sunday. |
| 113 | + |
| 114 | + |
| 115 | +## License |
| 116 | +The source code is open-sourced software licensed under the [MIT license](LICENSE.md) |
0 commit comments