I will show you all a question regarding argument passing to a function in php. In php 5.3.0 we can assign NULL by reference to any argument. Now let’s see the question of ZEND mock test. The bold options are the answers. You can give your opinion about the answers.
Question: Which of the following is incorrect?[choose 4]
a. function c(MyClass $a = new MyClass())
You can't create an object of a class in this way.
b. function d($a = null)
php 5.3.0 gives option to set argument as null.
c. function e(&$a = 30)
You can’t assign default value to a parameter by reference.
d. function a(&$a = array(10,20,30))
Arrays can not be assigned to an argument.
e. function b($a = (10 + 2))
you can not assign an expression to an argument In a function.
Question: Which of the following is incorrect?[choose 4]
a. function c(MyClass $a = new MyClass())
You can't create an object of a class in this way.
b. function d($a = null)
php 5.3.0 gives option to set argument as null.
c. function e(&$a = 30)
You can’t assign default value to a parameter by reference.
d. function a(&$a = array(10,20,30))
Arrays can not be assigned to an argument.
e. function b($a = (10 + 2))
you can not assign an expression to an argument In a function.
List of my works:
Technical Support:
If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.
Wordpress Plugins:
If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.
Wordpress Plugins:
- Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
- Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.
Opencart Extensions:
- Product Based Quantity Wise Shipping: Find it here.
- OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
- Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
- Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
- Custom Field Product - add unlimited custom fields to the product form: Find it here.
- Formcaptcha - add captcha on the register page: Find it here.
1 comment:
All the question is wrong , both 'd' and 'c' are correct , only 'e' and 'a' are not allowed
Post a Comment