IT quiz
All questions
Sign in
Sign up
JavaScript
HTML
CSS
PostgreSQL
PHP
Linux
Git
Docker
SCSS
TypeScript
SQL
Vue
DNS
Go
frontend (web)
Redis
backend
Gitlab
CI/CD
Vite
webpack
Node.js
HTTP
Python
Kotlin
Nuxt
Question #11
Author:
admin
tags:
PHP
const X = 5; function func() { define('Y', 10); } func(); echo X + Y; // ??
What will be output?
5
10
15
Fatal error: Uncaught Error: Undefined constant "Y" in...
Answer
Show explanation
A constant can be defined inside a function via
define()
function.
Such a constant becomes global.
Rate the difficulty of the question:
1
2
3
4
5
6
7
8
9
10
easy
hard
←
Previous question (PHP)
Next question (PHP)
→
Write new comment