PHP Syntax Quiz — 15 Questions
PHP Syntax Quiz हिंदी में — opening tag, closing tag, semicolon, echo vs print, comments, case sensitivity, 15 important questions। BCA, MCA, BSc students के लिए।
-
PHP Syntax क्या होता है?
- वे नियम जो बताते हैं कि PHP code कैसे लिखा जाए
- PHP को install करने की प्रक्रिया
- PHP files को server पर upload करने का तरीका
- PHP को database से connect करने का तरीका
-
PHP का syntax किन programming languages से मिलता-जुलता है?
- C और Java
- Python और Ruby
- JavaScript और Perl
- Swift और Kotlin
-
PHP code लिखने के लिए कौन सा opening tag सबसे ज़्यादा recommended है?
- <?php
- <?
- <%
- <script php>
-
Pure PHP files में closing tag ?> के बारे में सही तरीका क्या है?
- Closing tag न लिखें — इससे trailing whitespace की problem नहीं होती
- Closing tag लिखना ज़रूरी है
- Closing tag और opening tag दोनों optional हैं
- Closing tag सिर्फ HTML files में लिखते हैं
-
Short tag <?= किस चीज़ का shortcut है?
- <?php echo
- <?php print
- <?php return
- <?php output
-
PHP में हर statement के अंत में क्या लिखना ज़रूरी है?
- ; (Semicolon)
- . (Dot)
- : (Colon)
- कुछ नहीं — PHP खुद समझ लेता है
-
Semicolon न लिखने पर PHP में कौन सी error आती है?
- Parse error: syntax error, unexpected token
- Fatal error: Uncaught TypeError
- Warning: Undefined variable
- Notice: Undefined index
-
echo और print में क्या फर्क है?
- echo कई values एक साथ print कर सकता है और print से थोड़ा fast है; print एक value print करता है और return value 1 देता है
- echo सिर्फ numbers print करता है और print सिर्फ strings print करता है
- echo server-side काम करता है और print browser-side काम करता है
- दोनों में कोई फर्क नहीं है
-
echo "Hello $naam" का output क्या होगा? (जब $naam = "Priya" हो)
- Hello Priya — double quotes में variable की value आती है
- Hello $naam — variable का नाम print होता है
- Error आएगी
- Hello {naam}
-
PHP में single-line comment लिखने के लिए कौन से symbols use होते हैं?
- // और #
- // और /* */
- # और /* */
- <!-- --> और //
-
PHP में multi-line comment किन symbols के बीच लिखा जाता है?
- /* और */
- <!-- और -->
- // और //
- ** और **
-
$naam और $Naam — PHP में ये दोनों क्या हैं?
- दो अलग variables — PHP में variables case-sensitive होते हैं
- एक ही variable — PHP में variables case-insensitive होते हैं
- दोनों में error आएगी
- PHP automatically दोनों को same मान लेता है
-
echo, ECHO, और Echo — PHP में ये तीनों कैसे काम करते हैं?
- तीनों एक जैसे काम करते हैं — keywords case-insensitive होते हैं
- तीनों अलग-अलग हैं — keywords case-sensitive होते हैं
- सिर्फ echo काम करता है, बाकी दोनों error देते हैं
- ECHO और Echo deprecated हो चुके हैं
-
PHP में whitespace (spaces, tabs, newlines) के बारे में क्या सही है?
- PHP execution के दौरान whitespace को ignore करता है — code को साफ और readable format में लिखा जा सकता है
- Whitespace ज़रूरी है — बिना इसके code नहीं चलता
- Extra whitespace से program slow हो जाता है
- Whitespace PHP में allowed नहीं है
-
PHP community में indentation का standard कितने spaces का है?
- 4 spaces (PSR-2/PSR-12 coding standard)
- 2 spaces
- 8 spaces
- कोई fixed standard नहीं है